Windows VPN and PPTP Connectivity Timeouts
In my pursuit for a personal cloud and convenient secure remote file system so as to be able to develop directly on the server I have researched, tested and decided against SFTP, WebDAV, and SAMBA/NFS over internet. The only approach still standing is the built in Windows VPN and PPTP + SAMBA/CIFS:However there was one bug that prevented some sites/services from working and timing out; the /var/log/syslog showed the following intermittently:
Apr 19 10:15:15 sh1 pptpd[11330]: GRE: accepting packet #107 Apr 19 10:15:15 sh1 pptpd[11330]: GRE: accepting packet #108 Apr 19 10:15:15 sh1 pptpd[11330]: GRE: accepting packet #109 Apr 19 10:15:15 sh1 kernel: mppe_compress[0]: osize too small! (have: 1404 need: 1408) Apr 19 10:15:15 sh1 kernel: ppp0: ppp: compressor dropped pkt Apr 19 10:15:15 sh1 kernel: mppe_compress[0]: osize too small! (have: 1404 need: 1408)
This due to the way MPPE Microsoft point-to-point Encryption encodes data which results in the packet size being bigger then what was agreed in the VPN handshake - is my guess. There is a reported bug from 2005 which sadly hast not yet been addressed.
Fixing the issue by increasing the MTU
You can't fix this issue by modifying the MTU/MRU settings in '/etc/ppp/options' directly, you have to adjust the MTU after the PPP connection is up and this can be accomplished by adding a custom 'ip-up' script.Below is my workaround script, place it into file '/etc/ppp/ip-up.d/mppefixmtu' and ensure that it is executable ('chmod +x mppefixmtu'):
#!/bin/sh CURRENT_MTU="`ifconfig $1 | grep -Po '(?<=MTU:)([0-9]+)'`" FIXED_MTU="`expr $CURRENT_MTU + 4`" ifconfig $1 mtu $FIXED_MTU echo "Increased MTU for $1 to $FIXED_MTU (from $CURRENT_MTU) to fix MPPE Microsoft Point-to-Point bug #330973"
Troubleshooting
You can review script errors by examining the file '/var/log/ppp-ipupdown.log', however if the file doesn't exist then you must create it to enable ip-up/ip-down script logging - don't forget to restart pppd.As always if you found this useful feel free to follow me here or via twitter @danielsokolowski.
I am trying to use your script but I get syntax error,
ReplyDeleteexpr: syntax error
mtu: error fetching interface information: Device not found
Increased MTU for to (from 1500
also I do not have /etc/ppp/ip-up.d/ directory in my installation. therefore where I should add your script so that it works. ?
What distribution is that, the above is based on Debian.
DeleteCentOS 6
ReplyDeleteI think maybe put this config in /etc/ppp/ip-up.local I have the same trouble
DeleteHi. Just put the above script in /etc/ip-up.local and works, just add a line to log to know it working. Regard.
DeleteI am sorry but the above is for Debian/Ubuntu - I am not familiar with CentOS.
ReplyDeleteHi,
ReplyDeleteI got the following mesage in my logs fiel:
kernel: mppe_compress[0]: osize too small! (have: 1404 need: 1408)
and tried to launch your script but it return follwing error:
expr: syntax error
mtu: error fetching interface information: Device not found
Increased MTU for to (from 1500
65536
1396
1408) to fix MPPE Microsoft Point-to-Point bug #330973
here is mppefixmtu content
cat mppefixmtu
#!/bin/sh
CURRENT_MTU="`ifconfig $1 | grep -Po '(?<=MTU:)([0-9]+)'`"
FIXED_MTU="`expr $CURRENT_MTU + 4`"
ifconfig $1 mtu $FIXED_MTU
echo "Increased MTU for $1 to $FIXED_MTU (from $CURRENT_MTU) to fix MPPE Microsoft Point-to-Point bug #330973"
root@ns309111:/etc/ppp/ip-up.d#
What is wrong ?
Regards
Richard
The script is not meant to be run manually, it is called when the session is established by the system as the interface is passed through the $1 argument; the script needs to be placed in `/etc/ppp/ip-up.d/mppefixmtu` on a Debian/Ubuntu machine. Try establishing a connection and then check your `/var/log/syslog` to see if the error persists.
DeleteOK thank you for your reply it seems to be ok
ReplyDeleteRegards
Richard
Many thanks for this - first hit on a google search for the error message - and it works perfectly on Ububtu 12.04
ReplyDeleteHello Centos 6 users,
ReplyDeleteI created file ip-up.local in my /etc/ppp/ directory and added
#!/bin/sh
CURRENT_MTU="`ifconfig $1 | grep -Po '(?<=MTU:)([0-9]+)'`"
FIXED_MTU="`expr $CURRENT_MTU + 4`"
ifconfig $1 mtu $FIXED_MTU
echo "Increased MTU for $1 to $FIXED_MTU (from $CURRENT_MTU) to fix MPPE Microsoft Point-to-Point bug #330973"
Made ip-up.local file executable, restarted the pptpd server, then re-eastablish the ppp connection, but i still get those compressor dropped pkt in my syslog.
Where exactly you placed the script in centos 6 ? in my /etc/ppp directory i did not have ip-up.local file so I created myself.