Windows – Bind a program to an outgoing IP address on Windows

ip addressnetworkingputtywindows

I have a Windows 7 RC build system, with dual NICs. Each NIC is connected to subnets with different static IPs (192.168.1.8 on one, and 172.16.0.2 on another).

Certain programs (uTorrent) have configurations which let them use a specific IP for outgoing traffic. This works like a charm, no complaints. However, when I open up Putty, I can't find any configuration info that let's me do the same, and when I actually use it, it's using the default outgoing IP (which has much longer latency to the other subnet than going to it directly). Is there any way to tell Putty to use a non-default outgoing IP?

I've tried messing about with Windows Firewall to restrict Putty to only use the IP that I want, but that didn't seem to work either.

I have this feeling this isn't supplying sufficient information or specificity, so let me know if there are important details I've missed.

Best Answer

It sounds as if you need a static route i.e.

route -p add x.x.x.x mask y.y.y.y <gateway> metric 1

where x.x.x.x and y.y.y.y are the target subnet and is the gateway you want to use. Presumbaly there is a gateway in the 192.168.1 subnet and another in the 172.16.0.0 subnet. Note that this is a global setting i.e. it affects all applications not just Putty. It tells the Windows IP stack to route all packets for x.x.x.x through the gateway you specify.

JR