You are not logged in.

#1 2011-12-07 23:08:18

fester
Member
Registered: 2011-02-09
Posts: 18

DHCP fails to get IP address

I'm using dhcpcd to try to get a lease for an IP address, but each attempt is met with a "timed out" message. The DHCP server works for other Arch Linux installs on this network, and it works for the same laptop when using Windows. This install also fails when trying on other DHCP servers, not just on my home network. I'm not sure what it is now. I usually run iptables, but I stopped it thinking it might be the problem. I've also stopped networkmanager. I have a completely updated system, I ran pacman -Syu just now and rebooted.

I can manually set the IP address and it works fine, and I've tried dhclient instead of dhcpcd.

root@thinkpad ~# dhcpcd --release
dhcpcd[7377]: dhcpcd not running
root@thinkpad ~# dhcpcd -d eth0
dhcpcd[7378]: version 5.2.12 starting
dhcpcd[7378]: eth0: using hwaddr ....
dhcpcd[7378]: eth0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason PREINIT
dhcpcd[7378]: eth0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason CARRIER
dhcpcd[7378]: eth0: broadcasting for a lease
dhcpcd[7378]: eth0: sending DISCOVER (xid 0x485d8657), next in 4.24 seconds
dhcpcd[7378]: eth0: sending DISCOVER (xid 0x485d8657), next in 7.21 seconds
dhcpcd[7378]: eth0: sending DISCOVER (xid 0x485d8657), next in 15.01 seconds
dhcpcd[7378]: eth0: sending DISCOVER (xid 0x485d8657), next in 31.15 seconds
dhcpcd[7378]: timed out
# lspci -v | grep -A10 Ethernet
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)
	Subsystem: Lenovo Device 21ce
	Flags: bus master, fast devsel, latency 0, IRQ 50
	Memory at d5300000 (32-bit, non-prefetchable) [size=128K]
	Memory at d532b000 (32-bit, non-prefetchable) [size=4K]
	I/O ports at 6040 [size=32]
	Capabilities: [c8] Power Management version 2
	Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Capabilities: [e0] PCI Advanced Features
	Kernel driver in use: e1000e
	Kernel modules: e1000e

and

# dmesg | grep e1000e

shows the link is up:

e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx

This is my rc.conf with the comments removed:

LOCALE="en_US.UTF-8"
DAEMON_LOCALE="no"
HARDWARECLOCK="localtime"
TIMEZONE="America/Indiana/Indianapolis"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"
MODULES=(fuse nvidia thinkpad_acpi)
UDEV_TIMEOUT=30
USEDMRAID="no"
USEBTRFS="no"
USELVM="no"
HOSTNAME="thinkpad"
interface=eth0
address=
netmask=
broadcast=
gateway=
NETWORK_PERSIST="no"
DAEMONS=(!hwclock syslog-ng udev @slim network iptables dbus @bluetooth networkmanager @acpid !smbnetfs crond @alsa @cpufreq)

Last edited by fester (2011-12-09 22:48:47)

Offline

#2 2011-12-07 23:24:32

Mavirick
Member
Registered: 2011-12-01
Posts: 62

Re: DHCP fails to get IP address

The problem is that you have both network and networkmanager in your daemons section.  If you look here:

https://wiki.archlinux.org/index.php/Ne … work_setup

You are supposed to disable network and allow networkmanager to control the interface.

Offline

#3 2011-12-07 23:49:13

fester
Member
Registered: 2011-02-09
Posts: 18

Re: DHCP fails to get IP address

Thanks for the quick response. I've updated my daemons list:

DAEMONS=(!hwclock syslog-ng udev @slim dbus networkmanager iptables @bluetooth @acpid !smbnetfs crond @alsa @cpufreq)

and rebooted, and it still does not work... here is the new output:

