# CIDR notation

CIDR notation is a compact way to write a block of IP addresses, such as `100.100.0.0/22`. The part before the slash is the first address in the block. The number after the slash, called the prefix length, says how many of the address's leading bits are fixed. The rest of the bits can vary, and every combination is an address in the block.

An IPv4 address has 32 bits, so a `/22` fixes 22 bits and leaves 10 free. That's 2<sup>10</sup>, or 1,024 addresses, from `100.100.0.0` to `100.100.3.255`. The first and last addresses of a block are reserved, which leaves 1,022 for hosts. A smaller prefix length means a bigger block.

## Common sizes

| CIDR  | Addresses | Usable for hosts |
| ----- | --------- | ---------------- |
| `/30` | 4         | 2                |
| `/24` | 256       | 254              |
| `/22` | 1,024     | 1,022            |
| `/20` | 4,096     | 4,094            |
| `/16` | 65,536    | 65,534           |

A single address is written as a `/32`, like `192.168.86.5/32`.

## Where Managed Nebula uses CIDR notation

- **A network's IPv4 range**: New networks are IPv6-capable, and an IPv4 range is optional. If you add one, hosts can get an overlay address from it. It must be a private or [CGNAT](/docs/glossary/cgnat-range/) range between `/8` and `/30`, and it can't be changed later, so leave room to grow. We recommend `100.100.0.0/22`. See [Choosing a CIDR](/docs/get-started/choosing-a-cidr/).
- **Routes**: A route lists the subnets a router host serves, like `192.168.86.0/24` for a whole VPC subnet or `192.168.86.5/32` for one database. See [Extend network access beyond overlay hosts](/docs/guides/extend-access-beyond-overlay-hosts/).
- **Route firewall rules**: Each rule on a route can limit access to part of its subnets with a local CIDR.
- **Config overrides**: Settings like `lighthouse.local_allow_list` and `preferred_ranges` take lists of CIDRs. See [Configuring advanced host settings](/docs/guides/advanced-host-config/) and [Config override keys](/docs/api/config-override-keys/).

On an [IPv6 overlay](/docs/glossary/ipv6-overlay/), Defined Networking generates the network's IPv6 range for you, so there's no IPv6 CIDR to choose.
