Force an application to use a specific interface

Don´t be shy, Linux is fun! =)
Post Reply
User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Force an application to use a specific interface

Post by ayu »

Ok so I have two network interfaces on my computer.
They are eth0 and wlan0.

I want everything in general to just use eth0, which is working like normal.
But there is one application that I want to force to use wlan0, even when eth0 is still active.

I have googled a little, and I could find people who had the same question, but not a definite answer.

Anyone have any idea?
"The best place to hide a tree, is in a forest"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Re: Force an application to use a specific interface

Post by bad_brain »

hm, is the app using specific ports or a specific protocol? :-k
if yes you could do that by using the FORWARD chain of iptables...
Image

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: Force an application to use a specific interface

Post by ayu »

bad_brain wrote:hm, is the app using specific ports or a specific protocol? :-k
if yes you could do that by using the FORWARD chain of iptables...

hmm nope, no specific port or protocol.
Just uses a random port out, and the port it connects to is the default http, which I want to use for the browser of course as well, on the other interface.
The protocols used are HTTP and TCP, so hard to FORWARD :(

Must be others who wanted to do this, so I shall continue my google quest!
If anything else comes to mind, then I would greatly appreciate it :D

Thanks for the answer buddy, talk later! :)
"The best place to hide a tree, is in a forest"

User avatar
Lundis
Distorter of Reality
Distorter of Reality
Posts: 543
Joined: 22 Aug 2008, 16:00
15
Location: Deadlock of Awesome
Contact:

Re: Force an application to use a specific interface

Post by Lundis »

Can you force the application into binding the socket to a specific out port? as in, do you have the source and a bit of luck? :D

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: Force an application to use a specific interface

Post by ayu »

Lundis wrote:Can you force the application into binding the socket to a specific out port? as in, do you have the source and a bit of luck? :D

hmmm, maybe ... I do have the source, so maybe I can give that a try :-k

Thanks for the replies guys :)
"The best place to hide a tree, is in a forest"

Post Reply