Hide Forgot
Description of problem: Version-Release number of selected component (if applicable): initscripts-9.03.23-1.el6.x86_64 How reproducible: every time Steps to Reproduce: 1. Define a network device with the following definitions in ifcfg-eth0 PREFIX=29 IPADDR=x.61.58.51 GATEWAY=x.61.58.49 2. Up the device 3. Inspect broadcast address Actual results: Broadcast x.61.58.255 Expected results: Broadcast x.61.58.55 Additional info: Initscripts documentation states that BROADCAST parameter is deprecated. Using this parameter BROADCAST=x.61.58.55 solves the problem.
*** This bug has been marked as a duplicate of bug 705367 ***
I disagree. This is not a duplicate. The netmask is set correctly in my scenario. I use the following ifcfg-eth0: DEVICE=eth0 HWADDR=00:26:55:e7:20:ad ONBOOT=yes BOOTPROTO=none TYPE=Ethernet IPADDR=172.16.128.22 PREFIX=24 GATEWAY=172.16.128.30 USERCTL=no IPV6INIT=no This results in the following nic configuration: # ip a s dev eth0 2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000 link/ether 00:26:55:e7:20:ad brd ff:ff:ff:ff:ff:ff inet 172.16.128.22/24 brd 172.16.255.255 scope global eth0 Please note, that the prefix/netmask is set correctly, but the broadcast is calculated for a class b. The command ifconfig states the same: eth0 Link encap:Ethernet Hardware Adresse 00:26:55:E7:20:AD inet Adresse:172.16.128.22 Bcast:172.16.255.255 Maske:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 The netmask is set correctly to 255.255.255.0 according to the prefix 24. Only the broadcast is set wrong. Setting BROADCAST=172.16.128.255 corrects the broadcast address. The documenation states that this parameter is deprecated.
It's fixed by the same patch, hence why it was marked as a duplicate. The reason you get the right netmask is because the address is actually added with the prefix instead of the netmask; the internal calculation for the netmask that the scripts use is still wrong. *** This bug has been marked as a duplicate of bug 705367 ***