dhcp fails with NM, but succeeds using ifup

Bug #374006 reported by Ype
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: network-manager

The bug occurred after upgrading to jaunty.
I'm not sure about the network-manager, it could also be the kernel, a driver for my network card,
or perhaps the cause in the reorderings done to increase the booting speed in jaunty.
Also I expect this to be duplicate bug, but I couldn't determine an existing one that was really close enough.

I reported this earlier at this existing report, but then found that ubuntu-bug is preferred, so
I'm repeating this here:

can't connect via dhcp
https://bugs.launchpad.net/bugs/312157

After boot using the default kernel there is no wired connection to the internet, but everything on the local network is available. (ping by name to local machines works, but pop for email fails.)
If I did not have another machine on the local network, I would have had no way to know how to fix this, as this isolates the upgraded machine from the internet.

I can always correct this by doing:

sudo ifdown eth0
sudo ifup eth0

Since this is repeatable, I'd like to hunt it down to the source of the
problem, but I have no idea how to proceed.

The network icon in the system tray does not show an active network
(neither wired nor wireless) before and after the ifdown/ifup fix.

Any suggestions as to what I could do to fix this?

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
Gconf:

Package: network-manager 0.7.1~rc4.1.cf199a964-0ubuntu2
ProcEnviron:
 PATH=(custom, user)
 LANG=nl_NL.UTF-8
 SHELL=/bin/bash
SourcePackage: network-manager
Uname: Linux 2.6.28-11-generic i686
WpaSupplicantLog:

Revision history for this message
Ype (ykingma) wrote :
Revision history for this message
lechup (lechup-o2) wrote :

Hi!

I have simillar problem. I think is a kernel / network driver issue.

My setup is, laptop HP nc6400 + Ubuntu 9.04 upgraded from 8.04 where everything was OK.

Network card: Broadcom Corporation NetXtreme BCM5753M Gigabit Ethernet PCI Express (rev 21) as eth0.

I do not receive ANY PACKETS and problably no packets gets to router (i've checked logs for DHCPREQUEST on the router). I assume that by output of `ifconfig eth0`, where received is 0 and sent is changing +2KB for each `sudo dhcpclient eth0`. I just cant say what's going to my DHCPREQUESTS packets, something is

I can't even set static inet IP, i've tried:
- by NetworkManager
- editing /etc/network/interfaces
- editing dhcpclient dhcp.conf file and setting alias for my eth0

The thing is odd because hopefully my WirelessCard send/receive DHCP OFFERS and REQUESTS :)

Any other computer in the network do not have problems with getting IP from the router (Windows XP machines).

PS: I've tried this method http://www.prash-babu.com/2009/05/how-to-fix-ip-by-dhcp-issue-in-ubuntu.html and that did not change aything.

Revision history for this message
jonj (jonjackson) wrote :

lechup,

What is the output of the 'route' command on your system? I have a similar issue, and for whatever reason, there was no 'default' entry in the route table. The short-term solution for me is to run
sudo route add default gw <my router ip address>

Revision history for this message
lechup (lechup-o2) wrote : Re: [Bug 374006] Re: dhcp fails, but succeeds after ifdown/ifup in rc.local
Download full text (5.2 KiB)

But isn't the DHCP REQUEST first? As far I understand we cast it on
255.255.255.255 so packet goes everywhere, then we receive an IP and
send dhcp offer and routing table is afterwards updated? I have such
output in sysconfig after wlan0 connects to my wireless:

Jun 4 14:46:29 lechup-laptop NetworkManager: <info> Activation
(wlan0) Stage 3 of 5 (IP Configure Start) scheduled.
Jun 4 14:46:29 lechup-laptop NetworkManager: <info> Activation
(wlan0) Stage 3 of 5 (IP Configure Start) started...
Jun 4 14:46:29 lechup-laptop NetworkManager: <info> (wlan0): device
state change: 5 -> 7
Jun 4 14:46:29 lechup-laptop NetworkManager: <info> Activation
(wlan0) Beginning DHCP transaction.
Jun 4 14:46:29 lechup-laptop NetworkManager: <info> Activation
(wlan0) Stage 3 of 5 (IP Configure Start) complete.
Jun 4 14:46:29 lechup-laptop NetworkManager: <info> DHCP: device
wlan0 state changed (null) -> preinit
Jun 4 14:46:29 lechup-laptop dhclient: Listening on LPF/wlan0/00:1b:77:b3:10:5d
Jun 4 14:46:29 lechup-laptop dhclient: Sending on LPF/wlan0/00:1b:77:b3:10:5d
Jun 4 14:46:29 lechup-laptop avahi-daemon[4363]: Registering new
address record for fe80::21b:77ff:feb3:105d on wlan0.*.
Jun 4 14:46:33 lechup-laptop dhclient: DHCPDISCOVER on wlan0 to
255.255.255.255 port 67 interval 5
Jun 4 14:46:33 lechup-laptop dhclient: DHCPREQUEST of 192.168.1.79 on
wlan0 to 255.255.255.255 port 67
Jun 4 14:46:33 lechup-laptop NetworkManager: <info> DHCP: device
wlan0 state changed preinit -> bound
Jun 4 14:46:33 lechup-laptop NetworkManager: <info> Activation
(wlan0) Stage 4 of 5 (IP Configure Get) scheduled...
Jun 4 14:46:33 lechup-laptop NetworkManager: <info> Activation
(wlan0) Stage 4 of 5 (IP Configure Get) started...
Jun 4 14:46:33 lechup-laptop NetworkManager: <info> Activation
(wlan0) Stage 5 of 5 (IP Configure Commit) scheduled...
Jun 4 14:46:33 lechup-laptop NetworkManager: <info> Activation
(wlan0) Stage 4 of 5 (IP Configure Get) complete.
Jun 4 14:46:33 lechup-laptop NetworkManager: <info> Activation
(wlan0) Stage 5 of 5 (IP Configure Commit) started...
Jun 4 14:46:33 lechup-laptop avahi-daemon[4363]: Joining mDNS
multicast group on interface wlan0.IPv4 with address 192.168.1.79.
Jun 4 14:46:33 lechup-laptop avahi-daemon[4363]: New relevant
interface wlan0.IPv4 for mDNS.
Jun 4 14:46:33 lechup-laptop avahi-daemon[4363]: Registering new
address record for 192.168.1.79 on wlan0.IPv4.
Jun 4 14:46:34 lechup-laptop NetworkManager: <info> (wlan0): writing
resolv.conf to /sbin/resolvconf
Jun 4 14:46:35 lechup-laptop NetworkManager: <info> (wlan0): device
state change: 7 -> 8
Jun 4 14:46:35 lechup-laptop NetworkManager: <info> (wlan0): writing
resolv.conf to /sbin/resolvconf
Jun 4 14:46:35 lechup-laptop NetworkManager: <info> Policy set 'Auto
Czuchnowskiego 12' (wlan0) as default for routing and DNS.

