# Subnet overlaps and gaps

> What it means for two prefixes to overlap or contain one another, why longest-prefix match makes some overlaps intentional, and how to find the unallocated gaps in an address plan.

Source: https://ronutz.com/en/learn/subnet-overlap-and-gaps  
Updated: 2026-06-27  
Related tools: https://ronutz.com/en/tools/cidr

---

## Three things that go wrong in an address plan

As an address plan grows, three problems creep in: two prefixes that **overlap**, one prefix that **contains** another, and **gaps** of address space that nobody allocated. The first two are about prefixes claiming the same addresses; the third is about addresses no prefix claims. A good audit finds all three.

## Overlap and containment

Two prefixes overlap when they share at least one address. There are a few distinct shapes:

- **Identical**: the same block listed twice, often a copy-and-paste mistake.
- **Containment**: one block sits entirely inside another. `10.0.0.0/24` contains `10.0.0.128/25`, because the /25 is the upper half of the /24.
- **Partial**: two ranges share some addresses but neither contains the other. Two proper CIDR (Classless Inter-Domain Routing) blocks never overlap this way. Any two aligned power-of-two blocks are either disjoint or fully nested, one wholly inside the other, which is exactly why CIDR addressing forms a clean hierarchy. A partial overlap only appears when an input is not an aligned block.

Containment is not always a mistake. Routers forward using **longest-prefix match**: the most specific route that matches a destination wins. A specific `/25` advertised inside a summarized `/24` is a deliberate, common pattern, used to steer a slice of traffic differently. The danger is the *unintended* overlap, where two parts of your network both believe they own the same addresses and traffic lands in the wrong place.

## Gaps

A gap is a stretch of a parent block that no subnet covers. Suppose you carved `10.0.0.0/26` and `10.0.0.128/26` out of `10.0.0.0/24`. Between and after them, `10.0.0.64/26` and `10.0.0.192/26` are unallocated. Those two blocks are your gaps: address space you can still assign, reclaim, or simply account for.

Finding gaps matters for two reasons. It shows you where there is room to grow without renumbering, and it confirms that a block you intend to summarize is actually fully used, since a summary advertised over a gap claims addresses you have not assigned.

## Auditing a plan

To check a plan, list every prefix you have assigned and give the parent block as the scope. An overlap report tells you which prefixes collide and how; a gap report tells you exactly which CIDR blocks inside the parent are still free. The [CIDR calculator](https://ronutz.com/en/#cidr) does both in Overlap / gap mode, labeling each overlap as identical, contained, or partial, and expressing every gap as the largest aligned blocks that fill it.

Both halves connect back to [supernetting](https://ronutz.com/en/learn/supernetting-and-aggregation): an address plan with no unintended overlaps and no gaps inside a block is exactly the plan that summarizes cleanly.
