You are not logged in.

#1 2011-12-10 23:18:12

Economicus
Member
Registered: 2011-12-10
Posts: 8

Unable to automatically connect to network on boot (DHCP)

Hi everyone,

I am running a fresh install of arch linux, but I am not able to automatically connect to my university network when starting the computer.  Instead, I am forced to run "dhcpcd eth0" before it works:

$ sudo dhcpcd eth0
dhcpcd[862]: version 5.2.12 starting 
dhcpcd[862]: eth0: broadcasting for a lease
dhcpcd[862]: eth0: offered 158.142.169.208 from 158.142.225.178
dhcpcd[862]: eth0: ignoring offer of 158.142.169.208 from 158.142.225.180
dhcpcd[862]: eth0: acknowledged 158.142.169.208 from 158.142.225.178
dhcpcd[862]: eth0: checking for 158.142.169.208
dhcpcd[862]: eth0: leased 158.142.169.208 for 720 seconds
/usr/lib/dhcpcd/dhcpcd-hooks/30-hostname: line 9: hostname: command not found
dhcpcd[862]: forked to bakcground, child pid 883
$

/etc/rc.conf (with network in the daemons array)

HOSTNAME=arch
interface=eth0
address=
netmask=
broadcast=
gateway=

/etc/hosts

127.0.0.1   localhost.localdomain   localhost arch
::1   localhost.localdomain   localhost arch

Any ideas?

Thank you in advance.

Last edited by Economicus (2011-12-10 23:18:55)

Offline

#2 2011-12-10 23:22:09

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Unable to automatically connect to network on boot (DHCP)

Install inetutils package - it provides hostname utility.


What happens th dhcpcd running at boot? It fails with an error, times out ...?

Last edited by karol (2011-12-10 23:23:31)

Offline

#3 2011-12-10 23:25:25

Economicus
Member
Registered: 2011-12-10
Posts: 8

Re: Unable to automatically connect to network on boot (DHCP)

Thank you for your quick response, Karol.

I installed inetutils and my daemon log shows that dhcpcd times out at boot.

Dec 10 23:37:19 localhost dhcpcd[626]: eth0 carrier acquired
Dec 10 23:37:19 localhost dhcpcd[626]: eth0: broadcasting for a lease
Dec 10 23:37:48 localhost dhcpcd[626]:timed out

After which I run dhcpcd eht0 and the internet works (see previous post for output)

Last edited by Economicus (2011-12-10 23:53:32)

Offline

#4 2011-12-11 15:04:46

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

Re: Unable to automatically connect to network on boot (DHCP)

Look if the method described here to add dhcpcd to the rc.conf helps you: https://bbs.archlinux.org/viewtopic.php?id=63940

Offline

#5 2011-12-11 21:39:00

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Unable to automatically connect to network on boot (DHCP)

Offline

#6 2011-12-12 07:10:42

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Unable to automatically connect to network on boot (DHCP)

Strike0 wrote:

Look if the method described here to add dhcpcd to the rc.conf helps you: https://bbs.archlinux.org/viewtopic.php?id=63940

Sorry, but that's one ugly hack. Wired network functionality is basic and should be handled by rc.conf. After all, that's why you can set it there.

I really think this is some initscripts bug.

That's not a solution either; if the OP can get an IP through dhcpcd later on manually (just like I can), that means there's nothing wrong with dhcpcd. It's just a workaround.

I am going to test without my custom udev rules tonight; if that does not fix it I'm filing a bug report.

Last edited by .:B:. (2011-12-12 07:24:16)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#7 2011-12-12 11:05:18

Economicus
Member
Registered: 2011-12-10
Posts: 8

Re: Unable to automatically connect to network on boot (DHCP)

Thanks for all the responses.  I installed wicd to handle my wireless connections and set it to use dhclient, which now connects automatically at boot.

I am still not sure why dhcpcd does not work; I wonder if it has anything to do with my university network which usually takes quite a bit of time to connect to?

Offline

#8 2011-12-12 12:00:26

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Unable to automatically connect to network on boot (DHCP)

Does dhclient work for you on boot with eth0? I assume eth0 is your wired interface?


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#9 2011-12-12 12:03:06

Economicus
Member
Registered: 2011-12-10
Posts: 8

Re: Unable to automatically connect to network on boot (DHCP)

Yes, sorry I was not clear.  Dhclient works on boot with eth0,  and I installed wicd as I also frequently need to use wireless.  I set wicd to use dhclient in the preferences for wired connections (instead of default dhcpcd) and it now connects automatically on boot.

