prefixkit RU

Subnets

CIDR aggregator

Collapse a list of addresses and subnets into the smallest set of prefixes, convert ranges to CIDR, subtract networks. Ready output for MikroTik, iptables/ipset, nftables, nginx, Cisco and Juniper.

Accepts 10.0.0.0/24, 10.0.0.1, 10.0.0.5-10.0.0.20, 10.0.0.5-20, “10.0.0.0 255.255.255.0”, IPv6. Separate with new lines, spaces or commas.

Why aggregate prefixes

Long address lists in firewalls and routers are slower and hard to maintain. Aggregation collapses adjacent and nested networks: 10.0.0.0/24 and 10.0.1.0/24 become 10.0.0.0/23, and duplicates and overlaps disappear. No address is added or lost.

Range to CIDR

An arbitrary range is usually not one subnet: 192.168.1.5–192.168.1.20 is 192.168.1.5/32, .6/31, .8/29, .16/30 and .20/32. We find the smallest set of such blocks.

Networks of a provider or a country

All prefixes of a provider are on the autonomous systems page; paste them here for a short firewall list. To split a network, use the subnet calculator.