Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I want to connect remotely using SSH.

However, I'm not able to while my VPN is active, so I disconnect from the VPN and then connect using the other connection.

How can I force the connection through my other connection when connected to the VPN?

I'm using Windows 7 and PuTTY client.

share|improve this question
Please add more information... Provide a routing table of your current machine, what your client OS is (linux, windows) – RomeNYRR Aug 13 '12 at 15:51
up vote 9 down vote accepted

There are 2 options. First, you could modify your routes so the SSH packets naturally go though the correct interface.

Or you could use the '-b' SSH option:

     -b bind_address
             Use bind_address on the local machine as the source address of
             the connection.  Only useful on systems with more than one

It will bind your SSH client to a chosen local IP address, so all packets will be emitted though the associated interface.

share|improve this answer
what's the second option? i'm curious! – Eliran Malka May 1 at 14:59
It would also be helpful to know how to do the equivalent in PuTTY, since the question specified that client. – echristopherson Jun 15 at 17:06

The issue was with the route taken.

The solution was to update the routing table. I used the route command to add a new route specifying the correct interface and gateway.

The command looks like route add destination mask netmask gateway interface, for example:

route -p add mask IF 13

-p is for persistent so it remains there after reboot. IF is for interface and you can get this number from the command route print.

share|improve this answer

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.