I have a simple wireguard network comprised of a single "server" (the only device with an externally routable ip address) and two clients. Communication between the server and the clients seems to work great: from the server, I can access the clients using their wireguard addresses and I can access addresses "behind" the clients. Similarly, from the clients I can access the server's wireguard address.
What doesn't work is client-to-client communication. If from one client I attempt to ping
another client using its wireguard ip address, the ping
fails with:
From 192.168.64.10 icmp_seq=1 Destination Host Unreachable
ping: sendmsg: Destination address required
Furthermore, that ping
attempt doesn't result in any UDP traffic between the client and the server.
I've included my wireguard configuration below.
VPN Nodes
On all nodes:
net.ipv4.ip_forward
is1
- There are no restrictions on the
FORWARD
table - I am not using
wg-quick
to bring up the vpn. I'm using a shell script that is included at the bottom of this post.
Server
# ip addr show wg0
39: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
link/none
inet 192.168.64.1/24 scope global wg0
valid_lft forever preferred_lft forever
# ip route show | grep wg0
10.0.0.0/8 dev wg0 scope link
192.168.1.0/24 dev wg0 scope link
192.168.11.0/24 dev wg0 scope link
192.168.13.0/24 dev wg0 scope link
192.168.64.0/24 dev wg0 proto kernel scope link src 192.168.64.1
[Interface]
PrivateKey = <secret key>
ListenPort = 50001
[Peer]
PublicKey = 1cML7...
AllowedIps = 192.168.1.0/24, 192.168.11.0/24, 192.168.13.0/24, 192.168.64.10/32
PersistentKeepalive = 30
[Peer]
PublicKey = mRjd9...
AllowedIps = 10.0.0.0/8, 192.168.64.11/32
PersistentKeepalive = 30
Client 1
# ip addr show wg0
33: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
link/none
inet 192.168.64.10/24 scope global wg0
valid_lft forever preferred_lft forever
# ip route | grep wg0
10.0.0.0/8 dev wg0 scope link
192.168.64.0/24 dev wg0 proto kernel scope link src 192.168.64.10
[Interface]
PrivateKey = <secret key>
ListenPort = 50001
[Peer]
PublicKey = 2VtQ/...
Endpoint = wg.example.com:50001
AllowedIps = 0.0.0.0/0, 192.168.64.1/32
PersistentKeepalive = 30
[Peer]
PublicKey = mRjd9...
AllowedIps = 10.0.0.0/8, 192.168.64.11/32
PersistentKeepalive = 30
Client 2
# ip addr show wg0
11: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
link/none
inet 192.168.64.11/24 scope global wg0
valid_lft forever preferred_lft forever
# ip route show | grep wg0
192.168.1.0/24 dev wg0 scope link
192.168.11.0/24 dev wg0 scope link
192.168.13.0/24 dev wg0 scope link
192.168.64.0/24 dev wg0 proto kernel scope link src 192.168.64.11
[Interface]
PrivateKey = <secret key>
ListenPort = 50001
[Peer]
PublicKey = 2VtQ/...
Endpoint = wg.example.com:50001
AllowedIps = 0.0.0.0/0, 192.168.64.1/32
PersistentKeepalive = 30
[Peer]
PublicKey = 1cML7...
AllowedIps = 192.168.1.0/24, 192.168.11.0/24, 192.168.13.0/24, 192.168.64.10/32
PersistentKeepalive = 30
Interface configuration script
The wg0
interface on the nodes is configured with the following script:
#!/bin/sh
dev=$1
addr=$2
ip link add $dev type wireguard
ip addr add $addr dev $dev
wg setconf $dev /etc/wireguard/$dev.conf
ip link set $dev up