Redhat – How are routes added to the Kernel IP routing table for Red Hat Enterprise Linux

linux-networkingnetworkingredhatroute

Had a bit of an odd problem that not being able to connect from a Red Hat Enterprise Linux Server release 5.11 (10.110.10.230 on our network) to another machine on the network (10.255.10.82)

My routing table looked like this

# /sbin/route 
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
169.254.0.0     *               255.255.0.0     U     0      0        0 eth1
10.0.0.0        *               255.0.0.0       U     0      0        0 eth1
default         10.110.10.1     0.0.0.0         UG    0      0        0 eth1

I deleted this route …

10.0.0.0        *               255.0.0.0       U     0      0        0 eth1

with this command…

/sbin/ip route del 10.0.0.0/8 dev eth1  proto kernel  scope link  src 10.110.10.230

which solved my problem of being able to reach the IP in question, but the route repopulates in the table when I reboot the machine. I thought maybe someone had set a static route on this server, but it doesn't look like anything is defined in the file

# cat /etc/sysconfig/networking/devices/ifcfg-eth1 
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
GATEWAY=10.110.10.1
TYPE=Ethernet
DEVICE=eth1
BOOTPROTO=none
IPADDR=10.110.10.230
ONBOOT=yes
USERCTL=no
IPV6INIT=no
PEERDNS=yes
HWADDR=00:50:56:b9:48:f6

(eth1 is the active adapter on this server)
There are no files in the /etc/sysconfig/ directory that look to set static routes either.

So, my question is in what other ways can a route such as this be set, and why is it "sticky" … coming back after a reboot after removing it?

Best Answer

The route 10.0.0.0/8 is added automatically as your eth1 network interface has a static IP address 10.110.10.230 which is defined in ifcfg-eth1. As the NETMASK attribute is not set in the configuration file, RedHat assumes that you're using the class A default mask (255.0.0.0 or /8 in CIDR notation). So this route is going to be added automatically that's how it should work.

If you delete that route with the ip route command, and you can connect with the other machine is thanks to the default gateway 10.110.10.1 so you may have to check if the network mask for your eth1 should be a different one. Check what's the network mask for your 10.255.10.82 machine or check your router configuration.

Related Topic