Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
2  
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

2 Answers 2

up vote 4 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
             address.

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

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 10.100.10.10 mask 255.255.255.0 192.168.1.0 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

 
discard

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.