I have a server with two NICs (each on a different subnet) and I would like traffic for subnet A to pass through eth0 and traffic for subnet B to pass through eth1. I've read several guides and followed their instructions but I can't ping the gateway associated with eth1 or ping eth1 from outside. I know the switch and its VLANs are configured correctly because I can configure a single NIC with an address on either subnet and it works fine; it's just trying to use both NICs simultaneously that doesn't work. All of these guides basically have the same instructions but I must be missing some vital step. What's wrong with this setup?
/etc/sysconfig/network-scripts/ifcfg-eth0
Code:
DEVICE=eth0
TYPE=Ethernet
UUID=d57f960f-84de-4d0d-8f61-a5d526bb9781
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
HWADDR=00:25:90:C9:6D:30
IPADDR=192.168.101.4
NETMASK=255.255.255.0
PREFIX=24
GATEWAY=192.168.101.1
NETWORK=192.168.101.0
BROADCAST=192.168.101.255
DNS1=192.168.100.2
DNS2=192.168.100.3
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
/etc/sysconfig/network-scripts/ifcfg-eth1
Code:
DEVICE=eth1
HWADDR=00:25:90:C9:6D:31
TYPE=Ethernet
UUID=058b9e36-5d9d-4206-9192-c105fe10f2d4
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=192.168.103.4
PREFIX=24
NETMASK=255.255.255.0
NETWORK=192.168.103.0
BROADCAST=192.168.103.255
DNS1=192.168.100.2
DNS2=192.168.100.3
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth1"
/etc/sysconfig/network-scripts/route-eth0
Code:
192.168.101.0 dev eth0 src 192.168.101.4 table eth0table
default via 192.168.101.1 dev eth0 table eth0table
/etc/sysconfig/network-scripts/route-eth1
Code:
192.168.103.0 dev eth1 src 192.168.103.4 table eth1table
default via 192.168.103.1 dev eth1 table eth1table
/etc/sysconfig/network-scripts/rule-eth0
Code:
from 192.168.101.4/32 table eth0table
to 192.168.101.4 table eth0table
/etc/sysconfig/network-scripts/rule-eth1
Code:
from 192.168.103.4/32 table eth1table
to 192.168.103.4 table eth1table
Code:
[root@virthost1 ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.101.0 * 255.255.255.0 U 0 0 0 eth0
192.168.103.0 * 255.255.255.0 U 0 0 0 eth1
192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0
link-local * 255.255.0.0 U 1002 0 0 eth0
link-local * 255.255.0.0 U 1003 0 0 eth1
default 192.168.101.1 0.0.0.0 UG 0 0 0 eth0
Code:
[root@virthost1 ~]# ip rule show
0: from all lookup local
32760: from all to 192.168.101.4 lookup eth0table
32761: from 192.168.101.4 lookup eth0table
32762: from all to 192.168.103.4 lookup eth1table
32763: from 192.168.103.4 lookup eth1table
32766: from all lookup main
32767: from all lookup default
Code:
[root@virthost1 ~]# ip route show
192.168.101.0/24 dev eth0 proto kernel scope link src 192.168.101.4
192.168.103.0/24 dev eth1 proto kernel scope link src 192.168.103.4
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
169.254.0.0/16 dev eth0 scope link metric 1002
169.254.0.0/16 dev eth1 scope link metric 1003
default via 192.168.101.1 dev eth0
Code:
[root@virthost1 ~]# ping 192.168.101.1
PING 192.168.101.1 (192.168.101.1) 56(84) bytes of data.
64 bytes from 192.168.101.1: icmp_seq=1 ttl=255 time=3.08 ms
64 bytes from 192.168.101.1: icmp_seq=2 ttl=255 time=0.677 ms
Code:
[root@virthost1 ~]# ping 192.168.103.1
PING 192.168.103.1 (192.168.103.1) 56(84) bytes of data.
From 192.168.103.4 icmp_seq=10 Destination Host Unreachable
From 192.168.103.4 icmp_seq=11 Destination Host Unreachable