Connecting to server which is conncet to VPN





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I have a server and nordvpn account. What I want is that I want to conncet my server with ssh and then in my server I want to conncet my vpn. I want to use my server with vpn.



I install openvpn to my server and when conncet my nordvpn my connection with my server is down of course vpn change my ip. How can I solve this problem?










share|improve this question





























    0















    I have a server and nordvpn account. What I want is that I want to conncet my server with ssh and then in my server I want to conncet my vpn. I want to use my server with vpn.



    I install openvpn to my server and when conncet my nordvpn my connection with my server is down of course vpn change my ip. How can I solve this problem?










    share|improve this question

























      0












      0








      0








      I have a server and nordvpn account. What I want is that I want to conncet my server with ssh and then in my server I want to conncet my vpn. I want to use my server with vpn.



      I install openvpn to my server and when conncet my nordvpn my connection with my server is down of course vpn change my ip. How can I solve this problem?










      share|improve this question














      I have a server and nordvpn account. What I want is that I want to conncet my server with ssh and then in my server I want to conncet my vpn. I want to use my server with vpn.



      I install openvpn to my server and when conncet my nordvpn my connection with my server is down of course vpn change my ip. How can I solve this problem?







      server internet vpn traffic






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 15 at 13:49









      Philip PhilipPhilip Philip

      31




      31






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You could try following:



          Find out the ip adress of the ssh-client curl ifconfig.co



          Than log in to your server and find out it's gateway ip: ip route




          ip route
          default via 192.168.178.1 dev wlan0 proto static metric 600
          192.168.3.0/24 dev eth0 proto kernel scope link src 192.168.3.1 linkdown
          192.168.178.0/24 dev wlan0 proto kernel scope link src 192.168.178.66 metric 600


          In my case my gateway has the ip 192.168.178.1



          Now set up a route (in your server) like this: ip route add client-ssh-ip via gateway-ip in my case: ip route add 80.128.240.55 via 192.168.178.1



          Now you can try to activate your vpn and check if you are still able to log in via ssh. As soon as you reboot your server the route rule will be lost. As soon as your ISP changes your IP the route rule will become useless either. Perhaps as an alternative you can bind your ssh port to the gateway somehow with iptables but i never did this.






          share|improve this answer


























          • It didn't work, when I conncet to my vpn client my ssh connection down. How about binding my ssh port to gateway? I google it but it came to me so networking thing complex. Can you give me more details about it?

            – Philip Philip
            Feb 15 at 23:55











          • i don't know why it did not work for you because i do it that way. i add a route and start the vpn via terminal. perhaps you did not select the correct ip's?

            – AlexOnLinux
            Feb 16 at 10:21













          • Yes you are right, I put the ips wrong places. Now, I can maintain my ssh conncetion and I can able to connect VPN over openvpn. However there is another issue, I could not conncet the internet in my DigitalOcean server. Probably there is a firewall to block VPN but I am not sure about it. My VPN provider has an option obfuscate VPN to bypass these firewalls. However when I install my VPN client and run it terminal, my ssh conncetion is down. I think when connect the vpn over my vpn client, it changes the routing settings.

            – Philip Philip
            Feb 16 at 10:54











          • to me it is not clear what u mean: SSH is working while your VPN connection is established?

            – AlexOnLinux
            Feb 16 at 11:41











          • yeah I connected to vpn and maintain my ssh connection and then I want to check my ip adress in my server and I saw my internet wont work

            – Philip Philip
            Feb 16 at 11:49












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          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%2faskubuntu.com%2fquestions%2f1118515%2fconnecting-to-server-which-is-conncet-to-vpn%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














          You could try following:



          Find out the ip adress of the ssh-client curl ifconfig.co



          Than log in to your server and find out it's gateway ip: ip route




          ip route
          default via 192.168.178.1 dev wlan0 proto static metric 600
          192.168.3.0/24 dev eth0 proto kernel scope link src 192.168.3.1 linkdown
          192.168.178.0/24 dev wlan0 proto kernel scope link src 192.168.178.66 metric 600


          In my case my gateway has the ip 192.168.178.1



          Now set up a route (in your server) like this: ip route add client-ssh-ip via gateway-ip in my case: ip route add 80.128.240.55 via 192.168.178.1



          Now you can try to activate your vpn and check if you are still able to log in via ssh. As soon as you reboot your server the route rule will be lost. As soon as your ISP changes your IP the route rule will become useless either. Perhaps as an alternative you can bind your ssh port to the gateway somehow with iptables but i never did this.






          share|improve this answer


























          • It didn't work, when I conncet to my vpn client my ssh connection down. How about binding my ssh port to gateway? I google it but it came to me so networking thing complex. Can you give me more details about it?

            – Philip Philip
            Feb 15 at 23:55











          • i don't know why it did not work for you because i do it that way. i add a route and start the vpn via terminal. perhaps you did not select the correct ip's?

            – AlexOnLinux
            Feb 16 at 10:21













          • Yes you are right, I put the ips wrong places. Now, I can maintain my ssh conncetion and I can able to connect VPN over openvpn. However there is another issue, I could not conncet the internet in my DigitalOcean server. Probably there is a firewall to block VPN but I am not sure about it. My VPN provider has an option obfuscate VPN to bypass these firewalls. However when I install my VPN client and run it terminal, my ssh conncetion is down. I think when connect the vpn over my vpn client, it changes the routing settings.

            – Philip Philip
            Feb 16 at 10:54











          • to me it is not clear what u mean: SSH is working while your VPN connection is established?

            – AlexOnLinux
            Feb 16 at 11:41











          • yeah I connected to vpn and maintain my ssh connection and then I want to check my ip adress in my server and I saw my internet wont work

            – Philip Philip
            Feb 16 at 11:49
















          0














          You could try following:



          Find out the ip adress of the ssh-client curl ifconfig.co



          Than log in to your server and find out it's gateway ip: ip route




          ip route
          default via 192.168.178.1 dev wlan0 proto static metric 600
          192.168.3.0/24 dev eth0 proto kernel scope link src 192.168.3.1 linkdown
          192.168.178.0/24 dev wlan0 proto kernel scope link src 192.168.178.66 metric 600


          In my case my gateway has the ip 192.168.178.1



          Now set up a route (in your server) like this: ip route add client-ssh-ip via gateway-ip in my case: ip route add 80.128.240.55 via 192.168.178.1



          Now you can try to activate your vpn and check if you are still able to log in via ssh. As soon as you reboot your server the route rule will be lost. As soon as your ISP changes your IP the route rule will become useless either. Perhaps as an alternative you can bind your ssh port to the gateway somehow with iptables but i never did this.






          share|improve this answer


























          • It didn't work, when I conncet to my vpn client my ssh connection down. How about binding my ssh port to gateway? I google it but it came to me so networking thing complex. Can you give me more details about it?

            – Philip Philip
            Feb 15 at 23:55











          • i don't know why it did not work for you because i do it that way. i add a route and start the vpn via terminal. perhaps you did not select the correct ip's?

            – AlexOnLinux
            Feb 16 at 10:21













          • Yes you are right, I put the ips wrong places. Now, I can maintain my ssh conncetion and I can able to connect VPN over openvpn. However there is another issue, I could not conncet the internet in my DigitalOcean server. Probably there is a firewall to block VPN but I am not sure about it. My VPN provider has an option obfuscate VPN to bypass these firewalls. However when I install my VPN client and run it terminal, my ssh conncetion is down. I think when connect the vpn over my vpn client, it changes the routing settings.

            – Philip Philip
            Feb 16 at 10:54











          • to me it is not clear what u mean: SSH is working while your VPN connection is established?

            – AlexOnLinux
            Feb 16 at 11:41











          • yeah I connected to vpn and maintain my ssh connection and then I want to check my ip adress in my server and I saw my internet wont work

            – Philip Philip
            Feb 16 at 11:49














          0












          0








          0







          You could try following:



          Find out the ip adress of the ssh-client curl ifconfig.co



          Than log in to your server and find out it's gateway ip: ip route




          ip route
          default via 192.168.178.1 dev wlan0 proto static metric 600
          192.168.3.0/24 dev eth0 proto kernel scope link src 192.168.3.1 linkdown
          192.168.178.0/24 dev wlan0 proto kernel scope link src 192.168.178.66 metric 600


          In my case my gateway has the ip 192.168.178.1



          Now set up a route (in your server) like this: ip route add client-ssh-ip via gateway-ip in my case: ip route add 80.128.240.55 via 192.168.178.1



          Now you can try to activate your vpn and check if you are still able to log in via ssh. As soon as you reboot your server the route rule will be lost. As soon as your ISP changes your IP the route rule will become useless either. Perhaps as an alternative you can bind your ssh port to the gateway somehow with iptables but i never did this.






          share|improve this answer















          You could try following:



          Find out the ip adress of the ssh-client curl ifconfig.co



          Than log in to your server and find out it's gateway ip: ip route




          ip route
          default via 192.168.178.1 dev wlan0 proto static metric 600
          192.168.3.0/24 dev eth0 proto kernel scope link src 192.168.3.1 linkdown
          192.168.178.0/24 dev wlan0 proto kernel scope link src 192.168.178.66 metric 600


          In my case my gateway has the ip 192.168.178.1



          Now set up a route (in your server) like this: ip route add client-ssh-ip via gateway-ip in my case: ip route add 80.128.240.55 via 192.168.178.1



          Now you can try to activate your vpn and check if you are still able to log in via ssh. As soon as you reboot your server the route rule will be lost. As soon as your ISP changes your IP the route rule will become useless either. Perhaps as an alternative you can bind your ssh port to the gateway somehow with iptables but i never did this.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 15 at 16:35

























          answered Feb 15 at 15:29









          AlexOnLinuxAlexOnLinux

          473210




          473210













          • It didn't work, when I conncet to my vpn client my ssh connection down. How about binding my ssh port to gateway? I google it but it came to me so networking thing complex. Can you give me more details about it?

            – Philip Philip
            Feb 15 at 23:55











          • i don't know why it did not work for you because i do it that way. i add a route and start the vpn via terminal. perhaps you did not select the correct ip's?

            – AlexOnLinux
            Feb 16 at 10:21













          • Yes you are right, I put the ips wrong places. Now, I can maintain my ssh conncetion and I can able to connect VPN over openvpn. However there is another issue, I could not conncet the internet in my DigitalOcean server. Probably there is a firewall to block VPN but I am not sure about it. My VPN provider has an option obfuscate VPN to bypass these firewalls. However when I install my VPN client and run it terminal, my ssh conncetion is down. I think when connect the vpn over my vpn client, it changes the routing settings.

            – Philip Philip
            Feb 16 at 10:54











          • to me it is not clear what u mean: SSH is working while your VPN connection is established?

            – AlexOnLinux
            Feb 16 at 11:41











          • yeah I connected to vpn and maintain my ssh connection and then I want to check my ip adress in my server and I saw my internet wont work

            – Philip Philip
            Feb 16 at 11:49



















          • It didn't work, when I conncet to my vpn client my ssh connection down. How about binding my ssh port to gateway? I google it but it came to me so networking thing complex. Can you give me more details about it?

            – Philip Philip
            Feb 15 at 23:55











          • i don't know why it did not work for you because i do it that way. i add a route and start the vpn via terminal. perhaps you did not select the correct ip's?

            – AlexOnLinux
            Feb 16 at 10:21













          • Yes you are right, I put the ips wrong places. Now, I can maintain my ssh conncetion and I can able to connect VPN over openvpn. However there is another issue, I could not conncet the internet in my DigitalOcean server. Probably there is a firewall to block VPN but I am not sure about it. My VPN provider has an option obfuscate VPN to bypass these firewalls. However when I install my VPN client and run it terminal, my ssh conncetion is down. I think when connect the vpn over my vpn client, it changes the routing settings.

            – Philip Philip
            Feb 16 at 10:54











          • to me it is not clear what u mean: SSH is working while your VPN connection is established?

            – AlexOnLinux
            Feb 16 at 11:41











          • yeah I connected to vpn and maintain my ssh connection and then I want to check my ip adress in my server and I saw my internet wont work

            – Philip Philip
            Feb 16 at 11:49

















          It didn't work, when I conncet to my vpn client my ssh connection down. How about binding my ssh port to gateway? I google it but it came to me so networking thing complex. Can you give me more details about it?

          – Philip Philip
          Feb 15 at 23:55





          It didn't work, when I conncet to my vpn client my ssh connection down. How about binding my ssh port to gateway? I google it but it came to me so networking thing complex. Can you give me more details about it?

          – Philip Philip
          Feb 15 at 23:55













          i don't know why it did not work for you because i do it that way. i add a route and start the vpn via terminal. perhaps you did not select the correct ip's?

          – AlexOnLinux
          Feb 16 at 10:21







          i don't know why it did not work for you because i do it that way. i add a route and start the vpn via terminal. perhaps you did not select the correct ip's?

          – AlexOnLinux
          Feb 16 at 10:21















          Yes you are right, I put the ips wrong places. Now, I can maintain my ssh conncetion and I can able to connect VPN over openvpn. However there is another issue, I could not conncet the internet in my DigitalOcean server. Probably there is a firewall to block VPN but I am not sure about it. My VPN provider has an option obfuscate VPN to bypass these firewalls. However when I install my VPN client and run it terminal, my ssh conncetion is down. I think when connect the vpn over my vpn client, it changes the routing settings.

          – Philip Philip
          Feb 16 at 10:54





          Yes you are right, I put the ips wrong places. Now, I can maintain my ssh conncetion and I can able to connect VPN over openvpn. However there is another issue, I could not conncet the internet in my DigitalOcean server. Probably there is a firewall to block VPN but I am not sure about it. My VPN provider has an option obfuscate VPN to bypass these firewalls. However when I install my VPN client and run it terminal, my ssh conncetion is down. I think when connect the vpn over my vpn client, it changes the routing settings.

          – Philip Philip
          Feb 16 at 10:54













          to me it is not clear what u mean: SSH is working while your VPN connection is established?

          – AlexOnLinux
          Feb 16 at 11:41





          to me it is not clear what u mean: SSH is working while your VPN connection is established?

          – AlexOnLinux
          Feb 16 at 11:41













          yeah I connected to vpn and maintain my ssh connection and then I want to check my ip adress in my server and I saw my internet wont work

          – Philip Philip
          Feb 16 at 11:49





          yeah I connected to vpn and maintain my ssh connection and then I want to check my ip adress in my server and I saw my internet wont work

          – Philip Philip
          Feb 16 at 11:49


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • 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%2faskubuntu.com%2fquestions%2f1118515%2fconnecting-to-server-which-is-conncet-to-vpn%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

          Human spaceflight

          Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

          File:DeusFollowingSea.jpg