`autossh` re-establishes the tunnel without port forwarding

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I launched an autossh tunnel between a Raspberry PI and a VPS and it works. I'm testing whether it's reliable after the RPI internet connection drops and reestablishes.



What I did



  • Created an ~/.ssh/config and confirmed it's valid

  • Installed autossh and successfully started the tunnel defined in the above config

  • Unplugged the ethernet cable from my router, keeping the RPI Wi-Fi connection active

  • Checked netstat -tulpan on both machines; waited a few minutes

  • Plugged the ethernet cable back into the router

What was expected to happen



autossh re-establishes a working tunnel



What actually happened



autossh re-established a tunnel, but when I tried connecting to it from the other end, it gave me:




Unable to communicate with “my-host”. Make sure the remote computer is available and the firewall is not blocking screen sharing.




More info



After I took down the upstream internet connection, netstat on both VPS and RPI respectively showed:




tcp 0 0 VPS_IP:22 RPI_IP:41444 ESTABLISHED PID/sshd: admin




and




tcp 0 0 RPI_IP:41444 VPS_IP:22 ESTABLISHED PID/ssh




That is, same matching ports, and the status ESTABLISHED, even though RPI no longer had internet. Also, netstat on the VPS showed me the port I needed as being connectable (LISTEN), although the tunnel was supposed to be offline.



Once I plugged the cable back into the router, it showed the same situation on both ends, but with different tunnel ports now, plus the one I needed stayed the same.



Few minutes later, as I was writing this post, the port I needed has disappeared from the VPS, and it was only showing me the SSH connections (now two):




tcp 0 0 VPS_IP:22 RPI_IP:41878 ESTABLISHED PID/sshd: admin



tcp 0 0 VPS_IP:22 RPI_IP:41912 ESTABLISHED PID/sshd: admin




And the RPI netstat now looks like:




tcp 0 0 RPI_IP:41878 VPS_IP:22 ESTABLISHED PID/ssh



tcp 0 0 RPI_IP:41912 VPS_IP:22 ESTABLISHED PID/ssh




So apparently it restarted a tunnel (even two) but without port forwarding. Again, initially the tunnel worked. It's been 1 hour now and nothing changed.



I've seen this but the solution appears to be based on the netstat output, which in my case looks fine, but actually isn't working.










