Red Hat Bugzilla – Bug 110205
ifup-routes doesn't set routes properly
Last modified: 2014-03-16 22:40:27 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET
Description of problem:
The ifup-routes script isn't accessing the correct location for route
info. I believe it should be looking for interface specific routing
settings in /etc/sysconfig/networking/devices/ but instead the script
looks in /etc/sysconfig/network-scripts/
The offending line is:
I think it should be:
This may not be the only problem as the Redhat network config tool
saves the routes in the old format of route-eth0. Also, the network
config tool won't delete a route properly. I'll report that
somewhere under the correct heading.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.Add a static route in webmin for eth0
2.Do service network restart
3.Do route and see that no static route has been added
AFAIK, the network config tool is supposed to be putting $NICK.route
directly into /etc/sysconfig/network-scripts.
I thought that might be a possibility, but, I checke Redhat 8 and 9
and both ifup-routes scripts expect to find eth0.route
I noticed that the scripts have an older format and the new Redhat
format that it can use.
Older format uses /etc/sysconfig/network-scripts/route-eth0
New format uses /etc/sysconfig/networking/devices/eth0.route
I believe the new format is used in order to support multiple network
profiles in the network configuration utility.
The problem in the ifup-routes script in FC1 is not that it's
looking in the wrong directory; .../network-scripts is where the
system puts the config files for the currently-active network
profile, so this is correct.
The problem appears to be to do with the new format of
route-<interface> file, which expects the following sytax:
The ip route add command expects syntax like this:
ip route add 10.0.0.0/24 via 10.0.1.254 dev <interface>
The ifup-routes script has to convert the $NETMASK0 variable (here,
255.255.255.0) to the short form of the bitmask (here, 24). It even
goes as far as running ipcalc -p to get this information (line 13),
and using a variable called $PREFIX (line 14).
Unfortunately the $PREFIX variable is never actually set, so the ip
route command runs as follows:
ip route add 10.0.0.0/ via 10.0.1.254
So the ifup-routes script needs to be fixed so that it properly
assigns the $PREFIX variable.
Note that there is currently a workaround. The ifup-routes script
supports a different (older) format of the route-<interface> file.
Just put your routes into the route-<interface> file in the format
expected by the ip route add command, i.e.
10.0.0.0/24 via 10.0.1.254
Not sure whether this will be blown away the next time you run neat
or webmin, though.
Oops, scratch that last comment completely! ifup-routes appears to
work correctly in my installation. How embarrassing.... :)
If webmin is writing into networking/devices, that's a webmin bug.