1

My server has 2 network card installed and I manage to get it up and running. I can ping both interface but I can not ssh or access any service (ie web/ftp) if I connect using second interface.

Both network card have 2 different IP address and live on different subnet.

How do I create routing table so packet are returned via the interface where the packet coming from ie : "if packet coming to eth0, it should come out from eth0 using eth0 gateway. If packet is coming from eth1, then the outgoing response also coming out from eth1 using eth1 gateway"

Is this possible ?

masegaloeh
  • 18,236
  • 10
  • 57
  • 106
Rianto Wahyudi
  • 493
  • 3
  • 11

1 Answers1

1

Yes, this is possible using policy based routing. You need to use ip route and ip rule commands

Khaled
  • 36,533
  • 8
  • 72
  • 99
  • Thanks Khaled, this is exactly what I want. More specific information about ip route and ip rule to do this : http://www.tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.rpdb.multiple-links.html – Rianto Wahyudi Jan 26 '11 at 20:12