VPN on OSX disconnects after precisely 2 minutes and 30 seconds on specific network












1















When connecting to my own VPN server on a specific network, called public-network, my Mac disconnects the VPN connection after 2 minutes and 30 seconds.



I have performed several tests and this is the result:




  • It works fine until the 2:30 mark

  • It doesn't matter which Mac I use, it still disconnects

  • It doesn't matter which client I use, all of the following does the same: OSX system client, HMA! Pro VPN and Shimo

  • It doesn't matter which protocol I use, at least all of these protocols does the same: PPTP, OpenVPN and L2TP over IPSec

  • The same thing happens using my own VPN server and HMA!'s VPN server.

  • All other clients (Windows/iPhone) can use any of these VPN servers and protocols without problem on public-network

  • On OSX, all the protocols, clients and servers works fine on any other network


So it seems that it is the combination of OSX, VPN & public-network that causes this.



This is the syslog from my VPN server, when the disconnection happens:



Feb  2 12:04:32 raspberrypi pptpd[31400]: CTRL: EOF or bad error reading ctrl packet length.
Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: couldn't read packet header (exit)
Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: CTRL read failed
Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: Reaping child PPP[31401]
Feb 2 12:04:32 raspberrypi pppd[31401]: Hangup (SIGHUP)
Feb 2 12:04:32 raspberrypi pppd[31401]: Modem hangup
Feb 2 12:04:32 raspberrypi pppd[31401]: Connect time 2.5 minutes.
Feb 2 12:04:32 raspberrypi pppd[31401]: Sent 3963649 bytes, received 362775 bytes.
Feb 2 12:04:32 raspberrypi pppd[31401]: MPPE disabled
Feb 2 12:04:32 raspberrypi pppd[31401]: Connection terminated.
Feb 2 12:04:32 raspberrypi pppd[31401]: Exit.
Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: Client <ip-adress> control connection finished









