PPTP VPN randomly disconnects
I found the answer here: Ubuntu 14 pptp client disconnects frequently.
I had to use on the client.
sudo ifconfig wlp3s0 mtu 1400
sudo ifconfig ppp0 mtu 1300
This could be investigated by reading syslog errors:
pouria@pouria-pc:~$ cat /var/log/syslog | grep pptp | grep long
May 31 09:36:11 pouria-pc pptp[18156]: nm-pptp-service-18147 warn[decaps_gre:pptp_gre.c:352]: short read (-1): Message too long
May 31 09:47:14 pouria-pc pptp[18617]: nm-pptp-service-18609 warn[decaps_gre:pptp_gre.c:352]: short read (-1): Message too long
May 31 09:57:18 pouria-pc pptp[19439]: nm-pptp-service-19430 warn[decaps_gre:pptp_gre.c:352]: short read (-1): Message too long
May 31 10:07:21 pouria-pc pptp[20790]: nm-pptp-service-20781 warn[decaps_gre:pptp_gre.c:352]: short read (-1): Message too long
May 31 10:17:57 pouria-pc pptp[21003]: nm-pptp-service-20994 warn[decaps_gre:pptp_gre.c:352]: short read (-1): Message too long
May 31 11:16:36 pouria-pc pptp[23730]: nm-pptp-service-23718 warn[decaps_gre:pptp_gre.c:352]: short read (-1): Message too long
By setting mtu
we are telling the wlan
to use smaller messages.
I wonder why users of other operating systems don't have to configure their WLAN message size to use the simplest form of VPN.
update
To do it permanently
Find your device's interface name wlan0...
by ifconfig
.
Create the file /etc/network/if-up.d/ppp
with the following content:
#! /bin/bash
sudo ifconfig wlp0s20f3 mtu 1400
sudo ifconfig ppp0 mtu 1300
Use chmod +x /etc/network/if-up.d/ppp
to make it executable. It runs on every connect and disconnect.