Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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..… – NickW Feb 20 '14 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 '14 at 16:26
Routing actually works at the IP layer, not the interface level. So you can quite easily say if it comes from route it via from route it via, and endless variations on that theme. – NickW Feb 20 '14 at 16:31
You could also use iptables to do the same thing, whichever you feel more comfortable with – NickW Feb 20 '14 at 16:33
Could someone show an example of using ip or iptables to achieve this. I'm completely lost. – arnaud briche Feb 20 '14 at 18:02

Your Answer


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

Browse other questions tagged or ask your own question.