WireGuard connects, but there's no internet
WireGuard troubleshooting
Updated
What you see
The tunnel is up — the app shows a recent handshake and data coming back — but websites don't load, or only some of them do.
What it means
A completed handshake means your device and the server can talk. What's failing is the next step: the server passing your traffic on to the internet and the replies back to you. WireGuard doesn't do that part itself; the server's network settings do.
Quick fix
On the server, make sure IP forwarding is on and there's a NAT (masquerade) rule for the VPN's subnet. If both are in place, set a DNS server in your config, then try a lower MTU.
Causes and how to fix them
1. IP forwarding is off
Linux only passes traffic between network interfaces when told to. Check it — 1 means on:
sysctl net.ipv4.ip_forward
To switch it on now and keep it on after a reboot:
echo 'net.ipv4.ip_forward=1' | sudo tee /etc/sysctl.d/99-wireguard.conf sudo sysctl --system
2. There's no NAT rule
The server has to rewrite your traffic so it appears to come from its own IP address; without that, replies have no way back to you. Look for a MASQUERADE rule covering the VPN's subnet:
sudo iptables -t nat -L POSTROUTING -n -v
If it's missing, add one. Replace 10.8.0.0/24 with your VPN's subnet and eth0 with the server's main interface (ip route | grep default shows it after “dev”). Put the same command in your config's PostUp line so it survives restarts.
sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
3. A firewall drops forwarded traffic
Even with forwarding on, a firewall can drop traffic passing through the server. With ufw switched on, its default forward policy is to drop; Oracle Cloud's Ubuntu images reject forwarded packets too. Allow forwarding for the WireGuard interface:
sudo iptables -I FORWARD -i wg0 -j ACCEPT sudo iptables -I FORWARD -o wg0 -j ACCEPT
4. DNS isn't set
If websites load by IP address but not by name — ping 1.1.1.1 works, ping example.com doesn't — the tunnel is fine and DNS isn't. Add a DNS server to the [Interface] section of your config:
DNS = 1.1.1.1
5. The MTU is too high
If small pages load but large ones hang, packets are being dropped for being too big — common on mobile networks and some home connections. Lower the MTU in the [Interface] section:
MTU = 1280
Using Nullsify?
Nullsify switches on forwarding and adds the NAT and forwarding rules when it sets the server up, and every config it generates already sets DNS (1.1.1.1) and an MTU of 1280. On Oracle Cloud you still need to remove its forwarding block once — the Oracle setup guide covers it.
Free for 1 server. Bring your own VPS — Nullsify configures WireGuard, AmneziaWG or VLESS on it for you.
Related problems
- Handshake did not complete WireGuard
- Works on Wi-Fi, not mobile data Any protocol
- Connected but websites don't load VLESS + Reality
- Some websites load, others hang (MTU) WireGuard