Bug 68218 - RH7.3 format of ifcfg-ethX:X files is not compatible with older releases
RH7.3 format of ifcfg-ethX:X files is not compatible with older releases
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
7.3
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-07-08 05:23 EDT by Need Real Name
Modified: 2014-03-16 22:28 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-07-09 10:51:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2002-07-08 05:23:09 EDT
Description of Problem:
The ifcfg-ethX:X files are used for aliased IP addresses.  As of RH7.3, these files are not fully backwards compatible
with older releases.  Both ifup and the GUI network tool fail.  The GUI tool crashes with a debug window which
complains about the format of the file.

In the old format, multiple IP addresses could be put into one file, namely, ifcfg-eth0:0.  In the new format, only one
IP address per file is allowed.  Instead of being able to automate this process, it must now be set up in a much
more tedious manner AND all administration scripts from before have to be rewritten.

OLD VERSION OF /etc/sysconfig/network-scripts/ifcfg-eth0:0
(IP Addresses have been changed from their original)
=====START=====
IPADDR="200.100.0.1\
 200.100.0.2"
NETMASK="255.255.255.0"
# 200.100.0.1 is www.domain1.com
# 200.100.0.2 is www.domain2.com
=====END=====

Migrating to RH7.3 causes the system to abort network configuration of these aliases.  Manually running ifup
results in the following error: 
/etc/sysconfig/network-scripts/ifup-aliases: 200.100.0.2: command not found
/etc/sysconfig/network-scripts/ifup-aliases: ipseen_200.100.0.1: command not found

Using the GUI network configuration tool results in a debug crash window with the following:
Traceback (innermost last):
... (miscellaneous stuff skipped)
  File "/usr/sbin/../share/redhat-config-network/netconfpkg/Conf.py", line 316, in initvars
    raise IndexError, 'end quote not found in '+self.filename+":"+var[0]
Conf.IndexError: end quote not found in /etc/sysconfig/networking/devices/ifconfig-eth0:0:IPADDR

Changing the file so that all the IP addresses are on the same line (which also used to work), that is
IPADDR="200.100.0.1 200.100.0.2"
still does not work.  ifup still gives the same error, although the GUI network tool will now run.  However, the
aliases do not configure properly, unless all IP addresses are removed except one.

The "new" network configuration system may be a fine way to setup a machine for a home user, but it is simply
non-functional for a large scale operation like an ISP that can assign dozens or hundreds of aliased addresses
to a particular machine and those addresses switch around between machines as clients come and go.  An
automated tool is needed in this circumstance, but now the tools no longer work because of the changes in RH7.3.
Comment 1 Harald Hoyer 2002-07-08 11:57:53 EDT
huh? two ip adresses for one network device?? never saw this... I think, this is
not valid.
Comment 2 Harald Hoyer 2002-07-08 11:59:08 EDT
Should be:
ifcfg-eth0:0
=====START=====
IPADDR="200.100.0.1"
NETMASK="255.255.255.0"
=====END=======
ifcfg-eth0:1
=====START=====
IPADDR="200.100.0.2"
NETMASK="255.255.255.0"
=====END=======
Comment 3 Trond Eivind Glomsrxd 2002-07-08 12:02:31 EDT
This would be a shared redhat-config-network/initscripts issue if the given file
was correct... Bill, was this a supported way of doing aliases?
Comment 4 Bill Nottingham 2002-07-08 12:36:40 EDT
I think that's part of the old linuxconf support; it certainly didn't work
otherwise. You can set up range files, though, for supporting a range of
addresses. See ifup-aliases for examples.
Comment 5 Need Real Name 2002-07-08 14:39:55 EDT
Further investigation:

When putting multiple IP addresses into the IPADDR line of ifcfg-eth0:0 the ifup command would create eth0:0, eth0:1, eth0:2, automatically.  This 
could be done all on one line (IPADDR="1.2.3.4 2.3.4.5") or on multiple lines using line continuation ( \ ).

It appears that support for this style was via linuxconf in ifup-aliases.  This support existed in RH7.2 and prior.  It also appears that there is 
currently no support for arbitrary aliased IP addresses in a single alias file (ifcfg-eth0:0) anymore - only complete ranges.  This makes supporting 
this type of aliasing much more complex via scripts.  Instead of reading one file and updating the IPADDR line then calling ifdown and ifup, now the 
script has to be rewritten to call ifdown, scan the directory, read in all files that match the criteria (ifcfg-eth0:*), store all this info into an internal 
database, delete all those files (ifcfg-eth0:*) and regenerate them, then call ifup (with increased time while the interface is in a down state).

Basically, in RH7.2 and earlier the "linuxconf" format was supported, but in RH7,3 it was removed, thus breaking existing configurations.

Deleted code from ifup-aliases
=====START=====
...
# Is there any linuxconf-style alias files
linuxconfstyle=0
for FILE in ifcfg-${parent-device}:* ; do

    ini_env;
    . $FILE;
    if [ -z "$DEVICE" ]; then
        # it's a linuxconf file.
        # I don't think this script will handle both style correctly
        # though. Well, those who knows about the other style don't know
        # the other style and vice versa
        linuxconfstyle=1
    else
        new_interface;
    fi

done
if [ "$linuxconfstyle" = "1" ] ; then
    linuxconf --hint ipaliases $device \
        | while read command ali ip mask bcast
    do
        if [ "$command" = "del" ] ; then
            /sbin/ifconfig $ali down
            do_netreport=yes
        elif [ "$command" = "add" ] ; then
            /sbin/ifconfig $ali $ip netmask $mask broadcast $bcast
            do_netreport=yes
        else
            echo Incomatible hinting: #command $rest >&2
        fi
    done
fi
=====END=====

Comment 6 Harald Hoyer 2002-07-09 10:51:04 EDT
then this should be fixed in initscripts... redhat-config-network does not
support this style of config file :(
Comment 7 Bill Nottingham 2002-08-20 23:44:20 EDT
Unfortuantely, only linuxconf can really handle all the complexities of what
linuxconf supported for the initscripts (as noted in this bug). As linuxconf is
not being readded to the distro, this probably won't be fixed.

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