Bug 3338 - linuxconf --hint ipalias does weird stuff
linuxconf --hint ipalias does weird stuff
Status: CLOSED DUPLICATE of bug 3588
Product: Red Hat Linux
Classification: Retired
Component: linuxconf (Show other bugs)
6.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-06-08 12:22 EDT by dharris
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-06-21 16:33:05 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 dharris 1999-06-08 12:22:07 EDT
I started poking around in the /etc/sysconfig/network-
scripts stuff trying to debug some problems I was seeing in
aliased network interfaces. Doing this I bumped into some
weirdness/inconsistencies in the system setup which I
believe relate to linuxconf.

(1) Aliased devices get different ipaddr, device-name
parings than specified in the /etc/sysconfig/network-
scripts files.

I have the following setup:

[root@hobbes network-scripts]# cat ifcfg-eth0
DEVICE=eth0
IPADDR=192.168.10.1
NETMASK=255.255.0.0
NETWORK=192.168.0.0
BROADCAST=192.168.255.255
ONBOOT=yes
[root@hobbes network-scripts]# cat ifcfg-eth0:0
DEVICE=eth0:0
IPADDR=192.168.10.2
[root@hobbes network-scripts]# grep IPADDR ifcfg-eth0:*
ifcfg-eth0:0:IPADDR=192.168.10.2
ifcfg-eth0:1:IPADDR=192.168.10.3
ifcfg-eth0:2:IPADDR=192.168.10.4
ifcfg-eth0:3:IPADDR=192.168.10.5
ifcfg-eth0:4:IPADDR=192.168.10.6
ifcfg-eth0:5:IPADDR=192.168.10.7
ifcfg-eth0:6:IPADDR=192.168.10.8
ifcfg-eth0:7:IPADDR=192.168.10.9
ifcfg-eth0:8:IPADDR=192.168.10.10
ifcfg-eth0:9:IPADDR=192.168.10.11
ifcfg-eth0:10:IPADDR=192.168.10.12
ifcfg-eth0:11:IPADDR=192.168.10.13
[root@hobbes network-scripts]#

But when the alias devices are enabled they are given
_different_ ipaddr, device-name parings than I specified.
If you read ifup-aliases, you see that this comes from
linuxconf, which is returning messed up data:

[root@hobbes network-scripts]# linuxconf --hint ipalias eth0
add eth0:0 192.168.10.2 255.255.255.255 192.168.10.2
add eth0:1 192.168.10.3 255.255.255.255 192.168.10.3
add eth0:2 192.168.10.12 255.255.255.255 192.168.10.12
add eth0:3 192.168.10.13 255.255.255.255 192.168.10.13
add eth0:4 192.168.10.4 255.255.255.255 192.168.10.4
add eth0:5 192.168.10.5 255.255.255.255 192.168.10.5
add eth0:6 192.168.10.6 255.255.255.255 192.168.10.6
add eth0:7 192.168.10.7 255.255.255.255 192.168.10.7
add eth0:8 192.168.10.8 255.255.255.255 192.168.10.8
add eth0:9 192.168.10.9 255.255.255.255 192.168.10.9
add eth0:10 192.168.10.10 255.255.255.255 192.168.10.10
add eth0:11 192.168.10.11 255.255.255.255 192.168.10.11
[root@hobbes network-scripts]#

Not having these paring the way I specified messes things
up when I need to disable a specific network interface.

For example, let's say that I need to disable 192.168.10.12
which I specified to be eth0:10. Naturally, I would type
"ifdown eth0:10". But that actually takes down
192.168.10.10, not .12. Evidence:

[root@hobbes network-scripts]# ifdown eth0:10
[root@hobbes network-scripts]# ifconfig | grep -B 1
192.168.10.12
eth0:2    Link encap:Ethernet  HWaddr 00:40:05:16:91:49
          inet addr:192.168.10.12  Bcast:192.168.10.12
Mask:255.255.255.255
[root@hobbes network-scripts]# ifconfig | grep -B 1
192.168.10.10
[root@hobbes network-scripts]#

(2) Inconstancy between linuxconf settings and ifconfig-
eth0:* settings

There are now two ways to enable an aliased network
interface which will yield different configuration: using
ifup-aliases (whichgrabs config from linuxconf), and using
ifup (which grabs config from ifconfig-eth0:* files)

Here is an example:

[root@hobbes network-scripts]# ifup eth0:0
[root@hobbes network-scripts]# ifconfig eth0:0
eth0:0    Link encap:Ethernet  HWaddr 00:40:05:16:91:49
          inet addr:192.168.10.2  Bcast:192.168.10.255
Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:11 Base address:0x300

[root@hobbes network-scripts]# ifdown eth0:0
[root@hobbes network-scripts]# ./ifup-aliases eth0
[root@hobbes network-scripts]# ifconfig eth0:0
eth0:0    Link encap:Ethernet  HWaddr 00:40:05:16:91:49
          inet addr:192.168.10.2  Bcast:192.168.10.2
Mask:255.255.255.255
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:11 Base address:0x300

[root@hobbes network-scripts]#

Note the different netmasks and broadcast addrs.

As per point one, it is possible that we could have gotten
different ipaddrs in this test... but I chose an aliased
interface that I knew would have the same ipaddr in both
setup methods.

This one REALLY threw me for a loop back in Red Hat 5.1
when I was having weird problems with my alised interfaces
and I thought it was the netmask.

Conclusion:

Linuxconf needs to be fixed to respect the ifconfig-eth0:*
settings better, or ifup-aliases should not get its
information from linuxconf.

Note: I modified ifup-alises to think that linuxconf was
not there and use an old method of just calling ifup for
each aliased interface... problem was it went from using
0.22 seconds elapsed time with linuxconf gathering
configuration to 6.23 seconds elapsed with only 12 aliased
interfaces. That will be a problem when I try to give it a
few hundred aliased interfaces.

Sorry for the length of this, but I thought it would be
best to be very specific and give examples.
Comment 1 Bill Nottingham 1999-06-17 18:48:59 EDT
There is a potential fix in initscripts-4.22;
linuxconf support is removed, and the main part
of ifup-aliases is simply the following:

current=0
while : ; do
 if [ ! -f /etc/sysconfig/network-scripts/$device:$current ]; then
    return
 fi
 /etc/sysconfig/network-scripts/ifup $device:$current
 current=`expr $current + 1`
done

However, I don't know how this will affect the speed issue.
Comment 2 Bill Nottingham 1999-06-21 16:33:59 EDT
*** This bug has been marked as a duplicate of 3588 ***

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