root@thinkpad ~# rc.d stop iptables 
:: Stopping IP Tables                                                    [DONE] 
root@thinkpad ~# dhcpcd --release
dhcpcd[1272]: dhcpcd not running
root@thinkpad ~# dhcpcd -d eth0
dhcpcd[1273]: version 5.2.12 starting
dhcpcd[1273]: eth0: using hwaddr .....
dhcpcd[1273]: eth0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason PREINIT
dhcpcd[1273]: eth0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason NOCARRIER
dhcpcd[1273]: eth0: waiting for carrier
dhcpcd[1273]: eth0: carrier acquired
dhcpcd[1273]: eth0: using hwaddr .....
dhcpcd[1273]: eth0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason CARRIER
dhcpcd[1273]: eth0: broadcasting for a lease
dhcpcd[1273]: eth0: sending DISCOVER (xid 0xd44a7981), next in 3.46 seconds
dhcpcd[1273]: eth0: sending DISCOVER (xid 0xd44a7981), next in 7.16 seconds
dhcpcd[1273]: eth0: sending DISCOVER (xid 0xd44a7981), next in 15.14 seconds
dhcpcd[1273]: eth0: sending DISCOVER (xid 0xd44a7981), next in 31.52 seconds
dhcpcd[1273]: timed out

Last edited by fester (2011-12-08 13:02:20)

Offline

#4 2011-12-08 00:05:12

Mavirick
Member
Registered: 2011-12-01
Posts: 62

Re: DHCP fails to get IP address

This is my rc.conf with the comments removed:

LOCALE="en_US.UTF-8"
DAEMON_LOCALE="no"
HARDWARECLOCK="localtime"
TIMEZONE="America/Indiana/Indianapolis"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"
MODULES=(fuse nvidia thinkpad_acpi)
UDEV_TIMEOUT=30
USEDMRAID="no"
USEBTRFS="no"
USELVM="no"
HOSTNAME="thinkpad"

interface=eth0

address=
netmask=
broadcast=
gateway=
NETWORK_PERSIST="no"
DAEMONS=(!hwclock syslog-ng udev @slim network iptables dbus @bluetooth networkmanager @acpid !smbnetfs crond @alsa @cpufreq)

The interface line above should be

interface=(!eth0)

If after that change it still does not work you can modify your /etc/dhclient.conf and add

interface "eth0" {
   send dhcp-client-identifier 01:aa:bb:cc:dd:ee:ff;
 }

Offline

#5 2011-12-08 01:22:30

fester
Member
Registered: 2011-02-09
Posts: 18

Re: DHCP fails to get IP address

I edited my rc.conf and changed the interface. Then ran
dhcpcd eth0

and it still timed out.

I don't have a /etc/dhclient.conf but I do have a /etc/dhclient.conf.example should I edit that one?

Last edited by fester (2011-12-08 01:23:18)

Offline

#6 2011-12-08 02:16:12

Mavirick
Member
Registered: 2011-12-01
Posts: 62

Re: DHCP fails to get IP address

Before you edit it you need to:

cp /etc/dhclient.conf.example /etc/dhclient.conf

Before you make any changes see if you can get a DHCP assigned address, if not then go ahead and make the changes to the file.

Offline

#7 2011-12-08 03:31:16

NgoHuy
Member
Registered: 2011-10-27
Posts: 23

Re: DHCP fails to get IP address

Trying dhcpcd -C eth0 smile
If it doesn't work, reinstalling dhcpcd big_smile

Offline

#8 2011-12-08 04:38:59

fester
Member
Registered: 2011-02-09
Posts: 18

Re: DHCP fails to get IP address

Mavrick, that did not fix it.

NgoHuy... dhcpcd -C eth0 did not solve the problem either.

I think dhcpcd is broken for wlan0 too...


root@thinkpad ~# dhcpcd -C eth0
dhcpcd[8439]: version 5.2.12 starting
dhcpcd[8439]: eth0: broadcasting for a lease
dhcpcd[8439]: wlan0: broadcasting for a lease
dhcpcd[8439]: timed out
dhcpcd[8439]: forked to background, child pid 8453

I also tried

dhcpcd eth0 -C /usr/lib/dhcpcd/dhcpcd-run-hooks 

and that didn't work.

I removed dhcpcd:

