Is it possible to route the traffic used by a process over a specific interface? for example network traffic by download application should always use the interface wlan0 where as all other applications on the machine should use eth0, is it possible to have this kind of rule in linux.?

link|improve this question

33% accept rate
feedback

2 Answers

Not per application, no. You can do it per port or per ip-address etc, or an application itself can bind to (and use) a specific network card.

You can't set up a rule to do it though.

link|improve this answer
I've a java application, is it possible to bind that app to an interface? – Suresh Apr 17 '11 at 13:36
A Java application you have the source code for and can re-program the internals? – Majenko Apr 17 '11 at 13:48
I've a java application source code that uses apache http library. – Suresh Apr 17 '11 at 13:52
Then I would head over to stackoverflow.com and ask the programmers there how to change your program. I have never programmed in Java. – Majenko Apr 17 '11 at 14:04
feedback

A few people have written shims that use the LD_PRELOAD feature of Linux to achieve this:

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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