share|improve this question



























    up vote
    0
    down vote

    favorite












    I launched an autossh tunnel between a Raspberry PI and a VPS and it works. I'm testing whether it's reliable after the RPI internet connection drops and reestablishes.



    What I did



    • Created an ~/.ssh/config and confirmed it's valid

    • Installed autossh and successfully started the tunnel defined in the above config

    • Unplugged the ethernet cable from my router, keeping the RPI Wi-Fi connection active

    • Checked netstat -tulpan on both machines; waited a few minutes

    • Plugged the ethernet cable back into the router

    What was expected to happen



    autossh re-establishes a working tunnel



    What actually happened



    autossh re-established a tunnel, but when I tried connecting to it from the other end, it gave me:




    Unable to communicate with “my-host”. Make sure the remote computer is available and the firewall is not blocking screen sharing.




    More info



    After I took down the upstream internet connection, netstat on both VPS and RPI respectively showed:




    tcp 0 0 VPS_IP:22 RPI_IP:41444 ESTABLISHED PID/sshd: admin




    and




    tcp 0 0 RPI_IP:41444 VPS_IP:22 ESTABLISHED PID/ssh




    That is, same matching ports, and the status ESTABLISHED, even though RPI no longer had internet. Also, netstat on the VPS showed me the port I needed as being connectable (LISTEN), although the tunnel was supposed to be offline.



    Once I plugged the cable back into the router, it showed the same situation on both ends, but with different tunnel ports now, plus the one I needed stayed the same.



    Few minutes later, as I was writing this post, the port I needed has disappeared from the VPS, and it was only showing me the SSH connections (now two):




    tcp 0 0 VPS_IP:22 RPI_IP:41878 ESTABLISHED PID/sshd: admin



    tcp 0 0 VPS_IP:22 RPI_IP:41912 ESTABLISHED PID/sshd: admin




    And the RPI netstat now looks like:




    tcp 0 0 RPI_IP:41878 VPS_IP:22 ESTABLISHED PID/ssh



    tcp 0 0 RPI_IP:41912 VPS_IP:22 ESTABLISHED PID/ssh




    So apparently it restarted a tunnel (even two) but without port forwarding. Again, initially the tunnel worked. It's been 1 hour now and nothing changed.



    I've seen this but the solution appears to be based on the netstat output, which in my case looks fine, but actually isn't working.










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I launched an autossh tunnel between a Raspberry PI and a VPS and it works. I'm testing whether it's reliable after the RPI internet connection drops and reestablishes.



      What I did



      • Created an ~/.ssh/config and confirmed it's valid

      • Installed autossh and successfully started the tunnel defined in the above config

      • Unplugged the ethernet cable from my router, keeping the RPI Wi-Fi connection active

      • Checked netstat -tulpan on both machines; waited a few minutes

      • Plugged the ethernet cable back into the router

      What was expected to happen



      autossh re-establishes a working tunnel



      What actually happened



      autossh re-established a tunnel, but when I tried connecting to it from the other end, it gave me:




      Unable to communicate with “my-host”. Make sure the remote computer is available and the firewall is not blocking screen sharing.




      More info



      After I took down the upstream internet connection, netstat on both VPS and RPI respectively showed:




      tcp 0 0 VPS_IP:22 RPI_IP:41444 ESTABLISHED PID/sshd: admin




      and




      tcp 0 0 RPI_IP:41444 VPS_IP:22 ESTABLISHED PID/ssh




      That is, same matching ports, and the status ESTABLISHED, even though RPI no longer had internet. Also, netstat on the VPS showed me the port I needed as being connectable (LISTEN), although the tunnel was supposed to be offline.



      Once I plugged the cable back into the router, it showed the same situation on both ends, but with different tunnel ports now, plus the one I needed stayed the same.



      Few minutes later, as I was writing this post, the port I needed has disappeared from the VPS, and it was only showing me the SSH connections (now two):




      tcp 0 0 VPS_IP:22 RPI_IP:41878 ESTABLISHED PID/sshd: admin



      tcp 0 0 VPS_IP:22 RPI_IP:41912 ESTABLISHED PID/sshd: admin




      And the RPI netstat now looks like:




      tcp 0 0 RPI_IP:41878 VPS_IP:22 ESTABLISHED PID/ssh



      tcp 0 0 RPI_IP:41912 VPS_IP:22 ESTABLISHED PID/ssh




      So apparently it restarted a tunnel (even two) but without port forwarding. Again, initially the tunnel worked. It's been 1 hour now and nothing changed.



      I've seen this but the solution appears to be based on the netstat output, which in my case looks fine, but actually isn't working.










      share|improve this question















      I launched an autossh tunnel between a Raspberry PI and a VPS and it works. I'm testing whether it's reliable after the RPI internet connection drops and reestablishes.



      What I did



      • Created an ~/.ssh/config and confirmed it's valid

      • Installed autossh and successfully started the tunnel defined in the above config

      • Unplugged the ethernet cable from my router, keeping the RPI Wi-Fi connection active

      • Checked netstat -tulpan on both machines; waited a few minutes

      • Plugged the ethernet cable back into the router

      What was expected to happen



      autossh re-establishes a working tunnel



      What actually happened



      autossh re-established a tunnel, but when I tried connecting to it from the other end, it gave me:




      Unable to communicate with “my-host”. Make sure the remote computer is available and the firewall is not blocking screen sharing.




      More info



      After I took down the upstream internet connection, netstat on both VPS and RPI respectively showed:




      tcp 0 0 VPS_IP:22 RPI_IP:41444 ESTABLISHED PID/sshd: admin




      and




      tcp 0 0 RPI_IP:41444 VPS_IP:22 ESTABLISHED PID/ssh




      That is, same matching ports, and the status ESTABLISHED, even though RPI no longer had internet. Also, netstat on the VPS showed me the port I needed as being connectable (LISTEN), although the tunnel was supposed to be offline.



      Once I plugged the cable back into the router, it showed the same situation on both ends, but with different tunnel ports now, plus the one I needed stayed the same.



      Few minutes later, as I was writing this post, the port I needed has disappeared from the VPS, and it was only showing me the SSH connections (now two):




      tcp 0 0 VPS_IP:22 RPI_IP:41878 ESTABLISHED PID/sshd: admin



      tcp 0 0 VPS_IP:22 RPI_IP:41912 ESTABLISHED PID/sshd: admin




      And the RPI netstat now looks like:




      tcp 0 0 RPI_IP:41878 VPS_IP:22 ESTABLISHED PID/ssh



      tcp 0 0 RPI_IP:41912 VPS_IP:22 ESTABLISHED PID/ssh




      So apparently it restarted a tunnel (even two) but without port forwarding. Again, initially the tunnel worked. It's been 1 hour now and nothing changed.



      I've seen this but the solution appears to be based on the netstat output, which in my case looks fine, but actually isn't working.







      debian ssh ssh-tunneling autossh






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 7 at 10:05









      Rui F Ribeiro

      36.6k1271116




      36.6k1271116










      asked Aug 13 at 14:19









      aexl

      1255




      1255

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f462310%2fautossh-re-establishes-the-tunnel-without-port-forwarding%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f462310%2fautossh-re-establishes-the-tunnel-without-port-forwarding%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay