I recently reconfigured some CentOS 4.3 systems that were using DHCP to use static IP addresses. At the same time, the systems were moved to a new VLAN. Here is the approximate sequence of events that took place: 1. ifdown eth0 2. edit /etc/sysconfig/network-scripts/ifcfg-eth0 with static IP address 3. wait for network folks to reconfigure switch 4. ifup eth0 I may have reversed steps 1 and 2 on some of the systems. The problem was that the dhclient process didn't go away, and kept renewing the old lease. Our DHCP server is configured to contact the DNS server and update the entry for each host it serves. So the DNS entries for these systems were pointing to the old address in the old VLAN. The eth0 interface itself just kept the static IP address for which it was configured. It took me a while to figure out what was going on. My question is, what could I have done to avoid this (other than killing the dhclient process)? Is there a better way to reconfigure an interface to use a static address? I am not interested in solutions that involve using a GUI (i.e., only command line solutions). Thanks, Alfred
On Wed, 2006-09-13 at 14:06 -0400, Alfred von Campe wrote:> I recently reconfigured some CentOS 4.3 systems that were using DHCP > to use static IP addresses. At the same time, the systems were moved > to a new VLAN. Here is the approximate sequence of events that took > place: > > 1. ifdown eth0 > 2. edit /etc/sysconfig/network-scripts/ifcfg-eth0 with static IP > address > 3. wait for network folks to reconfigure switch > 4. ifup eth0 > > I may have reversed steps 1 and 2 on some of the systems. > > The problem was that the dhclient process didn't go away, and kept > renewing the old lease. Our DHCP server is configured to contact the > DNS server and update the entry for each host it serves. So the DNS > entries for these systems were pointing to the old address in the old > VLAN. The eth0 interface itself just kept the static IP address for > which it was configured. It took me a while to figure out what was > going on. > > My question is, what could I have done to avoid this (other than > killing the dhclient process)? Is there a better way to reconfigure > an interface to use a static address? I am not interested in > solutions that involve using a GUI (i.e., only command line solutions). > > Thanks, > Alfred > _______________________________________________I do: service network restart (or: /etc/init.d/network restart) Not necessarily better, but it should make the dhcp process go away (if the ifcfg file is correctly edited). Thanks, Johnny Hughes -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://lists.centos.org/pipermail/centos/attachments/20060913/953e6576/attachment-0002.sig>
> My question is, what could I have done to avoid this (other than >killing the dhclient process)? Is there a better way to reconfigure >an interface to use a static address? I am not interested in >solutions that involve using a GUI (i.e., only command line solutions).Unless this device is going to be switching from DCHP to static frequently, wouldn't simply killing the dhclient process be sufficient? If not, you could always simply write a shell function for ifconfig (if you're using bash, ksh or sh) that checks for an associated dhclient process when and interface is "down"'d and kills the associated dhclient process. Hope this helps, Justin. -----Original Message----- From: Alfred von Campe [mailto:alfred at 110.net] Sent: Wednesday, September 13, 2006 2:06 PM To: CentOS mailing list Subject: [CentOS] Lingering dhclient issue I recently reconfigured some CentOS 4.3 systems that were using DHCP to use static IP addresses. At the same time, the systems were moved to a new VLAN. Here is the approximate sequence of events that took place: 1. ifdown eth0 2. edit /etc/sysconfig/network-scripts/ifcfg-eth0 with static IP address 3. wait for network folks to reconfigure switch 4. ifup eth0 I may have reversed steps 1 and 2 on some of the systems. The problem was that the dhclient process didn't go away, and kept renewing the old lease. Our DHCP server is configured to contact the DNS server and update the entry for each host it serves. So the DNS entries for these systems were pointing to the old address in the old VLAN. The eth0 interface itself just kept the static IP address for which it was configured. It took me a while to figure out what was going on. My question is, what could I have done to avoid this (other than killing the dhclient process)? Is there a better way to reconfigure an interface to use a static address? I am not interested in solutions that involve using a GUI (i.e., only command line solutions). Thanks, Alfred _______________________________________________ CentOS mailing list CentOS at centos.org http://lists.centos.org/mailman/listinfo/centos
On Sep 13, 2006, at 17:07, Johnny Hughes wrote:> I do: > > service network restartI'll remember this for next time. If I get a chance, I will also test this to see if the dhclient process indeed goes away. On Sep 13, 2006, at 18:29, Justin Randall wrote:> Unless this device is going to be switching from DCHP to static > frequently, wouldn't simply killing the dhclient process be > sufficient?Yes, it would. My question was what is the recommended process to switch an interface from DHCP to STATIC so that the dhclient process automatically gets killed. Doing an "ifdown eth0", editing the configuration file, and then doing an "ifup eth0" left this lingering dhclient process around. Alfred
>Yes, it would. My question was what is the recommended process to >switch an interface from DHCP to STATIC so that the dhclient process >automatically gets killed. Doing an "ifdown eth0", editing the >configuration file, and then doing an "ifup eth0" left this lingering >dhclient process around.If you're looking for a one command solution after making the required configuration changes, using the "service network restart" is likely your best bet. If you don't want to restart the entire network (which can cause service interuption depending on what is being serviced over the network), simply carrying out the steps you originally outlined while killing the dhclient process acting on the interface is probably the best approach since there is no association between ifconfig and dhclient. Regards, Justin. -----Original Message----- From: Alfred von Campe [mailto:alfred at 110.net] Sent: Wed 9/13/2006 7:27 PM To: CentOS mailing list Cc: Subject: Re: [CentOS] Lingering dhclient issue On Sep 13, 2006, at 17:07, Johnny Hughes wrote:> I do: > > service network restartI'll remember this for next time. If I get a chance, I will also test this to see if the dhclient process indeed goes away. On Sep 13, 2006, at 18:29, Justin Randall wrote:> Unless this device is going to be switching from DCHP to static > frequently, wouldn't simply killing the dhclient process be > sufficient?Yes, it would. My question was what is the recommended process to switch an interface from DHCP to STATIC so that the dhclient process automatically gets killed. Doing an "ifdown eth0", editing the configuration file, and then doing an "ifup eth0" left this lingering dhclient process around. Alfred _______________________________________________ CentOS mailing list CentOS at centos.org http://lists.centos.org/mailman/listinfo/centos -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3174 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20060913/dd71be25/attachment-0002.bin>