crush depth

MTU Strikes Back: Wireguard

Years ago, I had to deal with some aggravation around IPv6. My connection to my ISP is such that I'm using PPPoE which means I have to use an MTU of 1492 instead of the ubiquitous 1500 that everyone else is using:

# ifconfig tun1
tun1: flags=1008051<UP,POINTOPOINT,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 1492

I'm using Wireguard in various places to link multiple networks. Wireguard packets have 80 bytes of overhead, so the virtual interfaces it creates have an MTU of 1420 by default.

You can probably guess where this is going.

On a connection such as mine, a packet of size 1420 plus the 80 bytes of overhead is 1500. This means we'll run into all of the same problems that occurred with IPv6 back in 2017, with all of the same symptoms.

The solution? Set an MTU of 1410 on the Wireguard interfaces.

On FreeBSD:

# ifconfig wg0 mtu 1410

On Linux, you can either use an MTU=1410 directive in the Wireguard configuration file, or:

# ip link set mtu 1410 up dev wg0