Score:1

How to calculate a working "AllowedIPs" for Wireguard on Android?

in flag

I am using Android to connect to my WireGuard server through the public IP address of the host network. The LAN is using addresses 192.168.0.1-255. I would like the client to connect through the VPN only to addresses with in the LAN and directly access the others. The config is as follows:

[Interface]
PrivateKey = xxx=
Address = 198.18.7.4/32
DNS = 192.168.0.1

[Peer]
PublicKey = xxx=
AllowedIPs = 192.168.0.1/24
Endpoint = my.public.IP:51820

But I am getting a "Bad Address" for whatever I tried to use except for /32. Not being familiar with Subnet Address scheme, I tried to use the table and calculator here which seems to tell me that /24 is the correct subnet. On Windows this seems to work fine.

Any Idea what can be wrong here? Is the AllowedIPs wrong? Or is there an issue with Android that is not in my control?

Thanks!

djdomi avatar
za flag
did you set in the client or server? both must afaik match
Score:2
cn flag

Your AllowedIPs setting is wrong -- it must be a proper subnet: 192.168.0.0/24, not 192.168.0.1/24.

(It's confusing because the Address setting can be specified using the same notation -- eg 198.18.7.4/24 -- but in that case, it means the interface's address is 198.18.7.4 on the 198.18.7.0/24 subnet.)

uncovery avatar
in flag
Thanks! What confused me as well is that Windows does not seem to have an issue with the wrong setting...
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.