The last step is to set the routing table and DNS.

PS: After doing sudo route add default gw 192.168.1.1 I get an error,
SIOCADDRT: No such process

And nothing more happens?!

Pozdrawiam
Leszek Piątek jr

2009/6/3 jonj <email address hidden>:
> lechup,
>
> What is the output of the 'route' command on your system? I have a similar is...

Read more...

Revision history for this message
Thomas Hood (jdthood) wrote : Re: dhcp fails, but succeeds after ifdown/ifup in rc.local

/e/n/i contains:

    auto eth0
    iface eth0 inet dhcp

so assuming NetworkManager.conf contains

    [ifupdown]
    managed=false

it's expected that NM doesn't manage eth0.

Revision history for this message
Thomas Hood (jdthood) wrote :

In the following part of syslog it appears, though, that NM is managing eth0 after saying that it's "now unmanaged"!

May 8 18:36:49 k8u NetworkManager: <info> (eth0): now unmanaged
[...]
May 8 18:36:51 k8u dhclient: There is already a pid file /var/run/dhclient.eth0.pid with pid 3094
May 8 18:36:51 k8u dhclient: killed old client process, removed PID file
May 8 18:36:51 k8u dhclient: Internet Systems Consortium DHCP Client V3.1.1
May 8 18:36:51 k8u dhclient: Copyright 2004-2008 Internet Systems Consortium.
May 8 18:36:51 k8u dhclient: All rights reserved.
May 8 18:36:51 k8u dhclient: For info, please visit http://www.isc.org/sw/dhcp/
May 8 18:36:51 k8u dhclient:
May 8 18:36:51 k8u dhclient: wmaster0: unknown hardware address type 801
May 8 18:36:51 k8u dhclient: parse_option_param: Bad format a
May 8 18:36:51 k8u dhclient: wmaster0: unknown hardware address type 801
May 8 18:36:51 k8u dhclient: Listening on LPF/eth0/00:0d:61:ed:05:82
May 8 18:36:51 k8u dhclient: Sending on LPF/eth0/00:0d:61:ed:05:82
May 8 18:36:51 k8u dhclient: Sending on Socket/fallback
May 8 18:36:51 k8u dhclient: DHCPRELEASE on eth0 to 192.168.1.254 port 67
May 8 18:36:51 k8u NetworkManager: <info> (eth0): carrier now OFF (device state 1)
May 8 18:36:51 k8u dhclient: Internet Systems Consortium DHCP Client V3.1.1
May 8 18:36:51 k8u dhclient: Copyright 2004-2008 Internet Systems Consortium.
May 8 18:36:51 k8u dhclient: All rights reserved.
May 8 18:36:51 k8u dhclient: For info, please visit http://www.isc.org/sw/dhcp/
May 8 18:36:51 k8u dhclient:
May 8 18:36:51 k8u dhclient: wmaster0: unknown hardware address type 801
May 8 18:36:51 k8u NetworkManager: <info> (eth0): carrier now ON (device state 1)

Thomas Hood (jdthood)
summary: - dhcp fails, but succeeds after ifdown/ifup in rc.local
+ dhcp fails with NM, but succeeds using ifup
Revision history for this message
Thomas Hood (jdthood) wrote :

@Ype: What's the status of this bug report in Ubuntu 12.04?

Changed in network-manager (Ubuntu):
status: New → Incomplete
Revision history for this message
Ype (ykingma) wrote :

I have meanwhile upgraded to 12.04, and there is no need anymore for ifdown/ifup to make dhcp succeed.
The bug has disappeared after the upgrade.

Revision history for this message
Thomas Hood (jdthood) wrote :

Nice to hear.

Changed in network-manager (Ubuntu):
status: Incomplete → Fix Released
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.