With a netmask of 255.255.255.0 the correct broadcast ip address is x.x.x.255, but gentoo is choosing x.255.255.255. For example: config_eth0=( "10.1.206.16 netmask 255.255.255.0" ) /sbin/ifcong shows a broadcast of 10.255.255.255. It should be 10.1.206.255 Reproducible: Always Steps to Reproduce: 1. Set a netmask of 255.255.255.0 in /etc/conf.d/net 2. Run /sbin/ifconfig and observe broadcast address 3. Actual Results: Incorrect broadcast chosen by default Expected Results: Chosen correct broadcast address for netmask Workaround: Specify a broadcast address: config_eth0=( "10.1.206.16 netmask 255.255.255.0 broadcast 10.1.206.255" )
broadcast options are specified in conf.d/net.example - or are you suggesting the handbook should be updated?
I expected the *default* broadcast for an ipaddress with a class C netmask: netmask 255.255.255.0 to be the class C portion with .255 appended: 10.1.206.16 netmask 255.255.255.0 should this not yield a default broadcast of 10.1.206.255 ?? It seems to me that this is the most correct *default* broadcast address for this address / netmask pair. Maybe I am wrong?? I've had "networking gurus" insist to me that that the *most correct* default broadcast address is always ipaddress | (~netmask) BUT look at this: /sbin/ifconfig eth0:0 209.209.209.18 netmask 255.0.0.0 /sbin/ifconfig eth0:0 209.209.209.18 netmask 255.255.0.0 /sbin/ifconfig eth0:0 209.209.209.18 netmask 255.255.255.0 ALL give the following for Bcast: /sbin/ifconfig eth0:0 => inet addr:209.209.209.18 Bcast:209.209.209.255 Mask:255.255.255.0 And these: /sbin/ifconfig eth0:0 10.0.0.18 netmask 255.0.0.0 /sbin/ifconfig eth0:0 10.0.0.18 netmask 255.255.0.0 /sbin/ifconfig eth0:0 10.0.0.18 netmask 255.255.255.0 ALL give the following for Bcast: => inet addr:10.0.0.18 Bcast:10.255.255.255 Mask:255.255.0.0 Is this something special in place for all 10.x.x.x addresses??
Oh I understand now The default broadcast as set by ifconfig does not take into account netmask. However, when using iproute2, it does take into account the netmask (actually the CIDR, but they are the same) So the solution is to emerge iproute2 - and if you're using baselayout-1.11 then specify modules=( "iproute2" ) in /etc/conf.d/net (baselayout-1.12 prefers iproute2)