WireGuard MTU calculator: which MTU to set

WireGuard adds 60 bytes to every packet over IPv4 and 80 over IPv6, so the tunnel's MTU is the line's MTU minus that. Pick your line and the server's address type and get the number for MTU = in [Interface], with ping commands to measure the line and check the tunnel. Too big an MTU is the classic cause of pages that half-load and downloads that hang.

Runs in your browser, nothing is sent

Settings

Measure your line

With the VPN off, ping the server with packets that must not be split. If the answer says the packet needs to be fragmented, lower the size by 10 and repeat. The line's MTU is the largest size that passed plus 28.

Windows

ping -f -l 1472 1.1.1.1

macOS

ping -D -s 1472 -c 3 1.1.1.1

Linux

ping -M do -s 1472 -c 3 1.1.1.1
Result

Tunnel MTU

MTU = 1420

1500 − 40 IPv6 − 8 UDP − 32 WireGuard = 1420

For [Interface] in the config

MTU = 1420

This is WireGuard's own default: it fits any network with MTU 1500, over IPv4 and IPv6.

Not sure counts as IPv6: its headers are bigger, so the number fits both.

Check the tunnel

With the VPN on, these pings must come back. If they don't, lower the MTU by 20 and try again.

Windows

ping -f -l 1392 1.1.1.1

macOS

ping -D -s 1392 -c 3 1.1.1.1

Linux

ping -M do -s 1392 -c 3 1.1.1.1

VLESS, Trojan, VMess and Shadowsocks over TCP don't need this: TCP adjusts its own packet size.

Everything is worked out in your browser: keys and addresses are not sent anywhere.

Reference

What WireGuard adds to a packet

Every data packet gets an outer IP header, a UDP header and WireGuard's own 32 bytes: a 16-byte header and a 16-byte tag. The table is worked out by the same code as the calculator.

ProtocolServer on IPv4Server on IPv6
WireGuard, AmneziaWG 1.x6080
AmneziaWG 2.060 + S480 + S4

Ready numbers

Line MTUServer on IPv4Server on IPv6
150014401420
149214321412
148014201400
146014001380
142013601340
140013401320

FAQ

What MTU should I use for WireGuard?

1420 fits any network with MTU 1500, over IPv4 and IPv6: that is WireGuard's own default. With a server on IPv4, 1440 is enough. On PPPoE (1492), take 1412. On narrower networks, measure the line first.

Why do pages half-load with a VPN?

Packets bigger than the network carries are lost without a word: small requests pass, big ones don't. Lower the tunnel's MTU and the big pages come through.

Is a lower MTU always safe?

Down to 1280 it always works and costs a little speed. Below 1280, IPv6 inside the tunnel stops working.

Does AmneziaWG need a different MTU?

AmneziaWG 1.x adds nothing to data packets, so its numbers are WireGuard's. AmneziaWG 2.0 grows every data packet by S4 bytes: subtract S4 too.

Do I need to set MTU for VLESS or Trojan?

No: over TCP the packet size adjusts itself. In Veli, Diagnostics → Check measures the path MTU and, when it is under 1280, says which tunnel MTU to set.