When using two IP addresses in the same subnet on the same system, why can only one interface use the default gateway?
Issue
- On any RHEL system, when using two or more IP addresses within the same subnet with the same default gateway, only one of the interfaces is able to pass traffic beyond the gateway while the other interfaces are limited to their local subnet.
- When restarting the network service all NIC is getting UP, but able to reach the server from only on NIC.
- Your configuration may resemble the following, on a physical or virtual system:
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.0.50 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:394611 errors:0 dropped:0 overruns:0 frame:0
TX packets:195083 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:339252183 (323.5 MiB) TX bytes:11612402 (11.0 MiB)
eth1 Link encap:Ethernet HWaddr 00:00:00:00:00:01
inet addr:192.168.0.52 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1767 errors:0 dropped:0 overruns:0 frame:0
TX packets:255 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:147323 (143.8 KiB) TX bytes:65505 (63.9 KiB)
# cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep -i gateway
GATEWAY=192.168.0.1
# cat /etc/sysconfig/network-scripts/ifcfg-eth1 | grep -i gateway
GATEWAY=192.168.0.1
Environment
- Red Hat Enterprise Linux
- IP networking
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.