CIDR Exclusion & WireGuard AllowedIPs Builder — Route Everything Except the LAN
Subtract LAN or private ranges from 0.0.0.0/0 or any block and get the minimal CIDR list for WireGuard, routing or MikroTik.
57 CIDR blocks covering 4,272,816,384 IPv4 addresses plus the remaining IPv6 space.
Result = starting routes minus the excluded blocks, plus the always-included ones, summarised into a minimal CIDR list.
When to use the CIDR Exclusion & WireGuard AllowedIPs Builder
All traffic except the LAN
WireGuard has no route-exclusion option. To keep the printer and NAS at home reachable while the VPN is on, 0.0.0.0/0 has to be split into a block list that skips the local networks. This tool works that list out exactly.
Three clear inputs
Starting routes, excluded blocks and always-included blocks. The result is start minus exclusions plus the required blocks, summarised into minimal CIDRs for IPv4 and IPv6 together.
Ready-to-paste formats
Choose an AllowedIPs line for the WireGuard config, one CIDR per line for routing tables, or MikroTik address-list commands in an .rsc file you can import directly.
Tested against Python
Results are compared with address_exclude and collapse_addresses from Python's standard library on dozens of random combinations, and all of them match.
Frequently asked questions
Why are there dozens of blocks?
Every hole in the address space splits a big block into several smaller ones. Excluding just the three RFC 1918 private ranges from 0.0.0.0/0 already yields more than a dozen CIDR blocks.
Does a long list slow WireGuard down?
Not noticeably. WireGuard looks up peers in a trie, so hundreds of prefixes stay fast, although some mobile clients limit how long a config can be.
What about IPv6?
Put ::/0 in the starting routes and fc00::/7 or fe80::/10 in the exclusions. If IPv6 is not sent through the tunnel, IPv6 traffic can leak outside the VPN.
Can I use it for normal routing?
Yes. The one-per-line format suits static routing tables, policy routing rules or firewall address lists.
Is my data sent to a server?
No. Everything is computed in your browser, so your network plan and tunnel addresses stay private.
Similar tools
- CIDR & IP Range to Full Address List ExpanderExpand IPv4/IPv6 CIDRs and start–end ranges into every individual address, ready to export as TXT for scanners and ACLs.
- IP / CIDR List Diff & Allowlist AuditorCompare two IP/CIDR lists by real address coverage: what was added, removed, or overlaps — ideal for firewall allowlist reviews.
- CIDR Aggregator & Supernet Route SummarizerMerge adjacent IPv4 prefixes and contiguous subnets into minimal routing blocks.
- CIDR Block to First–Last Usable IP Range ConverterExpand any /0–/32 CIDR notation into network, broadcast & total host count.