Guides · Published · Updated on
WireGuard AllowedIPs explained, with a calculator
AllowedIPs is the line under each [Peer] in a WireGuard config. It lists the addresses you send to that peer, and the addresses you accept traffic from when it comes back. If your tunnel connects but some traffic doesn’t get through, check this line on both ends, and check IPv6.
If you only need the list, the calculator is further down. Type what should go through the tunnel and what should stay out, and copy the line it writes.
Sending and receiving
Sending. When your device sends a packet into the WireGuard interface, WireGuard looks at the destination address and picks the peer whose range matches it most closely. Peers can have overlapping ranges: with 10.0.0.0/8 on one peer and 10.1.0.0/16 on another, traffic to 10.1.2.3 goes to the second. A packet that matches no peer is dropped.
Receiving. When a packet from a peer arrives and decrypts correctly, WireGuard does the same lookup on its source address. The packet is accepted only if the closest match belongs to the peer that sent it. In the example above, the first peer can’t send traffic from 10.1.2.3, even though its own /8 covers that address. This is why a server lists each client with a single address, such as 10.8.0.2/32.
Each exact range belongs to one peer. Give the same range to a second peer and it moves there. WireGuard calls all of this cryptokey routing.
AllowedIPs and your routes
WireGuard only sees packets that the operating system sends to its interface, and the system’s routes decide that. The tool that starts the tunnel usually sets those routes up from AllowedIPs: wg-quick on Linux and macOS, and the WireGuard apps for Windows, Android and iOS. How they handle a range that covers everything differs:
- Linux,
wg-quick. WithTableunset orauto, a0.0.0.0/0or::/0range goes into a separate routing table, and WireGuard’s own packets are marked so they skip it. A rule still lets the system use more specific routes from the main table, so your local network keeps working with a full tunnel. Every other range becomes an ordinary route. An explicitTablechanges this, andTable = offadds no routes at all (wg-quick manual, WireGuard’s routing notes). - macOS,
wg-quick. A/0range becomes two/1routes, and the script adds a route to the server outside the tunnel. - Windows app. With one peer and a
/0range, it turns on firewall rules that block everything outside the tunnel, your local network included. The editor’s Block untunneled traffic (kill-switch) checkbox switches between/0and two/1ranges to turn this on or off (netquirk.md). - Android app. Each range becomes a route of the VPN. With one peer and a
/0range, IPv4 or IPv6 that the config doesn’t set up at all is blocked (more under IPv6 below).
Common setups
| You want | AllowedIPs on your device |
|---|---|
| All traffic through the tunnel | 0.0.0.0/0, ::/0 |
| Only your home or office network | that network, e.g. 192.168.1.0/24, plus the tunnel’s own range, e.g. 10.8.0.0/24 |
| Everything except your local network | on Linux, 0.0.0.0/0, ::/0 already leaves it reachable; elsewhere, a long list (use the calculator) |
| One machine on the remote network | its address there, e.g. 10.8.0.20/32 |
The last row is about a machine you reach through the tunnel. Don’t confuse it with the server’s public address in Endpoint, which is where WireGuard sends its encrypted packets.
On the server, each [Peer] gets the client’s tunnel address, 10.8.0.2/32. If that client also routes a whole network behind it, such as a home router sharing its LAN, add that network to the same peer.
Why “everything except” turns into a long list
AllowedIPs has no “except”. To leave a network out, you list the rest of the address space as ranges, and the rest rarely fits in one. 0.0.0.0/0 minus 192.168.1.0/24 takes 24 ranges: it starts with 0.0.0.0/1 and 128.0.0.0/2, then narrows down around the gap. How long the list gets depends on where the exclusions fall. Two exclusions next to each other can even make it shorter than one.
Calculator
Separate entries with commas, spaces or new lines. An address on its own counts as one host (/32 for IPv4, /128 for IPv6). An address with a prefix means the whole network it sits in: 192.168.1.23/24 is read as 192.168.1.0/24, and the note under the result says so. Anything the calculator can’t read clears the result until you fix it. It runs in your browser; nothing you type is sent anywhere.
With the fields as they start, the IPv4 part is the same list the WireGuard Android app writes for Exclude private IPs, plus 224.0.0.0/3 (multicast and reserved addresses). Add 224.0.0.0/3 to “Keep out” to get the app’s 30 ranges exactly.
Leave the server’s own address out
With a long list instead of 0.0.0.0/0, check whether the server’s public address falls inside it. If a tunnel route wins for that address, the encrypted packets are sent into the tunnel itself and the connection fails. On Linux this is easy to hit, since wg-quick only does its marking trick for /0. Put the server’s address in “Keep out”, or keep a route to it over your normal connection.
On Android you don’t need this. VPN apps, the WireGuard app included, mark their own connection to the server so Android sends it over the normal network.
IPv6
0.0.0.0/0 covers IPv4 only. What happens to IPv6 depends on the client and the config. It may go around the tunnel, which a leak test shows as an IPv6 address from your own internet provider, or it may be blocked.
Android blocks a family the VPN app sets up nothing for (no address, route or DNS server), unless the app asks to let it through, and then that traffic goes out over the normal network (VpnService.Builder). The WireGuard app relies on the block only when the config has one peer with a /0 range. With several peers, or with the list Exclude private IPs writes, it lets both families through (GoBackend.java). The Windows app’s firewall rules apply only to a single peer with a /0 range.
Add ::/0 to send IPv6 into the tunnel too. If the server can’t forward IPv6, those connections fail. Apps that also try IPv4 then usually connect that way, and sites that only have IPv6 don’t load. How to check if your VPN is working on Android explains the IPv6 test.
The DNS server has to be reachable too
The DNS = line under [Interface] is just an address. If it’s the server’s tunnel address, say 10.8.0.1, that address must be inside AllowedIPs, or lookups never reach it. A full tunnel covers it. With “only my home network”, add the DNS server’s address, or use a DNS server on your normal connection.
The Android app’s Exclude private IPs
The WireGuard app for Android shows Exclude private IPs when the config has exactly one peer and its AllowedIPs contains 0.0.0.0/0 (or already contains the full list). Ticking it replaces 0.0.0.0/0 with a fixed list of 30 IPv4 ranges that leaves out 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 and 224.0.0.0/3. It keeps any other ranges you had, and adds a route for each IPv4 DNS server in the config.
It’s a fixed list, not your actual network. A LAN on another range, like a carrier’s 100.64.0.0/10, stays in the tunnel. It doesn’t touch IPv6, and as the IPv6 section explains, once 0.0.0.0/0 is gone the app lets IPv6 through unless the config also has ::/0.
AllowedIPs in unbraid
unbraid imports WireGuard configs in two places, and they use AllowedIPs differently.
- An app’s exit on Android needs a config whose
AllowedIPscovers all of IPv4, such as0.0.0.0/0. A config that leaves ranges out, like the Exclude private IPs list, is refused with a message saying so. On Android, unbraid keeps your local network reachable with its own setting, Local network bypasses the VPN, so the config doesn’t have to. - On a Mac, an app’s exit needs all public IPv4 addresses, and a configuration that excludes private ranges is also accepted. Import a home tunnel under Settings, Home access, Home WireGuard tunnel.
- A home tunnel on Android (Settings, Local & home access, Home WireGuard tunnel) takes the private IPv4 ranges in the config’s
AllowedIPs(10.0.0.0/8,172.16.0.0/12,192.168.0.0/16and100.64.0.0/10, or parts of them) and sends traffic for those through your home server. Public ranges in it are ignored, and if there are no private ones it uses the private subnet of the config’s own address. Apps keep their own exit for the internet. With Reach your tailnet enabled and a subnet router serving your home network, Tailscale can carry the home subnets you configured while the VPN exits stay connected. - IPv6 ranges in an imported config are ignored. unbraid tunnels IPv4 and blocks IPv6 for apps going through it.
WireGuard split tunneling on Android covers several configs at once, one per app, and how split tunneling works covers routes and per-app rules on every system.
Questions
Is 0.0.0.0/0 the same as 0.0.0.0/1, 128.0.0.0/1? For WireGuard itself, yes: both cover all of IPv4. For the clients, no. Linux wg-quick uses its separate table only for /0, so two /1 ranges become ordinary routes, and then the server’s own address needs a route outside the tunnel. On Windows, the /1 pair is how you avoid the kill-switch rules.
Why does my server drop traffic from a client? Look at the server’s [Peer] for that client. Its AllowedIPs must cover the source address the traffic arrives with, and no other peer may have a closer match for it. A client that routes a LAN behind it needs that LAN listed there, not only its /32.
Can I put a domain name in AllowedIPs? No, only address ranges. To send one website through the tunnel you need its addresses, and those change.
Bring your own VPN
unbraid is a VPN client with no servers of its own. You sign in with an account you already have, or add your own server. It has built-in support for AirVPN, ExpressVPN, IVPN, Mullvad, NordVPN (affiliate link), Private Internet Access, Proton VPN (Free included), Surfshark (affiliate link) and Windscribe. For CyberGhost, you import config files from your account, with step-by-step help in the app.
We earn a commission if you subscribe through a link marked (affiliate link). It helps keep unbraid free. If you're about to subscribe to a VPN service, thank you for considering doing it through one of them.