Basic Wireguard Help

I'm playing around with Wireguard and can't seem to get it to work. I know it has to be something simple, but I'm not sure what it could be. The two devices are normally connected via OpenVPN tunnel in their local routers. I've disabled the tunnel. Here's the configuration:

Server (ubuntu 20.04):
Code:
[Interface]
Address = 172.16.1.1/24
PrivateKey = <key>=
ListenPort = 41410

[Peer]
#parents pi
PublicKey = l1ITI4wPi+TsMwZzJ5ns9TsUI8z7V7guSErPSuFgKX8=
AllowedIPs = 172.16.1.2/32, 192.168.50.0/24

The server's router has UDP 41410 open and NATted to this server at port 41410.

Client (raspbian buster):
Code:
[Interface]
Address = 172.16.1.2/24
PrivateKey = <key>=

[Peer]
PublicKey = mFiOSnaxtG7x+9aeu5NhtsHo4NjPADiC7EX8orxgHQM=
AllowedIPs = 192.168.4.0/24, 172.16.1.1/32
EndPoint = WAN-IP:41410


Using wg-quick up wg0 at both ends seems to work. On each device, when I issue the wg command I see the Endpoint populated with the IP of the remote. But I can't ping across the tunnel - can't even ping 172.16.1.1 or 172.16.1.2 from either end.

On both machines I have set
Code:
net.ipv4.ip_forward=1
net.ipv4.conf.all.proxy_arp = 1

What am I doing wrong here?
 
Update: I figured it out. The Linux box that is my server has two NICs. I was directing incoming VPN traffic to NIC 1 via a NAT rule from the WAN but didn't realize the default route for NIC 2 had a higher priority/lower metric so responses were coming from it. Changing the route table to prefer NIC 1 fixed things.

Also the proxy ARP setting is wrong. It prevented all our iOS devices from getting DHCP addresses. I'm not 100% sure why but as I understand it the ARP proxy replied to DHCP requests that the address was already in use.
 

Frennzy

Ars Legatus Legionis
85,841
Update: I figured it out. The Linux box that is my server has two NICs. I was directing incoming VPN traffic to NIC 1 via a NAT rule from the WAN but didn't realize the default route for NIC 2 had a higher priority/lower metric so responses were coming from it. Changing the route table to prefer NIC 1 fixed things.

Also the proxy ARP setting is wrong. It prevented all our iOS devices from getting DHCP addresses. I'm not 100% sure why but as I understand it the ARP proxy replied to DHCP requests that the address was already in use.

That's exactly why.

When DHCP does "ping" checking (simple ICMP echo request) to determine if an IP is in use, any device running proxy ARP will respond...and thus the DHCP server will simply never hand out any addresses. (Strictly a layer 2 phenomenon).

This is just one more reason I hate NAT.

Also, yes, routing metrics are your friend.
 
D

Deleted member 46272

Guest
Update: I figured it out. The Linux box that is my server has two NICs. I was directing incoming VPN traffic to NIC 1 via a NAT rule from the WAN but didn't realize the default route for NIC 2 had a higher priority/lower metric so responses were coming from it. Changing the route table to prefer NIC 1 fixed things.

Also the proxy ARP setting is wrong. It prevented all our iOS devices from getting DHCP addresses. I'm not 100% sure why but as I understand it the ARP proxy replied to DHCP requests that the address was already in use.

That's exactly why.

When DHCP does "ping" checking (simple ICMP echo request) to determine if an IP is in use, any device running proxy ARP will respond...and thus the DHCP server will simply never hand out any addresses. (Strictly a layer 2 phenomenon).

This is just one more reason I hate NAT.

Also, yes, routing metrics are your friend.

My understanding is that proxy arp really only makes sense when implemented in a WAP to keep broadcasts from eating into limited airtime. I suppose the same could be said for layer 2 (TAP) VPN tunnels, but this is why TAPs are bad to begin with. Proxy ARPs are a bandaid for TAPs, when the real fix is to use TUNs. Aren't wireguard tunnels TUN (layer 3) and thus don't need proxy arp?