Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The network setup is as follows:

Server --> VPN (no admin access) --> Internet (IP: V.V.V.V)
  \--> router --> Internet (IP R.R.R.R)

I am trying to access the sshd server when VPN is on. The server's default gateway is set to the VPN to avoid the disconnection problem.
Now I can connect to server via ssh fine when the client is connected to the same router, but it cannot connect to it using R.R.R.R address otherwise. Do I need to configure my routing table so that SSH listens to another gateway?

share|improve this question
up vote 1 down vote accepted

By default, OpenSSH Server should listen on all network interfaces. You can tell with the command netstat -pan and search for the "listening" line showing that the SSH daemon is listening (probably on port 22) on IPv4 address or the IPv6 address :::22. If it's bound to a specific IP address, then you or someone else edited the configuration file to listen on a specific IP.

More likely, you are already listening on all interfaces, which means that even as interfaces and IP addresses come and go, the ssh daemon will bind to all of the interfaces and IPs automatically without having to restart the daemon.

If that's the case, the reason you can't connect is that the VPN is routing all inbound/outbound traffic over the VPN's public IP address. You would have to set up custom routing rules on your server to route around the VPN; this is typically called split tunneling or multi-homing and is sometimes considered to be an IT security violation if the VPN is connecting to sensitive information.

The other way is to configure the VPN for port forwarding, so that it will route accesses to V.V.V.V:22 to your server rather than dropping them or responding with its own ssh daemon. But you said you don't have root access to the VPN, so I'm guessing that's not possible.

Depending on what VPN software you use, the default behavior is probably to disable all inbound/outbound traffic that isn't going through the VPN tunnel... so you'll have to find a way to bypass that. This is software (operating system / VPN software) specific, and since you gave us NO details on what type of VPN or operating system, we can't help you there.

Note for future questions: please try to be as specific as possible when talking about software. Rather than referring to generic technologies like "VPN", give the actual name of the software. And never ask a software question without providing your operating system and version.

share|improve this answer
Thank you. I did pick up the term split tunneling elsewhere, but I mistaken it for VPN port forwarding (as mentioned in your 4th pargraph). Split Tunneling is going to me my homework, as I am not under any security rule. If you a good guide, please let me know! I am using OpenVPN with CrunchBang 10. – Forethinker Aug 19 '12 at 7:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.