Monday 13 June 2011

[SOLVED] VPN: short read (-1): 'Message too long'

While working from home I've had a really annoying problem for a while now. I've set my VPN to only use VPN for local addresses. So normally surfing and stuff is fine.
But when send an email through the MS Exchange web interface, or browse a development site on the office network, my VPN fails with this message:

nm-pptp-service-7067 warn[decaps_gre:pptp_gre.c:331]: short read (-1): Message too long

It disconnects any SSH sessions using the VPN, and is generally very annoying.
Finally I think I may have got the answer....



It seems to changing the MTU (maximum transmission unit) for the connection.

Firstly I ran traceroute
Amongst other things this list the pmtu at certain hops.
Here's some output:

1: my-desktop 0.281ms pmtu 1500
1: xxx.xxx.xxx.xxx 1.316ms
1: xxx.xxx.xxx.xxx 1.093ms
2: xxx.xxx.xxx.xxx 1.818ms pmtu 1432

IP addresses are masked.
The first line says my MTU is currently 1500.
Further down it lists the MTU of another network hop. It's lower than mine. So I simply change my MTU to the lowest MTU I found.

In Ubuntu this is very easy to change.
System > Preferences > Network Connections
Edit 'eth0' and there is a box to change the MTU.

It didn't seem to automatically restart the network, so I disconnected using the network manager, then ran the traceroute again to check. Once it said my desktop had MTU 1432, things seemed to be fine.