I’m currently on my way home for a family visit and a weekend with friends. I’m sitting in the first class carriage of an Deutsche Bahn ICE train. Internet is working as expected while surfing. A little bit slow, and I’m getting timeouts from time to time. But it’s workable.

The problem started after I enabled my WireGuard VPN to connect to my Homelab. Initially, it works okay, but then everything just stops. E.g. SSH connections work, but then when I enter tmux for example, everything stops. No clear error message at all.

I first thought that it was due to the spottiness of the WiFi that Deutsche Bahn is famous for. But at the same time, normal surfing to pages which don’t need to be accessed via my VPN was still working surprisingly well. It was just things going through the WireGuard VPN to my Homelab which did not work right.

After some digging (Googling “WireGuard connection problem” really isn’t too useful 😉) I found this reddit post. It describes similar SSH problems as I had seen. Not knowing what else to do, I tried reducing the MTU in the WireGuard config. I am using NetworkManager for my configs, and initially, the MTU for WireGuard was set to “auto”.

MTU setting in the WireGuard config

I manually configured it to “1400” and lo and behold, suddenly everything was working. I don’t know enough about networking to guess what the real problem is here. Possibly the autodetect algorithm hit a corner case due to the unstable connection in the train?