Skip to content

Why use /32 instead of /24 for a client's [Interface]? #73

Closed
@WinkelCode

Description

@WinkelCode

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions