[rhelv6-list] dhclient running TWICE during boot (RHEL 6.2)

thomas at redhat.com thomas at redhat.com
Mon Apr 30 05:43:10 UTC 2012


On 04/29/2012 03:03 PM, Paul Smith wrote:
> Hi all; I have a number of up-to-date RHEL 6.2 systems and on all of
> them I'm seeing a strange issue.  I have configured my network interface
> (using NetworkManager GUI tool) to use DHCP to obtain an IP address.
> I've also added DHCP_HOSTNAME=myhost to the ifcfg-Auto_eth0 file so that
> the DNS values are updated for that hostname properly.
>
> My DHCP system is configured to handle this properly and indeed it works
> fine.
>
> Here's the problem: during the boot of the system, dhclient is invoked
> TWICE for the same network interface.  Each of these requests obtains
> its own lease, but for some reason they both get DIFFERENT IP addresses.
> This happens on all the systems that I've checked (I can see they all
> have two lease files in /var/lib/dhclient and these lease files have
> different IP addresses).
>
> For some systems it all works out in the end and the interface and the
> DNS server end up using the same IP address.  For other systems, the
> network interface ends up using the other IP address, not the one that
> the DNS server is using!  Maybe it's a timing thing?
>
> I've tricked out one of my systems by renaming the dhclient binary and
> replacing it with a shell script that generates debugging information
> and then invokes the real dhclient.
>
> I can see that the first invocation of dhclient is performed by rc via
> S10network.  This one uses the default configuration of dhclient which
> runs the dhclient-script and creates a lease file
> /var/lib/dhclient/dhclient-eth0.leases.
>
> The second invocation is performed by Networkmanager.  This one uses a
> special-crafted configuration of dhclient which runs the
> nm-dhcp-client.action command and creates a lease file
> /var/lib/dhclient/dhclient-$UUID-eth0.leases, where $UUID is the value
> of the UUID variable set in the
> /etc/sysconfig/network-scripts/ifcfg-Auto_eth0 file.
>
>
> I don't understand why this is happening: if NetworkManager is going to
> manage the interfaces, why does the network script also do it?  I don't
> know why I get two different IP addresses for the same interface, with
> the same MAC, either but if I could solve the first problem so that only
> one dhclient was run, presumably everything would work.  I'd prefer to
> keep the NetworkManager configuration because that's how the users want
> to manage their network interface (via the graphical tool).
>
> Can anyone explain how this is supposed to work and where I've gone
> wrong?  Do other people see duplicated lease files for the same
> interface when using DHCP?

What does /etc/sysconfig/network-scripts/ifcfg-eth0 look like? I 
generally set ONBOOT=no if I'm going to let NM manage the interface. 
What happens if you set ONBOOT=no and NM_CONTROLLED=yes? Do you still 
see the two dhclient processes?
-- 
Thomas Cameron, RHCA, RHCSS, RHCDS, RHCVA, RHCX, CNE, MCSE, MCT
Chief Architect, Central US & Canada
512-241-0774 office 512-585-5631 cell 512-857-1345 fax
http://people.redhat.com/tcameron

For the 5th year running, JBoss leads in customer satisfaction:
http://www.jboss.com/pdf/customer_satisfaction.pdf




More information about the rhelv6-list mailing list