Detecting overlapping CIDRs before peering fails
In one line: Why overlapping ranges break VPC peering, VPNs and mergers, why two CIDR blocks are always nested or disjoint, and how to check many ranges systematically.
The most common reason a VPC peering, site-to-site VPN or post-merger network connection fails is an overlapping IP range. When two networks use the same addresses, a router cannot decide which side a packet belongs to. The connection is refused, or worse, one side silently disappears.
CIDR blocks nest or stay apart
Two aligned CIDR blocks cannot partially overlap. When the prefixes differ, the smaller block's size divides the larger block's size, and the smaller block starts at a multiple of its own size. So the whole smaller block is either inside the larger one or outside it. Overlap always means containment.
A: 10.0.0.0/16 (10.0.0.0 – 10.0.255.255) B: 10.0.20.0/24 (10.0.20.0 – 10.0.20.255) → A contains B C: 10.1.0.0/24 (10.1.0.0 – 10.1.0.255) → separate
That leaves three verdicts: identical (same network and prefix), contains (one wraps the other) and separate. A contained block is a duplicate allocation and should be flagged.
A checking procedure
- Normalise every range to
address/prefix. A host address becomes its network address. - Separate by version: IPv4 and IPv6 never overlap each other.
- Sort by network address ascending, then by prefix descending when the starts are equal.
- Compare each block with the ones before it; with the sorted order a stack finishes the job in O(n log n).
- Report the contained block and which block contains it.
| Input | Verdict | Why |
|---|---|---|
| 10.0.0.0/16, 10.0.20.0/24 | contains | the /24 sits inside the /16 |
| 10.0.0.0/16, 10.0.0.0/16 | identical | the same block allocated twice |
| 192.0.2.0/24, 198.51.100.0/24 | separate | different documentation blocks |
| 2001:db8::/32, 2001:db8:1::/48 | contains | the /48 sits inside the /32 |
The conflict clouds create by default
Many teams start with 10.0.0.0/16. When several teams build VPCs with the same range, the problem only appears at peering time. Record allocations in an IPAM sheet before creating a VPC, and check a batch of ranges at once, as this tool does. If ranges already overlap, one side must be redesigned or reached through NAT or a proxy, which costs far more than the check.
Keep the result
A one-off check is worth little. CidrPlan lists the input, the normalised CIDR, every overlapping pair and the containment relationship, and exports the table as CSV or Markdown. Attach it to the change record so the next VPC inherits the same care.
Everything is calculated in your browser. The ranges you type are not stored on a server.
Back to the CIDR calculatorFrequently asked questions
Can two CIDRs ever overlap partially?
No. CIDR blocks are aligned to powers of two, so an overlap always means one block contains the other. A partial overlap cannot be written in CIDR notation.
Can IPv4 and IPv6 be checked in one list?
Yes, but they never overlap. The tool compares within each address family.
What else makes a peering request fail?
Account and region limits, DNS settings and missing route table entries. An address overlap is simply the first thing to rule out.
Sources
- RFC 1918 — Address Allocation for Private Internets
- RFC 5737 — IPv4 Address Blocks Reserved for Documentation
- Amazon VPC — VPC CIDR blocks
Read next
- CIDR notation and subnet masks from the ground upWhat 192.0.2.0/24 actually means: network and broadcast addresses, usable host counts, subnet masks and wildcard masks in one place.
- Designing AWS VPC subnets around five reserved IPsVPC CIDR is /16 to /28, five addresses are reserved in every subnet, and a /28 leaves only 11. Sizing rules, an availability-zone layout and Terraform.
- VLSM: splitting a range by real host requirementsWhy equal-size FLSM wastes space, and how VLSM places the largest requirement first, aligns every block and reports the leftover space.