this post was submitted on 03 Jan 2024
1 points (100.0% liked)

WireGuard

3 readers
1 users here now

WireGuard - a fast, modern, secure VPN Tunnel.

founded 1 year ago
MODERATORS
 
This is an automated archive.

The original was posted on /r/wireguard by /u/gurkalurka on 2024-01-03 04:20:02+00:00.


If I set

AllowedIPs = 0.0.0.0/0

I get a ping/ssh etc. All routes fine.

If I restrict AllowedIPs with 10.10.0.0/32 I get nothing on the routing.

Here is my wg0 conf:

[Interface]
Address = 10.10.0.1/24
#SaveConfig = true
PostUp = ip rule add table 200 from 
PostUp = ip route add table 200 default via 
PreDown = ip rule delete table 200 from 
PreDown = ip route delete table 200 default via 
PostDown = iptables -D INPUT -p udp --dport 51820 -j ACCEPT; iptables -t nat -D POSTROUTING -s 10.10.0.0/24 -o primary -j MASQUERADE
ListenPort = 51820
PrivateKey = xxx
DNS = 8.8.8.8 1.1.1.1

#peer 1
[Peer]
PublicKey = yyy
PresharedKey = zzz
AllowedIPs = 10.10.0.2/32

Peer 1 config:

[Interface]
PrivateKey = xxx
ListenPort = 51820
Address = 10.10.0.2/32
DNS = 1.1.1.1, 1.0.0.1
MTU = 1412

[Peer]
PublicKey = yyy
PresharedKey = zzz
AllowedIPs = 0.0.0.0/0
Endpoint = :51820
PersistentKeepalive = 25

Everything works fine only if using 0.0.0.0/0 as the allowed IPs setting. I would like to restrict it to 10.10.0.0/32 so I only route IPs that exist on this network through the tunnel, and everything else should use my normal route without the tunnel. I had this working before, but now not sure what's causing this.

Thanks

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here