I wonder if there is some tool that allows me to route all IP traffic of a given program through a particular interface?

Background: I am on a machine with multiple network interfaces connected to different networks. I have switched messaging from Skype to Wire.com, however, the wire.com Windows client does not work through all of the interfaces ("Your connection is not private"). Now I want to route all IP traffic related to wire.com through one particular interface.

What I tried so far:

  • Changing the interface metrics is not an option as this breaks multiple other local tools. For testing purposes it worked for Wire.com.
  • Manually editing the routing table does not work. There is a list of hosts that the Wire.com client connects to. I resolved all host names to IP addresses and added those to the routing table, still, Wire.com refuses to work. This is not an option as wire.com claims that IP addresses are subject to change.
  • I disabled all network interfaces that did not work with Wire.com and launched the Wire client monitoring its traffic with Wireshark. I added all IP addresses to the Windows routing table (route add dest-ip gateway), somehow the connection did not work when I re-enabled the other interfaces.

Thus I wonder if there is some kind of tool that automatically routes a given program's traffic through a particular network interface?


In short, no.

Routing is based on IP, port, and protocol—not on application. It happens at the system level, in the OS's networking stack.

The only theoretical way of having an application do something different from everything else (as far as I can think of) is if the application—or everything else—is paused and then resumed on some kind of polling basis. When the application resumes it changes the routing; when it is suspended it changes it back.

However, it's not possible to suspend all non-application processes in such a way. (Even if you could, I can't imagine anything but poor performance out of either the system or the application.)

Your only single-OS options are to distinguish what the application does by IP, port, or protocol—or to switch between different networking profiles for everything that uses the application's networking information as the application is launched and then terminated.

An alternative would be to run the application in a virtual machine on the same operating system—such as VirtualBox or something from VMware.

In doing this, the virtual machine would have its own networking stack that could be configured independently of the host OS it runs on.

| improve this answer | |
  • Thanks a lot! I am aware that routing happens on OS level. Actually VBox made me ask this question - because VBox inserts a layer between host and client OS. I wonder if there is anything that inserts such a layer not between a whole client OS and the host but rather some tool that inserts that IP stack just with a single program as its client. In my opinion, another option would be to somehow bind the program to a particular IP - then, I assume traffic would be routed through the gateway for this very subnet. But I guess this needs to be implemented on software level... – Aileron79 May 17 '18 at 7:50
  • @Aileron79 Unfortunately, while virtualization does allow for such a "layer," it can only be utilized in combination with another networking stack—which requires an OS. Your application needs to be installed to, and run on, an OS. There is no such thing as an OS that is just a networking stack. Virtual technology such as Docker and Kubernetes offer more "modular" applications and networking—but that's an even greater investment (and learning curve) than the simpler desktop applications. If you could identify broad ranges of IP subnets used by wire.com, you could forgo individual IPs . . . – Jason Bassford May 17 '18 at 8:03
  • I'll try to do that. Just figured out there is a tool named "ForceBindIP" (see r1ch.net/projects/forcebindip), however, it does not seem to work with Wire. – Aileron79 May 17 '18 at 8:08
  • @Aileron79 In theory, you might be able to use some kind of packet sniffer to identify the unique packets generated by Wire, and then redirect them. However, I do not personally know of Windows utilities for that, nor is it guaranteed that every Wire-generated packet is unique enough to be filtered in such a way. – Jason Bassford May 17 '18 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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