Red Hat Bugzilla – Bug 169526
lost Gateway when I change static IP by DHCP
Last modified: 2007-11-30 17:11:14 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.7.10) Gecko/20050717 Firefox/1.0.6
Description of problem:
I configure the network with system-config-network 1.3.26.
When I change the configuration address IP I have a problem with the gateway.
1) I try DHCP on vlan1 it is OK. I have a good address IP,I can ping Vlan1 and the others vlan and I can go out on internet. I make "netstat -r" I see the gateway
2) Now I try static IP on vlan2 it is OK. I can ping Vlan2 and the others vlan and I can go out on internet. I make "netstat -r" I see the gateway.
3) I come back on vlan1 with DHCP, it is not good.I have a good address IP and I can ping Vlan1 but I cannot ping the others vlan and I can't go out on internet. I make "netstat -r" I don't see the gateway.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
You can look the description above
I show you the file cfcfg.eth0 when I configure with DHCP (step 3 in description above).
BOOTPROTO=dhcp (I configure with DHCP in vlan1)
NETMASK=255.255.255.0 (it is the netmask in vlan2)
IPADDR=220.127.116.11 (it is the static IP address in vlan2)
GATEWAY= 18.104.22.168 (it is the IP address in vlan2)
The same happened to me.
The problem seems to be in the switch from static IP to dhcp.
System-config-network leaves the GATEWAY, IPADDR and NETMASK parameter untouched
in the updated file /etc/sysconfig/network-scripts/ifcfg-xxx. This in effect
distrurbs the function of /sbin/dhclient-script, which explicitely wants to set
the gateway from ifcfg-xxx. However, when the dhcp address is on a different
subnet, then no default gateway will be set by dhclient-script because the
gateway is unreachable and no communication out if the subnet is possible.
There seems to be an easy route to a fix. A switch from static to dhcp should
lose its memory of the previously set static gateway, netmask and IP altogether.
This should be a trivial workaround until a better way can be found.
Same here. It seems there are a lot of other bug reports here which also
addressed this issue some times ago (#167593, #162902, #169113, #149780),
discussing if this is an dhclient or system-config-network problem. Anyway this
is still not fixed. But right now it's very uncomfortable for e.g. laptop users
who often have to switch between static IP and DHCP.
*** This bug has been marked as a duplicate of 149780 ***