ifconfig with non-standard netmask doesn't get applied

Robert Gordon gordon at sedsystems.ca
Fri Dec 9 17:21:29 UTC 2005


I am trying to setup networking with a non-standard netmask to configure 
a subnet with 512 addresses.

ifconfig eth0 137.158.27.158 netmask 255.255.254.0

But after the command runs, checking the config shows:

# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:09:F7:FF:FF:E9
           inet addr:137.158.27.158  Bcast:137.158.255.255 Mask:255.255.0.0
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:100
           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
           Interrupt:39

The netmask does not match the value from command.
Once the OS finishes booting, if I perform:

#ifconfig eth0 netmask 255.255.254.0
#ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:09:F7:FF:FF:E9
           inet addr:137.158.27.158  Bcast:137.158.255.255 
Mask:255.255.254.0
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:100
           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
           Interrupt:39

Now the correct netmask is set. This is running on a cirrus-linux kernel 
(2.4.21) with busybox 1.00  The ifconfig command is run from the startup 
/etc/rc.sysinit script.

The only bug I can find that may be related is 251 but that relates to 
the broadcast address not being recalculated (which is also wrong here).

Any suggestions on what may be causing this, or should I be looking 
deeper in the cirrus-linux network stack?

Rob





More information about the busybox mailing list