opyebCidrPlan

Detecting overlapping CIDRs before peering fails

Checking · 6 min read

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

  1. Normalise every range to address/prefix. A host address becomes its network address.
  2. Separate by version: IPv4 and IPv6 never overlap each other.
  3. Sort by network address ascending, then by prefix descending when the starts are equal.
  4. Compare each block with the ones before it; with the sorted order a stack finishes the job in O(n log n).
  5. Report the contained block and which block contains it.
InputVerdictWhy
10.0.0.0/16, 10.0.20.0/24containsthe /24 sits inside the /16
10.0.0.0/16, 10.0.0.0/16identicalthe same block allocated twice
192.0.2.0/24, 198.51.100.0/24separatedifferent documentation blocks
2001:db8::/32, 2001:db8:1::/48containsthe /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 calculator

Frequently 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

Read next