Static Route Gets Ignored
On a Red Hat Enterprise Linux Server release 5.4 (Tikanga) system,
I set up a static route that unfortunately seems to get ignored.
I set up the static route in the file /etc/sysconfig/network-scripts/route-eth0 as follows:
172.16.96.2/32 via 192.168.219.251
I've restarted the network service and also rebooted a few times.
Hereís my current routing table:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.96.2 192.168.219.251 255.255.255.255 UGH 0 0 0 eth0
192.168.219.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.219.250 0.0.0.0 UG 0 0 0 eth0
I am able to ping 172.16.96.2. However, when I do traceroute 172.16.96.2, it appears that the traffic goes through the default gateway 192.168.219.250 instead of our requested specific gateway 192.168.219.251:
[root@colt-vm-4019c ~]# traceroute -n 172.16.96.2
traceroute to 172.16.96.2 (172.16.96.2), 30 hops max, 40 byte packets
1 192.168.219.250 0.511 ms 0.768 ms 0.753 ms
2 172.16.97.1 3.466 ms 3.452 ms 3.434 ms
3 * * *
I can ping both 192.168.219.251 and 192.168.219.250.
In the route-eth0 file, Iíve also tried using the alternate syntax with ADDRESS0=<IP address> etc, but it didnít work any better. I also tried setting a more general route of
172.16.96.0/24 via 192.168.219.251
But this also didnít help.
The System / Administration / Network tool previously showed a spurious extra NIC called eth0.bak in addition to eth0. I deleted the eth0.bak and rebooted, but this also didn't help. Currently, eth0 is the only NIC on the system.
Thanks in advance for any workarounds or diagnostic tips.