I have a machine which has 2 IP addresses and 2 network cards. Both IP address stay in private network, and also have internet ip addresses associated with them; and both ip addresses are in the same subnet. Information is something like
CIDR: 10.0.0.0/16
IP 1: 10.0.0.1 (eth0)
IP 2: 10.0.0.2 (eth1)
GW: 10.0.0.254
My requirement is to allow both network cards accessing to the internet. But the default routing strategy in Linux (Red hat 6) is dest based so all traffic go out from e.g. eth0.
ping with -I shows that one of dev does not work, as below
Code:
ping -I eth0 www.google.com
From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
Code:
ping -I eth1 www.google.com
64 bytes from ...: icmp_seq=1 ttl=47 time=12.8 ms
I search/ google then find out a post at
http://serverfault.com/questions/336...ubnet-in-linux (has the same situation as mine) seemingly can solve the issue.
However, following the steps (enabling arp filter then add ip based routing strategy) only switch the outgoing dev from eth1 to eth0 (so ping result is reversed).
I am new to such kind of configuration, therefore, I have no idea on how to troubleshooting such problem. Or the correct steps to enable such routing policy.
Is there any place I can start from checking? Or what is the correct way to setup such routing?
I sincerely appreciate any help.