Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 2435 - ethX alias contains incorrect netmask and broadcast address
Summary: ethX alias contains incorrect netmask and broadcast address
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Infrastructure
Classification: Unclassified
Component: Bugzilla (show other bugs)
Hardware: x86 Linux
: Low enhancement (vote)
Assignee: Maik Schreiber
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-04 08:31 UTC by Wim De Smet
Modified: 2011-10-30 23:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wim De Smet 2002-05-04 08:31:55 UTC
If the network paremeters as specified in the /etc/conf.d/net file 
do not contain default class A,B or C netmasks / broadcast adresses

ex. network : 10.10.10.10/29
resulting in 

iface_eth0="10.10.10.11 broadcast 10.10.10.17 netmask 255.255.255.248"

when aliases are added to the /etc/conf.d/net file the broadcast adress for the 
aliasses is set to 10.255.255.255 and the netmask is set to 255.0.0.0

ex. alias_eth0="10.10.10.12 10.10.10.13"

In order to resolve this beheaviour I added the following parameters 
to /etc/conf.d/net (quick workaround)

netmask_eth0="255.255.255.248"

broadcast_eth0="10.10.10.17"


and I altered the net.eth0 script : 


-------------------------------------------------------------
        if [ -n  "`eval echo \$\{netmask_${IFACE}\}`" ]
        then
               NM=`eval echo \$\{netmask_${IFACE}\}`
               ADD_netmask=" netmask  ${NM}"
        else
               ADD_netmask=""
        fi

        if [ -n  "`eval echo \$\{broadcast_${IFACE}\}`" ]
        then
               BC=`eval echo \$\{broadcast_${IFACE}\}`
               ADD_broadcast=" broadcast $BC"
        else
               ADD_broadcast=""
        fi

        if [ -n "`eval echo \$\{alias_${IFACE}\}`" ]
        then
                local x=""
                local num=0
                for x in `eval echo \$\{alias_${IFACE}\}`
                do
                        /sbin/ifconfig ${IFACE}:${num} $x $ADD_broadcast 
$ADD_netmask
                        num=$((num + 1))
                done
        fi
------------------------------------------------------------------------
instead of 
------------------------------------------------------------------------
        if [ -n "`eval echo \$\{alias_${IFACE}\}`" ]
        then
                local x=""
                local num=0
                for x in `eval echo \$\{alias_${IFACE}\}`
                do
                        /sbin/ifconfig ${IFACE}:${num} $x
                         num=$((num + 1))
                done
        fi
------------------------------------------------------------------------
Comment 1 John Davis (zhen) (RETIRED) gentoo-dev 2002-12-15 22:15:47 UTC
changing owner
Comment 2 John Davis (zhen) (RETIRED) gentoo-dev 2002-12-15 22:16:19 UTC
back to blizzy