How can I connect public and private node through a reverse SSH tunnel?












6















I have set up my baker with:




  • a public non-baking node with public IP, let's call it "A.A.A.A"

  • a private baking node without public IP


To lock down the private node (and also because it does not need a public IP), I have set up a reverse SSH tunnel for port 9732 from the private to the public node on 19732. Thus, the public node can connect to the private node via its own 127.0.0.1:19732, which forwards to the private nodes port 9732.



I'm running the private node with: ./tezos-node run --rpc-addr 127.0.0.1:8732 --private-mode --no-bootstrap-peers --bootstrap-threshold=1 --connections 1 --peer A.A.A.A



And I'm running the public node with: ./tezos-node run --rpc-addr 127.0.0.1:8732 --peer 127.0.0.1:19732



Additionally, I have tried adding different trust entries like:





  • ./tezos-admin-client trust address 127.0.0.1:19732 on public node


  • ./tezos-admin-client trust address A.A.A.A:9732 on private node


  • ./tezos-admin-client trust peer idxxxxxx on both private and public node


All I keep getting in the private nodes log is: p2p.connection-pool: [private node] incoming connection from untrused peer rejected! and the public node tries, but can never successfully connect to the private node or the other way around.



What can I do or check to get closer to connecting my nodes?










share|improve this question





























    6















    I have set up my baker with:




    • a public non-baking node with public IP, let's call it "A.A.A.A"

    • a private baking node without public IP


    To lock down the private node (and also because it does not need a public IP), I have set up a reverse SSH tunnel for port 9732 from the private to the public node on 19732. Thus, the public node can connect to the private node via its own 127.0.0.1:19732, which forwards to the private nodes port 9732.



    I'm running the private node with: ./tezos-node run --rpc-addr 127.0.0.1:8732 --private-mode --no-bootstrap-peers --bootstrap-threshold=1 --connections 1 --peer A.A.A.A



    And I'm running the public node with: ./tezos-node run --rpc-addr 127.0.0.1:8732 --peer 127.0.0.1:19732



    Additionally, I have tried adding different trust entries like:





    • ./tezos-admin-client trust address 127.0.0.1:19732 on public node


    • ./tezos-admin-client trust address A.A.A.A:9732 on private node


    • ./tezos-admin-client trust peer idxxxxxx on both private and public node


    All I keep getting in the private nodes log is: p2p.connection-pool: [private node] incoming connection from untrused peer rejected! and the public node tries, but can never successfully connect to the private node or the other way around.



    What can I do or check to get closer to connecting my nodes?










    share|improve this question



























      6












      6








      6


      1






      I have set up my baker with:




      • a public non-baking node with public IP, let's call it "A.A.A.A"

      • a private baking node without public IP


      To lock down the private node (and also because it does not need a public IP), I have set up a reverse SSH tunnel for port 9732 from the private to the public node on 19732. Thus, the public node can connect to the private node via its own 127.0.0.1:19732, which forwards to the private nodes port 9732.



      I'm running the private node with: ./tezos-node run --rpc-addr 127.0.0.1:8732 --private-mode --no-bootstrap-peers --bootstrap-threshold=1 --connections 1 --peer A.A.A.A



      And I'm running the public node with: ./tezos-node run --rpc-addr 127.0.0.1:8732 --peer 127.0.0.1:19732



      Additionally, I have tried adding different trust entries like:





      • ./tezos-admin-client trust address 127.0.0.1:19732 on public node


      • ./tezos-admin-client trust address A.A.A.A:9732 on private node


      • ./tezos-admin-client trust peer idxxxxxx on both private and public node


      All I keep getting in the private nodes log is: p2p.connection-pool: [private node] incoming connection from untrused peer rejected! and the public node tries, but can never successfully connect to the private node or the other way around.



      What can I do or check to get closer to connecting my nodes?










      share|improve this question
















      I have set up my baker with:




      • a public non-baking node with public IP, let's call it "A.A.A.A"

      • a private baking node without public IP


      To lock down the private node (and also because it does not need a public IP), I have set up a reverse SSH tunnel for port 9732 from the private to the public node on 19732. Thus, the public node can connect to the private node via its own 127.0.0.1:19732, which forwards to the private nodes port 9732.



      I'm running the private node with: ./tezos-node run --rpc-addr 127.0.0.1:8732 --private-mode --no-bootstrap-peers --bootstrap-threshold=1 --connections 1 --peer A.A.A.A



      And I'm running the public node with: ./tezos-node run --rpc-addr 127.0.0.1:8732 --peer 127.0.0.1:19732



      Additionally, I have tried adding different trust entries like:





      • ./tezos-admin-client trust address 127.0.0.1:19732 on public node


      • ./tezos-admin-client trust address A.A.A.A:9732 on private node


      • ./tezos-admin-client trust peer idxxxxxx on both private and public node


      All I keep getting in the private nodes log is: p2p.connection-pool: [private node] incoming connection from untrused peer rejected! and the public node tries, but can never successfully connect to the private node or the other way around.



      What can I do or check to get closer to connecting my nodes?







      node p2p






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 days ago







      Svante

















      asked 2 days ago









      SvanteSvante

      3859




      3859






















          1 Answer
          1






          active

          oldest

          votes


















          5














          I had same exact situation. It seems that (and I did not see this documented anywhere) when using private mode, the private node must initiate the connection. In my case it was a firewall rule preventing the private node from establishing the connection, and after I permitted that everything worked great.






          share|improve this answer



















          • 1





            Holy smokes, you where right! Doing a sudo ufw allow out from any and connecting from the private node solved it.

            – Svante
            2 days ago












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "698"
          };
          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: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftezos.stackexchange.com%2fquestions%2f1057%2fhow-can-i-connect-public-and-private-node-through-a-reverse-ssh-tunnel%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









          5














          I had same exact situation. It seems that (and I did not see this documented anywhere) when using private mode, the private node must initiate the connection. In my case it was a firewall rule preventing the private node from establishing the connection, and after I permitted that everything worked great.






          share|improve this answer



















          • 1





            Holy smokes, you where right! Doing a sudo ufw allow out from any and connecting from the private node solved it.

            – Svante
            2 days ago
















          5














          I had same exact situation. It seems that (and I did not see this documented anywhere) when using private mode, the private node must initiate the connection. In my case it was a firewall rule preventing the private node from establishing the connection, and after I permitted that everything worked great.






          share|improve this answer



















          • 1





            Holy smokes, you where right! Doing a sudo ufw allow out from any and connecting from the private node solved it.

            – Svante
            2 days ago














          5












          5








          5







          I had same exact situation. It seems that (and I did not see this documented anywhere) when using private mode, the private node must initiate the connection. In my case it was a firewall rule preventing the private node from establishing the connection, and after I permitted that everything worked great.






          share|improve this answer













          I had same exact situation. It seems that (and I did not see this documented anywhere) when using private mode, the private node must initiate the connection. In my case it was a firewall rule preventing the private node from establishing the connection, and after I permitted that everything worked great.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 2 days ago









          Bo ByrdBo Byrd

          3605




          3605








          • 1





            Holy smokes, you where right! Doing a sudo ufw allow out from any and connecting from the private node solved it.

            – Svante
            2 days ago














          • 1





            Holy smokes, you where right! Doing a sudo ufw allow out from any and connecting from the private node solved it.

            – Svante
            2 days ago








          1




          1





          Holy smokes, you where right! Doing a sudo ufw allow out from any and connecting from the private node solved it.

          – Svante
          2 days ago





          Holy smokes, you where right! Doing a sudo ufw allow out from any and connecting from the private node solved it.

          – Svante
          2 days ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Tezos Stack Exchange!


          • 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%2ftezos.stackexchange.com%2fquestions%2f1057%2fhow-can-i-connect-public-and-private-node-through-a-reverse-ssh-tunnel%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

          How did Captain America manage to do this?

          迪纳利

          南乌拉尔铁路局