root@thinkpad ~# pacman -Runs dhcpcd 

and reinstalled it

root@thinkpad ~# pacman -S dhcpcd

and i still get the same problem

root@thinkpad ~# dhcpcd -d eth0
dhcpcd[8590]: version 5.2.12 starting
dhcpcd[8590]: eth0: using hwaddr .....
dhcpcd[8590]: eth0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason PREINIT
dhcpcd[8590]: eth0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason CARRIER
dhcpcd[8590]: eth0: broadcasting for a lease
dhcpcd[8590]: eth0: sending DISCOVER (xid 0x4b4b814b), next in 3.91 seconds
dhcpcd[8590]: eth0: sending DISCOVER (xid 0x4b4b814b), next in 8.73 seconds
dhcpcd[8590]: eth0: sending DISCOVER (xid 0x4b4b814b), next in 15.68 seconds
dhcpcd[8590]: eth0: sending DISCOVER (xid 0x4b4b814b), next in 32.46 seconds
dhcpcd[8590]: timed out

Last edited by fester (2011-12-08 13:03:41)

Offline

#9 2011-12-08 04:57:45

fester
Member
Registered: 2011-02-09
Posts: 18

Re: DHCP fails to get IP address

Just in case, this is my dhcpcd.conf with comments removed:

hostname

option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
option interface_mtu
require dhcp_server_identifier

nohook lookup-hostname
noipv4ll

and this is what dhclient displays:

dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10
dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14
dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14
dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 1
dhclient: No DHCPOFFERS received.
dhclient: No working leases in persistent database - sleeping.

Last edited by ewaller (2011-12-08 06:14:40)

Offline

#10 2011-12-08 06:13:56

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: DHCP fails to get IP address

Fester,

Welcome to Arch.  Please use BBCode code tags when posting program output or the contents of files.  It will make your posts far more legible to your readers, it adds scroll bars for large passages, and it uses a monospaced font so that columns line up.

I have taken the liberty to add them to your last post.  Edit that post to see how it is done.

ewaller (moderator)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#11 2011-12-08 06:21:32

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: DHCP fails to get IP address

You might try dhclient instead of dhcpcd.  I generally don't like to "fix" a problem by recommending a different program.  In this case, I will.  At the least, it will tell us more about the problem if it does (or does not) work.

Also, can you post the output of ip addr  ??


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#12 2011-12-08 13:09:59

fester
Member
Registered: 2011-02-09
Posts: 18

Re: DHCP fails to get IP address

ewaller wrote:

You might try dhclient instead of dhcpcd.  I generally don't like to "fix" a problem by recommending a different program.  In this case, I will.  At the least, it will tell us more about the problem if it does (or does not) work.

Also, can you post the output of ip addr  ??

You can see in my first post and in the last post that you edited that I've already tried dhclient and it does not give me an IP address, it just times out (rather, it sleeps).

Offline

#13 2011-12-08 14:21:40

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: DHCP fails to get IP address

fester wrote:

...You can see in my first post and in the last post that you edited that I've already tried dhclient...

ewaller checks ...

...and I've tried dhclient instead of dhcpcd.

Missed that.  Sorry. yikes


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#14 2011-12-08 20:19:09

fester
Member
Registered: 2011-02-09
Posts: 18

Re: DHCP fails to get IP address

This is the output of my ip a as you requested with the mac addresses removed.

root@thinkpad ~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
2: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether ..... brd ff:ff:ff:ff:ff:ff
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether ..... brd ff:ff:ff:ff:ff:ff

Offline

#15 2011-12-08 20:33:23

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: DHCP fails to get IP address

Maybe give

dhcpcd -n -L eth0

a try also.

Offline

#16 2011-12-08 20:56:04

fester
Member
Registered: 2011-02-09
Posts: 18

Re: DHCP fails to get IP address

Strike0 wrote:

Maybe give

dhcpcd -n -L eth0

a try also.

No dice there, either.

