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.

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 ?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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

share|improve this answer
    
Thanks Khaled, this is exactly what I want. More specific information about ip route and ip rule to do this : tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.rpdb.multiple-links.html –  Rianto Wahyudi Jan 26 '11 at 20:12
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.