-
-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why use /32 instead of /24 for a client's [Interface]? #73
Comments
In the server when you are using /32 you also configuring a route for specific ip address through that peer. It is a routing concept. For example you have route to network /24 through one link A but any specific IP is reachable through other route, you should specify a static route with the ip with CIDR /32 through whatever route is necessary to take. |
Isn't that So from your example
|
Yes |
They serve different purposes @gtrabanco,
https://github.com/pirate/wireguard-docs#how-wireguard-routes-packets If a client has an interface to a node with Wireguard is not an automatic mesh network, you are responsible for setting up the routing manually using these |
https://github.com/pirate/wireguard-docs#QuickStart (Step 4.)
I tried looking into it but so far couldn't find a definitive answer, from what I can tell from testing, both /32 and /24 seem to work mostly the same, except that the netmask obviously is different (for example 255.255.255.255 vs 255.255.255.0). So the choice to use /32 seems weird to me as it would (from my understanding) mean that any traffic would come from outside the client's own subnet.
I understand why one would use /32 in the AllowedIPs for a peer (to prevent peer's netmasks overlapping) but I don't understand why use it in a client's [Interface] config.
Looking at the various guides and documentations from reputable sources there doesn't seem to be a consensus and both /32 or /24 are being used in examples.
Edit: Examples:
/24:
https://www.digitalocean.com/community/tutorials/how-to-set-up-wireguard-on-ubuntu-20-04
https://wiki.debian.org/SimplePrivateTunnelVPNWithWireGuard
The Quick Start video on the official WireGuard website: https://www.wireguard.com/quickstart/
/32:
https://docs.opnsense.org/manual/how-tos/wireguard-client.html (mentions matching client's [Interface] to server's
AllowedIPs
)https://upcloud.com/community/tutorials/get-started-wireguard-vpn/
https://www.thomas-krenn.com/en/wiki/Ubuntu_Desktop_as_WireGuard_VPN_client_configuration
The text was updated successfully, but these errors were encountered: