Permanent MTU settings for PPP0 ubuntu

Number of Views : 22600

I have a few servers that I help maintain or use for VPN access.  I have found on a few machines that when I use VPN to secure my connection at a coffee shop or any other public WiFi that some sites will not load.  I have seen this issue before when using PPTP but had never taken the time to investigate.   Sites like Digg would just not load.   After a lot of investigation I as able to see a few obscure issues with the mtu size.  The default PPP0 interface MTU size was 1396

Output of ifconfig:

ppp0

Link encap:Point-to-Point Protocol          inet addr:192.168.240.1  P-t-P:192.168.240.2  Mask:255.255.255.255          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1396  Metric:1          RX packets:9 errors:0 dropped:0 overruns:0 frame:0          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:3

After some google searching I was able to see that my eth0 MTU was set to 1500.    To correct the issue  I increased the PPP0 MTU size to 1492.   That change allowed the sites to load.

Manually change the MTU:

sudo ifconfig ppp0 mtu 1492

I was unable to find a clean permanent solution to keep this set.  I tried the /etc/ppp/options and options.pptp.  The work around I created was to modify the MTU size on the first PPP connection.  I used the ip-up.local file to make this change on every PPP connection.  The ip-up file is executed once a PPP (vpn) connection is started.

I added the following line to ip-up.local

  • ifconfig ppp0 mtu 1492

After these changes every connection will set the mtu to 1492.   This corrected my issue with browsing some sites.

I can now surf the web and get to any site.

Leave a Reply

Your email address will not be published. Required fields are marked *