# How I turn an IPv4 range into CIDR blocks

A beginner-friendly guide to IPv4 ranges, CIDR blocks, allowlists, firewall rules, and using an IPv4 Range Expander.

- Date: 2026-09-27
- URL: https://ilham.dev/posts/how-to-turn-an-ip-range-into-cidr-blocks/
- Markdown: https://ilham.dev/posts/how-to-turn-an-ip-range-into-cidr-blocks/index.md
- Tags: ipv4, cidr, networking, tools
- Reading time: 2 min


Many firewalls and cloud tools want CIDR blocks, but humans often receive IP ranges with a start and end address.

The [IPv4 Range Expander](/tools/ipv4-range-expander/) tool helps me inspect the input and output without writing a one-off script first.

## The simple idea

Many firewalls and cloud tools want CIDR blocks, but humans often receive IP ranges with a start and end address.

I use it to answer one focused question at a time, then I review the result before using it anywhere important.

## Step 1: Enter the start IP address

Enter the start IP address.

## Step 2: Enter the end IP address

Enter the end IP address.

## Step 3: Generate the smallest covering CIDR blocks

Generate the smallest covering CIDR blocks.

## Step 4: Review the number of blocks produced

Review the number of blocks produced.

## Step 5: Check that the range does not include extra addresses you did not intend

Check that the range does not include extra addresses you did not intend.

## Step 6: Use the CIDRs in firewall, routing, or allowlist configuration

Use the CIDRs in firewall, routing, or allowlist configuration.

## Step 7: Document where the range came from

Document where the range came from.

## My checklist

Before I trust the result, I check:

- Enter the start IP address.
- Enter the end IP address.
- Generate the smallest covering CIDR blocks.
- Review the number of blocks produced.
- Check that the range does not include extra addresses you did not intend.
- Use the CIDRs in firewall, routing, or allowlist configuration.
- Document where the range came from.

The tool makes the mechanical part faster. The decision still belongs to me: is this result correct, safe, and appropriate for the real task?
