Problems using multiples interfaces. Likely a route issue….

Many times when i setup multiple nic’s on the same machine using LAN (eth0) and WAN (eth1) ip’s. The reason is likely due to a Gateway not being setup correctly in your nic settings. In this case my WAN nic is bound to eth0 and would not ping.

[root@cn2 ~]# ping nike.com
PING nike.com (66.54.56.30) 56(84) bytes of data.
From cn2 (192.168.1.2) icmp_seq=2 Destination Host Unreachable
From cn2 (192.168.1.2) icmp_seq=3 Destination Host Unreachable
From cn2 (192.168.1.2) icmp_seq=4 Destination Host Unreachable
From cn2 (192.168.1.2) icmp_seq=5 Destination Host Unreachable

See current routes…

[root@cn2 ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
link-local * 255.255.0.0 U 1003 0 0 eth1
10.200.0.0 * 255.255.0.0 U 0 0 0 eth1
default 10.200.1.2 0.0.0.0 UG 0 0 0 eth0

Add new route on correct device.

[root@cn2 ~]# route add default gw 10.200.1.2 netmask 0.0.0.0 dev eth1
[root@cn2 ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
link-local * 255.255.0.0 U 1003 0 0 eth1
10.200.0.0 * 255.255.0.0 U 0 0 0 eth1
default 10.200.1.2 0.0.0.0 UG 0 0 0 eth1
default 10.200.1.2 0.0.0.0 UG 0 0 0 eth0

Delete old route.

[root@cn2 ~]# route del default dev eth0
[root@cn2 ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
link-local * 255.255.0.0 U 1003 0 0 eth1
10.200.0.0 * 255.255.0.0 U 0 0 0 eth1
default 10.200.1.2 0.0.0.0 UG 0 0 0 eth1

Done!

Leave a Reply