naggie / dsnet

FAST command to manage a centralised wireguard VPN. Think wg-quick but quicker: key generation + address allocation.
https://calbryant.uk/blog/how-to-set-up-a-wireguard-vpn-in-minutes-with-dsnet/
MIT License
673 stars 33 forks source link

Client machines can't talk to each other #34

Closed kstenerud closed 3 years ago

kstenerud commented 3 years ago

I tried the following:

The machines connect to the server and can ping the server over the VPN address, and the server can ping the clients, but the clients can't ping each other. Is there something I missed?

naggie commented 3 years ago

sudo dsnet up is missing after dsnet init, but as the server/clients can ping each other it's probably something else. Is this a fresh install? Perhaps there is a firewall rule, or maybe the server/clients something misconfigured with the routing table outside of dsnet. What does ip route say? (assuming linux)

kstenerud commented 3 years ago

Oh yeah, I did a dsnet up :)

This is a fresh VPS instance (ubuntu 20.04) that I've only installed dsnet on.

# ip route
default via 10.18.80.204 dev ens2 proto dhcp src 10.18.80.205 metric 100 
10.5.0.0/22 dev dsnet proto kernel scope link src 10.5.0.1 
10.18.80.204 dev ens2 proto dhcp scope link src 10.18.80.205 metric 100 
10.18.80.204/31 dev ens2 proto kernel scope link src 10.18.80.205 
kstenerud commented 3 years ago
# iptables --list
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
kstenerud commented 3 years ago

Found the problem. IP forwarding wasn't enabled by default.

sysctl -w net.ipv4.ip_forward=1
frillip commented 3 years ago

@kstenerud , you'll want to update /etc/sysctl.conf too so the changes persist over a reboot.

If you want IPv6 forwarding to work, you'll also need to run sysctl -w net.ipv6.conf.dsnet.forwarding=1, and put the corresponding line in /etc/sysctl.conf assuming you are using dsnet as your interface name!

xxxserxxx commented 2 years ago

Hm. I have net.ipv4.ip_forwarding set to 1 and I have this issue. I can ping between the hub and the spokes, but not between the spokes.