Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a computer with two network interfaces (eth0 and usb0) and all traffic goes through eth0 but I want to use the other interface for certain requests (e.g. http://www.website.com) Is this possible?

Im guessing if at all possible it will have something to do with /etc/network/interfaces but haven't been able to figure it out

share|improve this question

migrated from stackoverflow.com Jan 6 '11 at 17:15

This question came from our site for professional and enthusiast programmers.

    
Are you talking about outgoing requests or incoming requests. In other words, are you running a webserver? –  Martijn Heemels Jan 6 '11 at 17:25

2 Answers 2

You have to add a routing rule for each webserver you want to access with usb0. Find out the IP addresses of the webservers and add

ip route add <webserver ip> dev usb0

To make these routes permanent, you have to add them to the file

/etc/sysconfig/networking/devices/route-usb0

But there is one problem left, what about changing IP addresses or webservers with multiple IPs?

share|improve this answer

I assume you are asking about outgoing requests. You can split requests with iptables, etc on Linux but it is going to take some learning. An easier way is to use something like Shorewall to do it. Take a look at their MultiISP document and in particular you are going to want to look at the "Routing Rules" section. You will need to set up rules for each interface.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.