root@thinkpad ~# dhcpcd -n -L eth0
dhcpcd[2220]: version 5.2.12 starting
dhcpcd[2220]: eth0: broadcasting for a lease
dhcpcd[2220]: timed out

Offline

#17 2011-12-08 21:28:20

fester
Member
Registered: 2011-02-09
Posts: 18

Re: DHCP fails to get IP address

Should I open a bug report or maybe move this to the networking section?

Offline

#18 2011-12-08 22:05:53

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: DHCP fails to get IP address

fester wrote:

.... or maybe move this to the networking section?

Done.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#19 2011-12-09 22:33:18

fester
Member
Registered: 2011-02-09
Posts: 18

Re: DHCP fails to get IP address

Anyone have any idea? I used tcpdump to confirm that it is actually sending dhcp requests, but it is not seeing any returned packets.

Please someone save me, I have to use Windows at school since they have varying dhcp ranges.

Offline

#20 2011-12-09 23:08:00

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: DHCP fails to get IP address

Really strange error. Look in the bios for switches for the network device. Also, you stopped your iptables manually. Perhaps you should disable it for the while of testing in rc.conf.
Try a real cold boot as well, if you have not done that yet. I read about a strange behaviour of that chip happening to someone when googling for it yesterday. that was solved by a factory default bios and cold boot.
Try putting the eth link down, up again and wait (!) before continuing again with dhcpcd
Have you tried out a strange tcp stack perhaps?

Offline

#21 2011-12-10 14:29:33

kurych
Member
From: Saint-Petersburg, Russia
Registered: 2011-12-07
Posts: 27

Re: DHCP fails to get IP address

I think you must make "rc.d stop networkmanager" and only after that could try to run "dhcpcd" by hands.
And are you sure what DHCP server running in your LAN?

Offline

#22 2011-12-10 15:57:14

fester
Member
Registered: 2011-02-09
Posts: 18

Re: DHCP fails to get IP address

I just edited out networkmanager and iptables from my rc.conf. I shut down the laptop, removed the battery and let it sit for a few minutes. I booted it up, checked the interface and it was down, I ran dhcpcd eth0:

root@thinkpad ~# dhcpcd eth0
dhcpcd[1416]: version 5.2.12 starting
dhcpcd[1416]: eth0: waiting for carrier
dhcpcd[1416]: eth0: carrier acquired
dhcpcd[1416]: eth0: broadcasting for a lease
dhcpcd[1416]: timed out

I am sure what DHCP server is running on my LAN, but it's not only my LAN, because it has the same problems on the school network too.

Offline

#23 2011-12-10 16:15:52

fester
Member
Registered: 2011-02-09
Posts: 18

Re: DHCP fails to get IP address

Strike0 wrote:

Really strange error. Look in the bios for switches for the network device. Also, you stopped your iptables manually. Perhaps you should disable it for the while of testing in rc.conf.
Try a real cold boot as well, if you have not done that yet. I read about a strange behaviour of that chip happening to someone when googling for it yesterday. that was solved by a factory default bios and cold boot.
Try putting the eth link down, up again and wait (!) before continuing again with dhcpcd
Have you tried out a strange tcp stack perhaps?

I don't think I have a strange tcp stack. I have compiled compat wireless and updated the firmware for my wireless card, but this should not affect the wired port should it?

Offline

#24 2011-12-10 17:48:18

sironitomas
Member
From: Cordoba, Argentina
Registered: 2009-11-28
Posts: 174
Website

Re: DHCP fails to get IP address

I had the same problem. Try to append the option "--timeout 60".

That fixed the problem in my case.

Offline

#25 2011-12-10 21:11:45

kurych
Member
From: Saint-Petersburg, Russia
Registered: 2011-12-07
Posts: 27

Re: DHCP fails to get IP address

ok. First, try to check, or better, replace your UTP cable.
After that say in one terminal

$ sudo ip link set eth0 up
$ sudo tcpdump -i eth0

and look if there are any traffic. Simultaneously launch in other terminal window "dhcpcd eth0". Are there some responds from LAN?

Offline

Board footer

Powered by FluxBB