Lower MTU on tun Device for OpenVPN Client

By | 2014/05/14

Network Manager in Debian and Ubuntu defaults to an MTU of 1500 for an openvpn tun interface. This caused me grief when tethering via T-Mobile and using openvpn. To make sure your openvpn connection works properly, you will need to adjust the MTU lower. Here is how!


Step 1: Connect with openvpn.

Step 2: Lower the MTU on tun0.

Typically the tun device will be called tun0. The following will set the MTU to 1350:

$ sudo ip link set dev tun0 mtu 1350

Done!


Verify tun0 settings with ip a s
$ ip a s
1: lo: < LOOPBACK,UP,LOWER_UP > mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: < NO-CARRIER,BROADCAST,MULTICAST,UP > mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 3c:97:0e:69:13:7e brd ff:ff:ff:ff:ff:ff
    inet 169.254.5.177/16 brd 169.254.255.255 scope link eth0:avahi
3: wlan0: < BROADCAST,MULTICAST,UP,LOWER_UP > mtu 1500 qdisc mq state UP qlen 1000
    link/ether 84:3a:4b:20:ff:12 brd ff:ff:ff:ff:ff:ff
    inet 192.168.43.75/24 brd 192.168.43.255 scope global wlan0
    inet6 fe80::863a:4bff:fe20:ff12/64 scope link 
       valid_lft forever preferred_lft forever
5: tun0: < POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP > mtu 1350 qdisc pfifo_fast state UNKNOWN qlen 100
    link/none 
    inet 172.20.0.6 peer 172.20.0.5/32 brd 172.20.0.6 scope global tun0

For some reason, attempting to set the MTU in Network Manager leads to openvpn failing to connect. At some point I will submit bug reports when I have gathered enough information.