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 two interfaces on my server; eth0, wich has one public IP address; and eth1, on which 3 IPS are attached. What I'd like to achieve is route traffic coming to the public address configured on eth0 to the IPS configured on eth1, based on the source of the traffic.

I'm on Linux (Ubuntu server).

share|improve this question
    
This is what policy based routing is good for.. blog.scottlowe.org/2013/05/29/… policyrouting.org/PolicyRoutingBook/ONLINE/TOC.html –  NickW Feb 20 at 15:54
    
Sorry, but I'm a networking newbie and I have a hard time understand this blog post. I think I would be able to route traffic from one interface to another base on the source; but not to route traffic from one ip to another. –  arnaud briche Feb 20 at 16:26
    
Routing actually works at the IP layer, not the interface level. So you can quite easily say if it comes from 1.1.1.1 route it via 192.168.1.1 from 2.2.2.2 route it via 192.168.1.2, and endless variations on that theme. –  NickW Feb 20 at 16:31
    
You could also use iptables to do the same thing, whichever you feel more comfortable with –  NickW Feb 20 at 16:33
    
Could someone show an example of using ip or iptables to achieve this. I'm completely lost. –  arnaud briche Feb 20 at 18:02

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.