[TriLUG] tying applications to specific interfaces?

Aaron Schrab aaron at schrab.com
Wed Jun 18 13:51:30 EDT 2008


At 12:50 -0400 18 Jun 2008, Greg Brown <gwbrown1 at gmail.com> wrote:
>Let's assume I have an Ubuntu desktop of the latest revision running on a
>desktop machine with two interfaces: one is a 10/100 Ethernet and one is a
>802.11g interface.  Also assume that the Ethernet is the "corporate" network
>and the 802.11 is a public hotspot.
>
>I'd like to tie specific applications to specific interfaces say, for
>instance, VNC to always use my Ethernet interface while Firefox uses my
>wireless.  Is this even possible?

I believe it's possible, although it will likely take some work.

First, you need to setup separate routing tables for the interfaces, 
using the "ip" command.

Then use iptables with the --cmd-owner match to mark packets based on 
the command from which they originated.

Then you should be able to use policy routing ("ip rule") to select the 
appropriate routing table based on the mark set by iptables.

>Furthermore is it possible to have two
>icons for Firefox, one that uses the Ethernet and one that uses the wireless
>network?

You could either install two copies of FireFox, or you could have one of 
them use a local proxy server so that packets originate from different 
binaries.

>Even more furthermore is this kind of thing possible with OS X?

No idea.



More information about the TriLUG mailing list