dhclient3 doesn't obtain an IP address

Bug #20857 reported by Emmanuel Rodriguez
4
Affects Status Importance Assigned to Milestone
dhcp3 (Ubuntu)
Invalid
Medium
Scott James Remnant (Canonical)

Bug Description

dhclient3 doesn't obtain an IP address

Sometimes, when the computer boots dhclient3 is not able to get an IP address.
This happens quite often more or less at every second reboot.
The strange thing is that dhclient3 is running, but the network interface is not
properly configured.
I have to manually restart dhclient3 in order to have the network operational.

I don't have a network card instead I am using the network interface that is
built-in in my computer's motherboard, a MSI K8N Neo4 Platinum.
Actullay my motherboard has two network interfaces but I'm only using one.

Here are the results of various commands when the network isn't properly configured:

emmanuel@uber ~> ps eaxf
 5060 ? Ss 0:00 /bin/sh /etc/hotplug/net.ifup eth0=hotplug
 5554 ? S 0:00 \_ ifup eth0=hotplug
 5559 ? S 0:00 \_ dhclient3 -pf /var/run/dhclient.eth0.pid -lf
/var/run/dhclient.eth0.leases eth0

emmanuel@uber ~> ifconfig
eth0 Link encap:Ethernet HWaddr 00:11:09:D3:91:AD
          inet6 addr: fe80::211:9ff:fed3:91ad/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:720 (720.0 b) TX bytes:378 (378.0 b)
          Interrupt:23

lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:380 errors:0 dropped:0 overruns:0 frame:0
          TX packets:380 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:32691 (31.9 KiB) TX bytes:32691 (31.9 KiB)

If I restart dhclient3 manually then everything will work.

emmanuel@uber ~> sudo dhclient3
Internet Systems Consortium DHCP Client V3.0.2
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP

sit0: unknown hardware address type 776
sit0: unknown hardware address type 776
Listening on LPF/sit0/
Sending on LPF/sit0/
Listening on LPF/eth0/00:11:09:d3:91:ad
Sending on LPF/eth0/00:11:09:d3:91:ad
Listening on LPF/lo/
Sending on LPF/lo/
Sending on Socket/fallback
DHCPDISCOVER on sit0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on lo to 255.255.255.255 port 67 interval 7
DHCPOFFER from 192.168.1.1
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1
bound to 192.168.1.200 -- renewal in 38541 seconds.

Once more, here are the results for the same commands:

emmanuel@uber ~> ifconfig
eth0 Link encap:Ethernet HWaddr 00:11:09:D3:91:AD
          inet addr:192.168.1.200 Bcast:192.168.1.255 Mask:255.255.255.0
          inet6 addr: fe80::211:9ff:fed3:91ad/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1900 (1.8 KiB) TX bytes:1062 (1.0 KiB)
          Interrupt:23

lo Link encap:Local Loopback
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:842 errors:0 dropped:0 overruns:0 frame:0
          TX packets:842 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:75387 (73.6 KiB) TX bytes:75387 (73.6 KiB)

sit0 Link encap:IPv6-in-IPv4
          inet6 addr: ::127.0.0.1/96 Scope:Unknown
          UP RUNNING NOARP MTU:1480 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:2 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

emmanuel@uber ~> ps eaxf
 5060 ? Ss 0:00 /bin/sh /etc/hotplug/net.ifup eth0=hotplug
 5554 ? S 0:00 \_ ifup eth0=hotplug
 5559 ? S 0:00 \_ dhclient3 -pf /var/run/dhclient.eth0.pid -lf
/var/run/dhclient.eth0.leases eth0
 6695 ? Ss 0:00 dhclient3

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

In what way is it "not properly configured" ? From what I can see, it looks
fine and is just waiting for the dhcp server to reply.

Can you attach your /var/log/syslog

Revision history for this message
Guillermo Gutiérrez (capitanterrex) wrote :

