From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
Description of problem:
when the ip address of the machine is changed from dhcp to a static ip or
vice versa, after doing `/etc/rc.d/init.d/network restart', the program
`ifconfig' does not reflect the new ip address on its output. The earlier
ip address is displayed.
Only after a reboot, ifconfig displays the new ip address.
Version-Release number of selected component (if applicable): net-tools-
Steps to Reproduce:
1. Login as `root' user.
2. Run `setup' on command line and go to the networking option.
3. Change your ipaddress to a different one from the earlier one.
4. Restart the network by `/etc/rc.d/init.d/network restart'.
5. Run `ifconfig'.
Actual Results: It is observed that the new ip address is not reflected
Expected Results: ifconfig should have shown the new ipaddress
Additional info: -
That problem come from /sbin/ifdown.
Since RH7.2, /sbin/ifup and /sbin/ifdown use /sbin/ip to create and delete
IP addresses. You change your address in step 3. and then restart network.
So, /sbin/ifdown attempt to remove NEW address instead of OLD address.
This causes error.
RTNETLINK answers: Cannot assign requested address
The OLD address not removed, and when /sbin/ifup create new address,
That interface have two address, OLD and NEW one.
1. /etc/init.d/network stop ; CHANGE configuration ; /etc/init.d/network start
2. /etc/init.d/network stop ; /sbin/ip addr flush eth0 ; /etc/init.d/network start
Anyway, it's a serious bug. Must be fixed soon.
The workaround works perfectly. It seems the problems arises only when the ip
address is changed from dhcp to static or from static to static.
The other way (i.e. static to dhcp) runs fine without any errors.
This is fixed in a later initscritps package (6.40.2-1, for example.)