share|improve this question





























    1















    When connecting to my own VPN server on a specific network, called public-network, my Mac disconnects the VPN connection after 2 minutes and 30 seconds.



    I have performed several tests and this is the result:




    • It works fine until the 2:30 mark

    • It doesn't matter which Mac I use, it still disconnects

    • It doesn't matter which client I use, all of the following does the same: OSX system client, HMA! Pro VPN and Shimo

    • It doesn't matter which protocol I use, at least all of these protocols does the same: PPTP, OpenVPN and L2TP over IPSec

    • The same thing happens using my own VPN server and HMA!'s VPN server.

    • All other clients (Windows/iPhone) can use any of these VPN servers and protocols without problem on public-network

    • On OSX, all the protocols, clients and servers works fine on any other network


    So it seems that it is the combination of OSX, VPN & public-network that causes this.



    This is the syslog from my VPN server, when the disconnection happens:



    Feb  2 12:04:32 raspberrypi pptpd[31400]: CTRL: EOF or bad error reading ctrl packet length.
    Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: couldn't read packet header (exit)
    Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: CTRL read failed
    Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: Reaping child PPP[31401]
    Feb 2 12:04:32 raspberrypi pppd[31401]: Hangup (SIGHUP)
    Feb 2 12:04:32 raspberrypi pppd[31401]: Modem hangup
    Feb 2 12:04:32 raspberrypi pppd[31401]: Connect time 2.5 minutes.
    Feb 2 12:04:32 raspberrypi pppd[31401]: Sent 3963649 bytes, received 362775 bytes.
    Feb 2 12:04:32 raspberrypi pppd[31401]: MPPE disabled
    Feb 2 12:04:32 raspberrypi pppd[31401]: Connection terminated.
    Feb 2 12:04:32 raspberrypi pppd[31401]: Exit.
    Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: Client <ip-adress> control connection finished









    share|improve this question



























      1












      1








      1








      When connecting to my own VPN server on a specific network, called public-network, my Mac disconnects the VPN connection after 2 minutes and 30 seconds.



      I have performed several tests and this is the result:




      • It works fine until the 2:30 mark

      • It doesn't matter which Mac I use, it still disconnects

      • It doesn't matter which client I use, all of the following does the same: OSX system client, HMA! Pro VPN and Shimo

      • It doesn't matter which protocol I use, at least all of these protocols does the same: PPTP, OpenVPN and L2TP over IPSec

      • The same thing happens using my own VPN server and HMA!'s VPN server.

      • All other clients (Windows/iPhone) can use any of these VPN servers and protocols without problem on public-network

      • On OSX, all the protocols, clients and servers works fine on any other network


      So it seems that it is the combination of OSX, VPN & public-network that causes this.



      This is the syslog from my VPN server, when the disconnection happens:



      Feb  2 12:04:32 raspberrypi pptpd[31400]: CTRL: EOF or bad error reading ctrl packet length.
      Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: couldn't read packet header (exit)
      Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: CTRL read failed
      Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: Reaping child PPP[31401]
      Feb 2 12:04:32 raspberrypi pppd[31401]: Hangup (SIGHUP)
      Feb 2 12:04:32 raspberrypi pppd[31401]: Modem hangup
      Feb 2 12:04:32 raspberrypi pppd[31401]: Connect time 2.5 minutes.
      Feb 2 12:04:32 raspberrypi pppd[31401]: Sent 3963649 bytes, received 362775 bytes.
      Feb 2 12:04:32 raspberrypi pppd[31401]: MPPE disabled
      Feb 2 12:04:32 raspberrypi pppd[31401]: Connection terminated.
      Feb 2 12:04:32 raspberrypi pppd[31401]: Exit.
      Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: Client <ip-adress> control connection finished









      share|improve this question
















      When connecting to my own VPN server on a specific network, called public-network, my Mac disconnects the VPN connection after 2 minutes and 30 seconds.



      I have performed several tests and this is the result:




      • It works fine until the 2:30 mark

      • It doesn't matter which Mac I use, it still disconnects

      • It doesn't matter which client I use, all of the following does the same: OSX system client, HMA! Pro VPN and Shimo

      • It doesn't matter which protocol I use, at least all of these protocols does the same: PPTP, OpenVPN and L2TP over IPSec

      • The same thing happens using my own VPN server and HMA!'s VPN server.

      • All other clients (Windows/iPhone) can use any of these VPN servers and protocols without problem on public-network

      • On OSX, all the protocols, clients and servers works fine on any other network


      So it seems that it is the combination of OSX, VPN & public-network that causes this.



      This is the syslog from my VPN server, when the disconnection happens:



      Feb  2 12:04:32 raspberrypi pptpd[31400]: CTRL: EOF or bad error reading ctrl packet length.
      Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: couldn't read packet header (exit)
      Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: CTRL read failed
      Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: Reaping child PPP[31401]
      Feb 2 12:04:32 raspberrypi pppd[31401]: Hangup (SIGHUP)
      Feb 2 12:04:32 raspberrypi pppd[31401]: Modem hangup
      Feb 2 12:04:32 raspberrypi pppd[31401]: Connect time 2.5 minutes.
      Feb 2 12:04:32 raspberrypi pppd[31401]: Sent 3963649 bytes, received 362775 bytes.
      Feb 2 12:04:32 raspberrypi pppd[31401]: MPPE disabled
      Feb 2 12:04:32 raspberrypi pppd[31401]: Connection terminated.
      Feb 2 12:04:32 raspberrypi pppd[31401]: Exit.
      Feb 2 12:04:32 raspberrypi pptpd[31400]: CTRL: Client <ip-adress> control connection finished






      macos vpn openvpn pptp






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 2 '13 at 12:19







      Tyilo

















      asked Feb 2 '13 at 12:05









      TyiloTyilo

      1,35543155




      1,35543155






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Try to test if vpn disconnects on windows system if you are using PPTP then the problem could be in routing and "tcp buffer size" at macos.



          If the problem is only for macos system then this could help:
          try to add routes for your internal network something like this:
          route add -net 192.168.1.0/24 192.168.1.1 (first is mask of our internal network, second is gateway of your network)



          We had similar problem - but vpn didn't disconnected, just all tpc traffic dies. - it is because of buffer size.



          If adding that route via terminal helps then do this:
          create file ip-up at /etc/ppp



          to file paste:



          #!/bin/sh
          PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices;
          export PATH
          /sbin/route add -net 192.168.1.0/24 192.168.1.1 - modify to be same as it is on your network


          save it and modify permission sudo chmod a+x ip-up (/etc/ppp/ip-up)



          On each connection to vpn route will be added.






          share|improve this answer


























          • How can I find my mask of the internal network? The gateway is just the internal ip-address of my VPN server's router, right?

            – Tyilo
            Feb 2 '13 at 14:03











          • I have tested this on a Windows system, where it works perfectly

            – Tyilo
            Feb 2 '13 at 14:03











          • And should the code be executed on the VPN server or on my client Mac?

            – Tyilo
            Feb 2 '13 at 14:27











          • your mask is in settings but if you type on windows/mac netstat -r you will get routes you have on ifconfig - you will get ip configuration of your network (macos) ip of your internal network probably will be same as for your vpn. for example: 192.168.1.1 - 192.168.1.255 is 192.168.1.0/24 and probably default gateway is 192.168.1.1 your default gateway for VPN - this could be same as for your vpn server for internal network - check your DHCP server

            – aegispotae
            Feb 2 '13 at 14:41













          • sry it is missing enters on line ends you want to use command ifconfig for getting info of your network

            – aegispotae
            Feb 2 '13 at 14:48













          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f545499%2fvpn-on-osx-disconnects-after-precisely-2-minutes-and-30-seconds-on-specific-netw%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Try to test if vpn disconnects on windows system if you are using PPTP then the problem could be in routing and "tcp buffer size" at macos.



          If the problem is only for macos system then this could help:
          try to add routes for your internal network something like this:
          route add -net 192.168.1.0/24 192.168.1.1 (first is mask of our internal network, second is gateway of your network)



          We had similar problem - but vpn didn't disconnected, just all tpc traffic dies. - it is because of buffer size.



          If adding that route via terminal helps then do this:
          create file ip-up at /etc/ppp



          to file paste:



          #!/bin/sh
          PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices;
          export PATH
          /sbin/route add -net 192.168.1.0/24 192.168.1.1 - modify to be same as it is on your network


          save it and modify permission sudo chmod a+x ip-up (/etc/ppp/ip-up)



          On each connection to vpn route will be added.






          share|improve this answer


























          • How can I find my mask of the internal network? The gateway is just the internal ip-address of my VPN server's router, right?

            – Tyilo
            Feb 2 '13 at 14:03











          • I have tested this on a Windows system, where it works perfectly

            – Tyilo
            Feb 2 '13 at 14:03











          • And should the code be executed on the VPN server or on my client Mac?

            – Tyilo
            Feb 2 '13 at 14:27











          • your mask is in settings but if you type on windows/mac netstat -r you will get routes you have on ifconfig - you will get ip configuration of your network (macos) ip of your internal network probably will be same as for your vpn. for example: 192.168.1.1 - 192.168.1.255 is 192.168.1.0/24 and probably default gateway is 192.168.1.1 your default gateway for VPN - this could be same as for your vpn server for internal network - check your DHCP server

            – aegispotae
            Feb 2 '13 at 14:41













          • sry it is missing enters on line ends you want to use command ifconfig for getting info of your network

            – aegispotae
            Feb 2 '13 at 14:48


















          0














          Try to test if vpn disconnects on windows system if you are using PPTP then the problem could be in routing and "tcp buffer size" at macos.



          If the problem is only for macos system then this could help:
          try to add routes for your internal network something like this:
          route add -net 192.168.1.0/24 192.168.1.1 (first is mask of our internal network, second is gateway of your network)



          We had similar problem - but vpn didn't disconnected, just all tpc traffic dies. - it is because of buffer size.



          If adding that route via terminal helps then do this:
          create file ip-up at /etc/ppp



          to file paste:



          #!/bin/sh
          PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices;
          export PATH
          /sbin/route add -net 192.168.1.0/24 192.168.1.1 - modify to be same as it is on your network


          save it and modify permission sudo chmod a+x ip-up (/etc/ppp/ip-up)



          On each connection to vpn route will be added.






          share|improve this answer


























          • How can I find my mask of the internal network? The gateway is just the internal ip-address of my VPN server's router, right?

            – Tyilo
            Feb 2 '13 at 14:03











          • I have tested this on a Windows system, where it works perfectly

            – Tyilo
            Feb 2 '13 at 14:03











          • And should the code be executed on the VPN server or on my client Mac?

            – Tyilo
            Feb 2 '13 at 14:27











          • your mask is in settings but if you type on windows/mac netstat -r you will get routes you have on ifconfig - you will get ip configuration of your network (macos) ip of your internal network probably will be same as for your vpn. for example: 192.168.1.1 - 192.168.1.255 is 192.168.1.0/24 and probably default gateway is 192.168.1.1 your default gateway for VPN - this could be same as for your vpn server for internal network - check your DHCP server

            – aegispotae
            Feb 2 '13 at 14:41













          • sry it is missing enters on line ends you want to use command ifconfig for getting info of your network

            – aegispotae
            Feb 2 '13 at 14:48
















          0












          0








          0







          Try to test if vpn disconnects on windows system if you are using PPTP then the problem could be in routing and "tcp buffer size" at macos.



          If the problem is only for macos system then this could help:
          try to add routes for your internal network something like this:
          route add -net 192.168.1.0/24 192.168.1.1 (first is mask of our internal network, second is gateway of your network)



          We had similar problem - but vpn didn't disconnected, just all tpc traffic dies. - it is because of buffer size.



          If adding that route via terminal helps then do this:
          create file ip-up at /etc/ppp



          to file paste:



          #!/bin/sh
          PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices;
          export PATH
          /sbin/route add -net 192.168.1.0/24 192.168.1.1 - modify to be same as it is on your network


          save it and modify permission sudo chmod a+x ip-up (/etc/ppp/ip-up)



          On each connection to vpn route will be added.






          share|improve this answer















          Try to test if vpn disconnects on windows system if you are using PPTP then the problem could be in routing and "tcp buffer size" at macos.



          If the problem is only for macos system then this could help:
          try to add routes for your internal network something like this:
          route add -net 192.168.1.0/24 192.168.1.1 (first is mask of our internal network, second is gateway of your network)



          We had similar problem - but vpn didn't disconnected, just all tpc traffic dies. - it is because of buffer size.



          If adding that route via terminal helps then do this:
          create file ip-up at /etc/ppp



          to file paste:



          #!/bin/sh
          PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices;
          export PATH
          /sbin/route add -net 192.168.1.0/24 192.168.1.1 - modify to be same as it is on your network


          save it and modify permission sudo chmod a+x ip-up (/etc/ppp/ip-up)



          On each connection to vpn route will be added.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 2 '13 at 12:56









          laurent

          4,1181522




          4,1181522










          answered Feb 2 '13 at 12:46









          aegispotaeaegispotae

          1




          1













          • How can I find my mask of the internal network? The gateway is just the internal ip-address of my VPN server's router, right?

            – Tyilo
            Feb 2 '13 at 14:03











          • I have tested this on a Windows system, where it works perfectly

            – Tyilo
            Feb 2 '13 at 14:03











          • And should the code be executed on the VPN server or on my client Mac?

            – Tyilo
            Feb 2 '13 at 14:27











          • your mask is in settings but if you type on windows/mac netstat -r you will get routes you have on ifconfig - you will get ip configuration of your network (macos) ip of your internal network probably will be same as for your vpn. for example: 192.168.1.1 - 192.168.1.255 is 192.168.1.0/24 and probably default gateway is 192.168.1.1 your default gateway for VPN - this could be same as for your vpn server for internal network - check your DHCP server

            – aegispotae
            Feb 2 '13 at 14:41













          • sry it is missing enters on line ends you want to use command ifconfig for getting info of your network

            – aegispotae
            Feb 2 '13 at 14:48





















          • How can I find my mask of the internal network? The gateway is just the internal ip-address of my VPN server's router, right?

            – Tyilo
            Feb 2 '13 at 14:03











          • I have tested this on a Windows system, where it works perfectly

            – Tyilo
            Feb 2 '13 at 14:03











          • And should the code be executed on the VPN server or on my client Mac?

            – Tyilo
            Feb 2 '13 at 14:27











          • your mask is in settings but if you type on windows/mac netstat -r you will get routes you have on ifconfig - you will get ip configuration of your network (macos) ip of your internal network probably will be same as for your vpn. for example: 192.168.1.1 - 192.168.1.255 is 192.168.1.0/24 and probably default gateway is 192.168.1.1 your default gateway for VPN - this could be same as for your vpn server for internal network - check your DHCP server

            – aegispotae
            Feb 2 '13 at 14:41













          • sry it is missing enters on line ends you want to use command ifconfig for getting info of your network

            – aegispotae
            Feb 2 '13 at 14:48



















          How can I find my mask of the internal network? The gateway is just the internal ip-address of my VPN server's router, right?

          – Tyilo
          Feb 2 '13 at 14:03





          How can I find my mask of the internal network? The gateway is just the internal ip-address of my VPN server's router, right?

          – Tyilo
          Feb 2 '13 at 14:03













          I have tested this on a Windows system, where it works perfectly

          – Tyilo
          Feb 2 '13 at 14:03





          I have tested this on a Windows system, where it works perfectly

          – Tyilo
          Feb 2 '13 at 14:03













          And should the code be executed on the VPN server or on my client Mac?

          – Tyilo
          Feb 2 '13 at 14:27





          And should the code be executed on the VPN server or on my client Mac?

          – Tyilo
          Feb 2 '13 at 14:27













          your mask is in settings but if you type on windows/mac netstat -r you will get routes you have on ifconfig - you will get ip configuration of your network (macos) ip of your internal network probably will be same as for your vpn. for example: 192.168.1.1 - 192.168.1.255 is 192.168.1.0/24 and probably default gateway is 192.168.1.1 your default gateway for VPN - this could be same as for your vpn server for internal network - check your DHCP server

          – aegispotae
          Feb 2 '13 at 14:41







          your mask is in settings but if you type on windows/mac netstat -r you will get routes you have on ifconfig - you will get ip configuration of your network (macos) ip of your internal network probably will be same as for your vpn. for example: 192.168.1.1 - 192.168.1.255 is 192.168.1.0/24 and probably default gateway is 192.168.1.1 your default gateway for VPN - this could be same as for your vpn server for internal network - check your DHCP server

          – aegispotae
          Feb 2 '13 at 14:41















          sry it is missing enters on line ends you want to use command ifconfig for getting info of your network

          – aegispotae
          Feb 2 '13 at 14:48







          sry it is missing enters on line ends you want to use command ifconfig for getting info of your network

          – aegispotae
          Feb 2 '13 at 14:48




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f545499%2fvpn-on-osx-disconnects-after-precisely-2-minutes-and-30-seconds-on-specific-netw%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

          Alcedinidae

          RAC Tourist Trophy