Theme and language

VPN

Connected but nothing loads: MTU, DNS and handshake checks

A calm checklist for a WireGuard tunnel that shows as up while pages do not open: handshake, DNS, MTU, routing and keepalive behind NAT.

Panda Defender editorial team

Prepared with the help of AI from public sources and checked against them; the sources are listed at the end. How we write

In brief

  • A tunnel that looks up can still fail, so check the latest handshake and transferred data first.
  • DNS servers, MTU and routing table settings in the configuration are the next places to look.
  • Behind NAT or a stateful firewall, a keepalive interval of 25 seconds may help, but it is off by default.

A tunnel can look connected while web pages refuse to open. The interface exists, but something along the path is not working. The checks below follow the documentation of the WireGuard tools and go from the simplest to the more specific. They are meant for people who manage their own configuration file.

Start with the handshake

The wg show command reports the interface, its peers, the latest handshake and the amount of data transferred. Read that output before changing anything.

  • A recent handshake and data moving in both directions suggests the tunnel itself is working, so DNS, MTU or routing are more likely causes.
  • No handshake at all points to trouble reaching the other side: a wrong endpoint, a wrong port, or a firewall in between.
  • Data sent but nothing received also suggests the peer is not answering.

The endpoint combines an IP address or a hostname with a port, separated by a colon. Check that both parts are typed correctly. The documentation adds that the endpoint is refreshed automatically from the most recent source of correctly authenticated packets from the peer.

Check DNS

If the handshake looks healthy but names do not resolve, look at the DNS line of the interface. The wg-quick tool applies DNS servers by calling resolvconf when the interface comes up and again when it goes down. PostUp and PostDown commands can be used instead. If resolvconf is not working on your system, the DNS entry may not take effect. A site that opens by address but not by name points to DNS.

Check MTU and routing

When no MTU is set, it is worked out automatically from the endpoint addresses or the system default route. The documentation calls this usually a sane choice, but you can set a value explicitly to override it. If small requests work while larger pages stall, an MTU that does not suit the network is a reasonable suspect, so try a slightly lower explicit value and test again.

Routing matters too. A peer with an allowed range of 0.0.0.0/0 sends all of the machine's traffic through the tunnel, and wg-quick also makes the interface the default gateway. The Table setting controls where routes are added: with it set to off, no routes are created, so traffic will not enter the tunnel as you expect. The default is auto.

Keepalive behind NAT

By default WireGuard stays quiet when idle. Behind NAT or a stateful firewall, the other side may then be unable to reach you. PersistentKeepalive sends an authenticated empty packet at an interval of 1 to 65535 seconds to keep the firewall or NAT mapping valid. The documentation says 25 seconds may help for an interface behind NAT that might receive traffic at any time, but most users do not need it, and it is off by default.

What to do

  • Run wg show and look at the latest handshake and transferred data.
  • If there is no handshake, recheck the endpoint address and port and any firewall on the way.
  • If the handshake is fine, verify the DNS line and that resolvconf works on your system.
  • Try an explicit, slightly lower MTU if only larger pages fail.
  • Confirm the Table setting is not off and the allowed range matches your intent.
  • Behind NAT, try a keepalive of 25 seconds and change one setting at a time.

Sources

  1. wg-quick(8) manual pagewireguard-tools
  2. wg(8) manual pagewireguard-tools
  3. Quick StartWireGuard

Spotted an error? Write to us

Read also