1

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?

ray_voelker
  • 113
  • 1
  • 5

1 Answers1

2

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.

Miguel A. C.
  • 1,366
  • 11
  • 12
  • "_RedHat assumes that you're using the class A default mask (255.0.0.0 or /8 in CIDR notation)._" Somebody needs to fix that. Classful networking was deprecated 24 years ago, in 1993, by RFCs 1517, 1518, and 1519, which defined CIDR (_Classless_ Inter-Domain Routing). – Ron Maupin Dec 19 '17 at 13:47
  • Well, I'm not responsible of that behavior :) I was trying to explain why is that route configured. – Miguel A. C. Dec 19 '17 at 13:57
  • Thanks for the response on that .... Looks like setting the netmask in the config file to 255.255.255.0 did not create that route 10.0.0.0/8 Not sure how it wasn't a problem previously! – ray_voelker Dec 19 '17 at 15:18
  • A NETMASK=255.255.255.0 should create a route 10.110.10.0/24 route in your case for eth1, but the important thing is that you've located the origin of the route. – Miguel A. C. Dec 19 '17 at 15:36
  • RonMaupin, It's reasonable behavior. There is NO CIDR or netmask defined so it DEFAULTS to the classful mask as a best effort. – Daniel Widrick Dec 20 '17 at 18:05