Bug 110205 - ifup-routes doesn't set routes properly
Summary: ifup-routes doesn't set routes properly
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 1
Hardware: i386
OS: Linux
medium
low
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-11-17 01:26 UTC by Brett Johnson
Modified: 2014-03-17 02:40 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-03-17 02:52:56 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Brett Johnson 2003-11-17 01:26:04 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET 
CLR 1.1.4322)

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:

CONFIG="/etc/sysconfig/network-scripts/$NICK.route"

I think it should be:

CONFIG="/etc/sysconfig/networking/devices/$NICK.route"

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):
7.42-1

How reproducible:
Always

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
    

Additional info:

Comment 1 Bill Nottingham 2003-11-17 20:23:12 UTC
AFAIK, the network config tool is supposed to be putting $NICK.route
directly into /etc/sysconfig/network-scripts.

Comment 2 Brett Johnson 2003-11-18 03:55:51 UTC
I thought that might be a possibility, but, I checke Redhat 8 and 9 
and both ifup-routes scripts expect to find eth0.route 
in /etc/sysconfig/networking/devices.
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.



Comment 3 James Fairbairn 2003-12-18 09:30:10 UTC
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: 
 
ADDRESS0=10.0.0.0 
NETMASK0=255.255.255.0 
GATEWAY0=10.0.1.254 
 
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. 
 
I'm 

Comment 4 James Fairbairn 2003-12-18 09:39:39 UTC
Oops, scratch that last comment completely! ifup-routes appears to 
work correctly in my installation. How embarrassing.... :) 

Comment 5 Bill Nottingham 2004-03-17 02:52:56 UTC
If webmin is writing into networking/devices, that's a webmin bug.


Note You need to log in before you can comment on or make changes to this bug.