Thursday, May 23, 2013

PPTP VPN Fails Frequently?

I have upped my Ubuntu to Raring Ringtail 13.04. Everything was just awesome. I set up my workspace. Now, it was the time to code. Woohoo! Connected to PPTP VPN to checkout code.  While I was checking out the code, VPN disconnected. Then on, each time I connect to VPN, it gets disconnected in a minute or so. Never stayed long enough to do something useful. When I switched from ethernet to another broadbad wi-fi, PPTP was stable. So, there was something wrong with my ethernet setting.

After a lot of head banging and, hit and trial, I landed on this post on a forum. It was not very encouraging, plus it was really old. I gave it a try anyway and voilà! it worked! The trick is to lower MTU value. MTU is maximum transmission unit, to quote Wikipedia:
In computer networking, the maximum transmission unit (MTU) of a communications protocol of a layer is the size (in bytes) of the largest protocol data unit that the layer can pass onwards. MTU parameters usually appear in association with a communications interface (NIC, serial port, etc.). Standards (Ethernet, for example) can fix the size of an MTU; or systems (such as point-to-point serial links) may decide MTU at connect time.
 I have set MTU to 1200 down from 1500. Using sudo ifconfig eth0 mtu 1200 command in Ubuntu.
#Before
$ sudo ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:24:d8:d8:32:09
          inet addr:192.168.1.33  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: feff::224:e8ff:fe88:3209/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:142813 errors:0 dropped:0 overruns:0 frame:0
          TX packets:97325 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:174397037 (174.3 MB)  TX bytes:8177616 (8.1 MB)

#Execute command
$ sudo ifconfig eth0 mtu 1200

#After (successfully connected to VPN and stable)
$ sudo ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:24:d8:d8:32:09
          inet addr:192.168.1.33  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1200  Metric:1
          RX packets:142851 errors:0 dropped:0 overruns:0 frame:0
          TX packets:97372 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:174401881 (174.4 MB)  TX bytes:8184649 (8.1 MB)

2 comments:

  1. Drake Says,

    Actually I was not faced in such problem of failing pptp vpn frequently but don't know why you are facing in such problem. May be there is something wrong with your setup that's why checkup the entire setup. Thanks

    ReplyDelete


  2. افضل شركة نقل اثاث بالمدينة المنورة تساعدك على نقل اثاثك بامان فلا داعى للقلق مع افضل شركة نقل اثاث بجدة

    عزيزى العميل انت من محبى التنقل باستمرار بالتالى انت بحاجة ماسة وضروية الى الاستعانة بالمختصين في نقل العفش خاصة ارخص شركة نقل اثاث بالرياض لان الاستعانة باى من عمالة الشوارع الغير مدربة والتي لا تمتلك خبرة كافية في نقل العفش او الحفاظ علية وليس هذا فقط فقد يؤدى الاستعانة بعمالة الشوارع الى حدوث حالة فقدان وتكسير للاثاث بالتالى التاثير الضار عليك عزيزى العميل

    لا تقلق مطلقاً الان بشأن نقل اي منقولات خاصة بك طالما استعنت بشركة الاول لـ نقل الأثاث في الرياض وخارج الرياض فنحن ليس الوحيدون ولكننا متميزون عن اى مؤسسة أخرى داخل وخارج الدمام وشهرتنا كافضل شركة نقل عفش بينبع
    نقل اثاث بجدة

    ReplyDelete