How to set up application-specific routing table on Windows?

Solution 1:

Sounds like ForceBindIP is what you're looking for :)

ForceBindIP - Bind any Windows application to a specific interface

ForceBindIP is a freeware Windows application that will inject itself into another application and alter how certain Windows Sockets calls are made, allowing you to force the other application to use a specific network interface / IP address. This is useful if you are in an environment with multiple interfaces and your application has no such option for binding to a specific interface.

Some programs that have been tested to work with ForceBindIP include DC++, uTorrent, Quake II, Quake III, Diablo II, StarCraft, Internet Explorer, Mozilla Firefox, Google Earth, Infantry, Real Player, Unreal Tournament 2004 (requires -i), Outlook 2000 (requires -i). Programs that do not work include GetRight (anti-debugger / forking techniques), WinCVS (forks cvs.exe)

You can simply make shortcuts to launch the application using ForceBindIP, with the IP address and program as arguments:

alt text

ForceBindIP is freeware.

Solution 2:

No need to run vmware player and all that. Just enable weakhostreceive on the secondary adapter (i.e. the adapter which has a higher metric).

Then you can run squid and set squid to use tcp_outgoing_address to the ip address of the secondary adapter and proxy all your applications.

I suspect forcebindip should also start working.

What I think is there is a bug in the MS win7 stack. When a packet arrives on the secondary adapter it gets discarded even though it is a valid packet.

Enabling weakhost receive is documented here http://technet.microsoft.com/en-us/magazine/2007.09.cableguy.aspx

netsh interface ipv4 set interface [InterfaceNameOrIndex] weakhostsend=enabled|disabled

netsh interface ipv4 set interface [InterfaceNameOrIndex] weakhostreceive=enabled|disabled

netsh interface ipv6 set interface [InterfaceNameOrIndex] weakhostsend=enabled|disabled

netsh interface ipv6 set interface [InterfaceNameOrIndex] weakhostreceive=enabled|disabled