0

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).

peterh
  • 4,953
  • 13
  • 30
  • 44
  • This is what policy based routing is good for.. http://blog.scottlowe.org/2013/05/29/a-quick-introduction-to-linux-policy-routing/ http://www.policyrouting.org/PolicyRoutingBook/ONLINE/TOC.html – 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 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 '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
  • Can you give me an idea of how your network is set up, you don't have to use real addresses, but at least give me an idea of what you want to sort on (source, but what in the source) and destination addresses (same subnet, different subnets?) – NickW Feb 21 '14 at 09:09

0 Answers0