(In reply to comment #1)
> In what way is it "not properly configured" ?

Emmanuel must restart dhclient3 so that eth0 receives an IP.

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Right, but the ethernet card is configured ...

eth0 Link encap:Ethernet HWaddr 00:11:09:D3:91:AD
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0

And seems to be both sending and receiving packets on the network ...

Could you attach your /var/log/syslog so we can see the output from dhclient.
My current suspicion is that your dhcp server simply isn't responding.

Revision history for this message
Emmanuel Rodriguez (potyl) wrote :

Created an attachment (id=3555)
/var/log/syslog gziped

Here are the contents of the file /var/log/syslog, the file is 3megs so I
compressed it.

Revision history for this message
Emmanuel Rodriguez (potyl) wrote :

I will provide more information about my environment, hopping that it will help.

The computer that is having the DHCP problems is at home and is running Breezy
64bits.
In that network there are two other computers running Windows XP and a laptop
running Hoary 32bits.
The computers are rebooted regularly and are all using DHCP, none is
experiencing DHCP problems.
At the present moment only one computer is having problems with the DHCP server
and it's the one running Breezy 64bits (AMD).
This very same computer was previously running Hoary 64bits without any problems.

The DHCP server is provided by an Asus router, nothing out of the ordinary.
The exact model is ASUS WL 500g AccessPoint 54Mbps + switch, for more information:
http://uk.asus.com/products.aspx?l1=12&l2=43&l3=0&model=61&modelmenu=1

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Strange, the syslog doesn't contain any output for dhclient during the "failed"
boots ...

You can confirm that after a boot where it doesn't get an IP address that
dhclient3 _IS_ running, yes?

Revision history for this message
Emmanuel Rodriguez (potyl) wrote :

(In reply to comment #6)
> Strange, the syslog doesn't contain any output for dhclient during the "failed"
> boots ...
>
> You can confirm that after a boot where it doesn't get an IP address that
> dhclient3 _IS_ running, yes?
Yes I can confirm that dhclient3 is running, in the description of this bug I
listed the result of a ps after that I manually lunch dhclient3 :

emmanuel@uber ~> ps eaxf
 5060 ? Ss 0:00 /bin/sh /etc/hotplug/net.ifup eth0=hotplug
 5554 ? S 0:00 \_ ifup eth0=hotplug
 5559 ? S 0:00 \_ dhclient3 -pf /var/run/dhclient.eth0.pid -lf
/var/run/dhclient.eth0.leases eth0
 6695 ? Ss 0:00 dhclient3

As you can see it is running twice.

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Btw, you should _never_ run dhclient3 with no arguments! If it fails, do
"dhclient eth0" ... it may be that this has corrupted the dhclient state.

Try that the next time it fails, and see if that cures the problem.

Revision history for this message
Emmanuel Rodriguez (potyl) wrote :

Perfect I will try the commands next time.
I will keep you informed of the status.
So far I have been lucky and I didn't had a single problem with the network.
Perhaps the problem was fixed during the dist-upgrades.

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

This is increasingly looking like the same as #13497 -- both are dhclients not
being run, despite the network card having been plugged correctly.

This bug has been marked as a duplicate of bug 19740.

Revision history for this message
Emmanuel Rodriguez (potyl) wrote :
Download full text (5.1 KiB)

This time it took a while until I experienced some network problems with dhclient3.
I though that the problem got solved during an update, but it seems that it
wasn't since I had once more a problem.

This time I use the command dhclient3 eth0, the network restarted properly as
expected.
I did some more investigations while the network wasn't configured.
Here are the resutls:

emmanuel@uber ~> ifconfig
eth0 Link encap:Ethernet HWaddr 00:11:09:D3:91:AD
          inet6 addr: fe80::211:9ff:fed3:91ad/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:247 (247.0 b) TX bytes:378 (378.0 b)
          Interrupt:23

lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:2211 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2211 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:199255 (194.5 KiB) TX bytes:199255 (194.5 KiB)

Interface eth0 is kind of up but not well configured.
I can't ping my router.

emmanuel@uber ~> ps eaxf
 5068 ? Ss 0:00 /bin/sh /etc/hotplug/net.ifup eth0=hotplug
 5562 ? S 0:00 \_ ifup eth0=hotplug
 5567 ? S 0:00 \_ dhclient3 -pf /var/run/dhclient.eth0.pid -lf
/var/run/dhclient.eth0.leases eth0

dhclient3 is still running as usual but the interface eth0 can't be used.

emmanuel@uber ~> sudo strace -p 5567
Process 5567 attached - interrupt to quit
select(7, [5 6], [], [], {6863, 383000}

This is the single line of output I got from the process, it seems to be waiting
for some input.
I eventually got bored of waiting so I moved on.

emmanuel@uber ~> sudo lsof -c dhclient3
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
dhclient3 5567 dhcp cwd DIR 8,3 4096 1913398 /etc/hotplug
dhclient3 5567 dhcp rtd DIR 8,3 4096 2 /
dhclient3 5567 dhcp txt REG 8,3 499008 392566 /sbin/dhclient3
dhclient3 5567 dhcp mem REG 0,0 0 [heap] (stat: No such
file or directory)
dhclient3 5567 dhcp mem REG 8,3 94448 835682 /lib/ld-2.3.5.so
dhclient3 5567 dhcp mem REG 8,3 15568 834013 /lib/libcap.so.1.10
dhclient3 5567 dhcp mem REG 8,3 1261816 835695 /lib/libc-2.3.5.so
dhclient3 5567 dhcp mem REG 8,3 44056 835703 /lib/libnss_files-2.3.5.so
dhclient3 5567 dhcp mem REG 8,3 36112 835701 /lib/libnss_compat-2.3.5.so
dhclient3 5567 dhcp mem REG 8,3 87072 835700 /lib/libnsl-2.3.5.so
dhclient3 5567 dhcp mem REG 8,3 39936 835705 /lib/libnss_nis-2.3.5.so
dhclient3 5567 dhcp 0u CHR 1,3 2622 /dev/null
dhclient3 5567 dhcp 1u CHR 1,3 2622 /dev/null
dhclient3 5567 dhcp 2u CHR 1,3 2622 /dev/null
dhclient3 5567 dhcp 3w REG 8,3 0 327128 /var/run/dhclient.eth0.leases
dhclient3 5567 dhcp 4w REG 8,3 0 327130 /var/run/d...

Read more...

Revision history for this message
Emmanuel Rodriguez (potyl) wrote :

Created an attachment (id=3715)
Output of the command sudo strace -p 7077 -ostatus-new-dhclient3

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.