Single CIDR block
8.8.8.0 - 8.8.8.255
Converts cleanly to one /24 block.
Convert /24 range
Network tool
Convert an IPv4 or IPv6 start and end address into the smallest set of CIDR blocks that covers the exact range. Use this when a vendor supplies address ranges but your firewall or API expects CIDR notation.
8.8.8.0/24
Reference
Advertisement
Examples
Single CIDR block
8.8.8.0 - 8.8.8.255
Converts cleanly to one /24 block.
Convert /24 range
Uneven range
8.8.8.1 - 8.8.8.3
Returns 8.8.8.1/32 and 8.8.8.2/31, covering all three addresses without adding any others.
Convert uneven range
Boundaries
Start and end addresses must use the same IP version, and the start address must be lower than or equal to the end address. The result optimizes for the fewest CIDR blocks, not for provider ownership or routing policy.
To divide an existing network into equal-sized ranges, use the subnet splitter.
Build the same kind of checks into your code using these documented libraries.
Standard-library IPv4 and IPv6 parsing, networks and membership checks.
Standard-library address and prefix types with Contains and Overlaps methods.
A third-party library for IPv4/IPv6 parsing and CIDR matching.
Next steps
Advertisement