
Two lines on the device
In [Interface] and [Peer]
DNS = 1.1.1.1
AllowedIPs = 0.0.0.0/0, ::/00.0.0.0/0 is all IPv4, ::/0 all IPv6. Leave the second out and IPv6 keeps using the old network.
The server forwards and rewrites
Add to the server's [Interface]
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADETurn forwarding on
echo 'net.ipv4.ip_forward=1' | sudo tee /etc/sysctl.d/99-wg.conf
sudo sysctl --systemThe interface may not be eth0; ip route get 1.1.1.1 prints it after dev.
Check
- IPAny what-is-my-IP page shows the server
- DNSNames fail but IPs work: the DNS line is wrong
- IPv6Your local IPv6 still shows:
::/0is missing
I still want my LAN.
On Windows untick Block untunneled traffic, or replace AllowedIPs with ranges that leave the LAN out.
No internet once connected?
Usually forwarding is off or the interface name in the NAT rule is wrong.
Next letterAdd and remove devices