Last edited by Economicus (2011-12-12 12:03:46)

Offline

#10 2011-12-12 12:39:50

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Unable to automatically connect to network on boot (DHCP)

Hmm. That means there is something going wrong with dhcpcd during boot...


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#11 2011-12-12 14:43:14

Economicus
Member
Registered: 2011-12-10
Posts: 8

Re: Unable to automatically connect to network on boot (DHCP)

This issue was raised on the wicd wiki page, however, so I can not be the only person who has experienced this problem.  The suggestion there was to switch to dhclient:

https://wiki.archlinux.org/index.php/Wi … IP_address

Last edited by Economicus (2011-12-12 14:44:03)

Offline

#12 2011-12-12 18:17:07

nomilieu
Member
Registered: 2010-07-03
Posts: 133

Re: Unable to automatically connect to network on boot (DHCP)

It's odd; I had this problem a couple of years ago at a different university. I was too lazy to fix it, so I just ran dhcpcd manually.
At work currently (at a different university), everything works fine out of the box.

Go figure.

Offline

#13 2011-12-12 18:36:17

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

Re: Unable to automatically connect to network on boot (DHCP)

Economicus wrote:

I am still not sure why dhcpcd does not work; I wonder if it has anything to do with my university network which usually takes quite a bit of time to connect to?

That maybe,  since it works right away when you run it manually.  The dhcp server maybe slow, but the switch usually should not be. Maybe it helps in your case to just start dhcpcd in the background (put @dhcpcd at the end of the rc.conf array to try).

Offline

#14 2011-12-13 09:51:43

arch_gala
Member
Registered: 2011-03-23
Posts: 25

Re: Unable to automatically connect to network on boot (DHCP)

If you have a GUI environment I suggest you go with NetworkManager because it works great. On my laptop I have ArchLinux with Xfce environment and NetworkManager does a great job at managing all networks. The only thing that it lacks is proper IPv6 support for all connection types, but so are most of the high level network tools on Linux right now.

For configuring google "archlinux networkmanager". Remember to enable other users to change network settings, as it only works for root by default.

Offline

#15 2011-12-13 14:16:13

biltong
Member
From: South Africa
Registered: 2011-09-01
Posts: 118

Re: Unable to automatically connect to network on boot (DHCP)

I have this problem, and I got so sick of it eventually that I switched to network manager.

For example I'm testing an arch iso I'm making, and in testing it I have the standard network daemon started after I install it. After waiting a hell of a long time for the network daemon to start in the boot process I try a pacman -Syu which fails instantly, and then I find if I run dhcpcd just like that it tells me no interfaces have a carrier and then forks to the background. But if I do dhcpcd -k and then dhcpcd again I get an IP instantly. Haven't had issues on my main install since networkmanager though.

OP, do you have 2 network cards? My motherboard has a marvell pci interface and a realtek pci-e interface built in, and a realtek wireless usb card built in too. I wonder if that has anything to do with it.

Offline

#16 2011-12-13 17:20:43

Economicus
Member
Registered: 2011-12-10
Posts: 8

Re: Unable to automatically connect to network on boot (DHCP)

@Strike0 - made no difference

I have tried network manager in the past and run across certain small bugs.  I think for now I will just stick to using wicd with dhclient - no issues so far.

Thank you all for the comments.  I will leave the topic unsolved since we have not resolved the root of the problem - only suggested various workarounds.  Have a pleasant Holiday season everyone!

Last edited by Economicus (2011-12-13 17:23:01)

Offline

#17 2011-12-15 00:54:57

masterkoppa
Member
Registered: 2009-04-14
Posts: 92

Re: Unable to automatically connect to network on boot (DHCP)

I've had the same problem, ended up using network manager for it so that it would connect automatically. Even then it fails every once in a while. I think the dhcpcd timeout is too small as I know for a fact that the dhcp servers where I live(college) are REALLY slow to respond. It might take windows 20 secs to get a response sometimes.

Offline

#18 2011-12-15 07:38:47

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Unable to automatically connect to network on boot (DHCP)

I am going to open a bug report. There is something wrong with the initscripts. I have tried with and without udev rules, with and without the custom name for my interfaces (which works fine for netcfg).

To the people suggesting dhclient: it needs a helper script apparently, and initscripts has dhcpcd calls hardcoded.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

Board footer

Powered by FluxBB