Every time I connected to a Microsoft PPTP VPN server from Debian/Ubuntu desktop, I experienced slow network and dropped connections. Here’s how I fixed it.
After some digging around I found the default MTU of 1500 is too high. There’s nowhere to alter this in the GUI so each time after connecting I entered:
sudo ifconfig ppp0 mtu 1390
1390 works for me, as the Windows server is using 1400 for RRAS.
All good but not very efficient; so how to make this setting permanent? I tried appending /etc/ppp/ipup with
ifconfig $1 mtu 1390
but this didn’t work for me as the connection is managed by NetworkManager.
After reading through man NetworkManager
, I found there are a set of scripts that can be run to act on various events, so all that’s needed is a script to do the job:
Create script:
sudo nano /etc/NetworkManager/dispatcher.d/vpn-up
Add:
#!/bin/sh #/etc/NetworkManager/dispatcher.d/vpn-up if [ "$2" = "vpn-up" ]; then /sbin/ifconfig "$1" mtu 1390 fi
Set mode on the script:
sudo chmod 0755 /etc/NetworkManager/dispatcher.d/vpn-up
After connecting to the VPN, check MTU is set correctly by issuing command and look for MTU of VPN interface (ppp0 in my case):
ifconfig ppp
ppp0 Link encap:Point-to-Point Protocol inet addr:10.0.0.104 P-t-P:10.0.0.105 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1390 Metric:1 RX packets:1302 errors:0 dropped:0 overruns:0 frame:0 TX packets:1728 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:442401 (442.4 KB) TX bytes:191311 (191.3 KB)
Works for me on Kubuntu 12.10 x64
Andrew
I know this is old, but I had a similar difficulty and was able to find a better solution method. The Network Manager connection settings files are located under /etc/NetworkManager/system-connections/. The configuration options are described here:
https://developer.gnome.org/NetworkManager/stable/nm-settings.html
mtu is one of the available options for some confgurations. Simply add a line mtu= to a section, reboot, and the problem is handled.