You are not logged in.

#1 2005-04-22 22:13:20

tropical_disease
Member
From: Boston
Registered: 2005-02-21
Posts: 21

dhcp not starting eth0 or wlan0 on bootup

I had problems with dhcp when I first installed arch, so I ended up configuring my internet connection via static IPs for my desktop and laptop which are on the same network. I connect via a belkin wireless router btw.

Basically, with dhcp, the network would only start on bootup maybe 5% or the time. The rest of the time, it would fail, but I could start it manually after bootup all the time, without fail,. but it was a pain which is why I set up static IP and just forgot about dhcp. Then I saw this:

http://bbs.archlinux.org/viewtopic.php? … light=dhcp

and decided to give it another shot. I made the necessary edits to the scripts for network (desktop) and network and wireless (laptop), but it still don't work! I still have to start the networks after bootup. Now I really want to get this fixed, and the fact that both computers have the same problem suggests that it's the same problem in both cases, I'm just not sure what it could be, which is why I'm here.

Anyway, I'll post the relevant section of rc.conf from my desktop, the one for my laptop is pretty similar.

#
# Networking                    
#                               
HOSTNAME="myhost"               
                                
#                               
# Module to load at boot-up (in this order)
#   (prefix a module with a ! to disable it)
#                               
MODULES=(!usbserial !ide-scsi ohci_hcd ehci_hcd parport_pc parport 
!dmfe pcspkr tulip nvidia snd_intel8x0 snd_ac97_codec snd_pcm_oss 
snd_mixer_oss snd_pcm snd_timer snd soundcore snd_page_alloc i2c_i8
i2c_core !joydev usbhid usb_storage uhci_hcd usbcore hw_random tsde
evdev rtc)                      
                                
#                               
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   (prefix an interface in INTERFACES with a ! to disable it)
#                               
# Note: to use DHCP, set your interface to be "dhcp" (eth0="dhcp")
#                               
lo="lo 127.0.0.1"               
eth0="dhcp"                     
#eth0="eth0 192.168.2.5 netmask 255.255.255.0 broadcast 192.168.255
INTERFACES=(lo eth0)            
#                               
# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   (prefix a route in ROUTES with a ! to disable it)
#
gateway="default gw 192.168.2.1"
ROUTES=(!gateway)

#
# Daemons to start at boot-up (in this order)
#   (prefix a daemon with a ! to disable it)
#
DAEMONS=(syslog-ng !hotplug autofs !pcmcia netfs crond network)

# End of file

I'm a bit embaressed about my module array btw. Feel free to tell me what really needs to be kept in and what can be hacked.

Also, maybe nothing, but my resolv.conf file looks a bit strange. All I have in there is my default gateway as a "nameserver entry" and a "search" entry which is Belkin, my router.

Well, thanks for any help

Cheers!

Offline

#2 2005-04-22 22:40:13

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: dhcp not starting eth0 or wlan0 on bootup

(!usbserial !ide-scsi ohci_hcd ehci_hcd parport_pc parport
!dmfe pcspkr tulip nvidia snd_intel8x0 snd_ac97_codec snd_pcm_oss
snd_mixer_oss snd_pcm snd_timer snd soundcore snd_page_alloc i2c_i8
i2c_core !joydev usbhid usb_storage uhci_hcd usbcore hw_random tsde
evdev rtc) 

go ahead and remove paraport_pc & paraport, unless you use your parallel port (who does?)
also remove pcspkr
as for the snd modules, most of those are dependant modules - you only need snd_intel8x0 and snd_pcm_oss
you can safely remove usbhid, usb_storage, and usbcore as those are loaded automatically when needed.
also remove joydev and evdev - they're some silly hotplug modules
you also only need one of the ohci_hcd/uhci_hcd (it depends on hardware - try checking the output of lshwd)
I have no clue what dmfe and tsde are (try modinfo on each of them)

I don't know anything about i2c, so can't help there... (I'd remove them for the hell of it)
hw_random and rtc are iffy - I don't have them... some people use them... *shrug*


anyway, onto the question.... you made the change suggested in that thread, switching the "kill" to a "dhcpcd -k", correct? from there I would suggest running "/etc/rc.d/network restart" and then reboot... you need to hit the "dhcpcd -k" part to release it first... I dunno...

Offline

#3 2005-04-22 23:12:25

tropical_disease
Member
From: Boston
Registered: 2005-02-21
Posts: 21

Re: dhcp not starting eth0 or wlan0 on bootup

phrakture, thanks for the modules tips

[root@myhost dave]# dhcpcd -k
****  dhcpcd: not running
[root@myhost dave]# /etc/rc.d/network restart
:: Stopping Network                                                      [DONE] 
:: Starting Network                                                      [FAIL] 
[root@myhost dave]# /etc/rc.d/network start
:: Starting Network                                                      [DONE]

ok, I'm missing something really easy here. If dhcpcd is not running, then how am I connected? and why isn't dhcpcd running? :?

Coincidentally, I'm using your wireless script (thanks!)

Offline

#4 2005-04-23 00:54:43

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: dhcp not starting eth0 or wlan0 on bootup

woah... oddly enough dhcp isn't actively running for me either....
ps aux | grep dhcp returns nothing... ummm let me look at this a bit more

Offline

#5 2005-04-23 15:36:20

tropical_disease
Member
From: Boston
Registered: 2005-02-21
Posts: 21

Re: dhcp not starting eth0 or wlan0 on bootup

OK, still stuck on this one.
I flagged dhcpcd to display its output, but how do I get this to log in syslog? the instructions in man dhcpcd do not work for me. I tried editing /etc/syslog-ng/syslog-ng.conf with

local0.*     /var/log/dhcpcd.log

but that just induces a parse error when syslog is trying to start on bootup - err, I don't really know what I'm doing as you can probably see. smile

Is there anything I can add to /etc/conf.d/dhcpcd to remedy my problem? This is all I have in there at the moment

DHCPCD_ARGS="-t 5 -h home"

thanks

Offline

#6 2005-04-26 00:52:20

tropical_disease
Member
From: Boston
Registered: 2005-02-21
Posts: 21

Re: dhcp not starting eth0 or wlan0 on bootup

Bump.

Here's the DHCP log while the network is trying to boot up. Looks like my router and dhcpcd are having a disagreement.

Apr 25 20:34:49 myhost dhcpcd[3445]: broadcasting DHCP_DISCOVER
Apr 25 20:34:54 myhost dhcpcd[3445]: timed out waiting for a valid DHCP server response
Apr 25 20:35:09 myhost dhcpcd[3653]: broadcasting DHCP_DISCOVER
Apr 25 20:35:10 myhost dhcpcd[3653]: broadcastAddr option is missing in DHCP server response. Assuming 192.168.2.255
Apr 25 20:35:10 myhost dhcpcd[3653]: dhcpIPaddrLeaseTime=7200 in DHCP server response.
Apr 25 20:35:10 myhost dhcpcd[3653]: dhcpT1value is missing in DHCP server response. Assuming 3600 sec
Apr 25 20:35:10 myhost dhcpcd[3653]: dhcpT2value is missing in DHCP server response. Assuming 6300 sec
Apr 25 20:35:10 myhost dhcpcd[3653]: DHCP_OFFER received from ÿ (192.168.2.1)
Apr 25 20:35:10 myhost dhcpcd[3653]: broadcasting DHCP_REQUEST for 192.168.2.5
Apr 25 20:35:10 myhost dhcpcd[3653]: dhcpIPaddrLeaseTime=7200 in DHCP server response.
Apr 25 20:35:10 myhost dhcpcd[3653]: dhcpT1value is missing in DHCP server response. Assuming 3600 sec
Apr 25 20:35:10 myhost dhcpcd[3653]: dhcpT2value is missing in DHCP server response. Assuming 6300 sec
Apr 25 20:35:10 myhost dhcpcd[3653]: DHCP_ACK received from ÿ (192.168.2.1)
Apr 25 20:35:20 myhost eth0: no IPv6 routers present

T1 and T2 are the renewal time and the rebindtime respectively I think, so if I could get dhcpcd to default these values, the problem may be solved, but I don't really know how to go about that.

Well, I'd still love to crack this if anyone has any ideas.
Cheers

Offline

#7 2005-04-26 15:09:34

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: dhcp not starting eth0 or wlan0 on bootup

yeah, going to need someone more specialized than I here - can anyone tell me why dhcpcd doesn't stay running? it looks like it makes the connection then dies... I thought it should run so as to renew the leases and things....

Offline

#8 2005-04-30 20:35:09

pixel
Member
From: Living in the Server Room
Registered: 2005-02-21
Posts: 119

Re: dhcp not starting eth0 or wlan0 on bootup

disease, I would say something is wrong with your router dhcp configuration. Try to connect other pc to that router and see if dhcp is working there...


Favorite systems: ArchLinux, OpenBSD
"Yes, I love UNIX"

Offline

#9 2005-04-30 20:53:51

tropical_disease
Member
From: Boston
Registered: 2005-02-21
Posts: 21

Re: dhcp not starting eth0 or wlan0 on bootup

That's the confusing thing. My laptop is the only wireless box I have, but I have a desktop computer running arch, and they're both on the same home network, connected to the same router.
The dhcpcd connection on the desktop picks up and releases eth0 correctly - this only after I made the edits to the network script advocated in masonm's post (a few lines down on this forum).
On the laptop, I also made this same edit to my wireless and network scripts but it's still not going right. I totally agree that it's dhcpcd, but I can't figure out why it should be giving me such a hard time.
I may go back to static IP as my dhcp doesn't seem to allocate new IP addresses anyway, whenever I check ifconfig, it's always the same one, which is a bit confusing to me as this seems to be less than a "dynamic" protocol.

Here's my dhcpcd log to see if you have any ideas about what might be going wrong

Apr 30 14:45:08 home dhcpcd[2435]: broadcasting DHCP_DISCOVER
Apr 30 14:45:14 home dhcpcd[1796]: timed out waiting for a valid DHCP server respon
se
Apr 30 14:45:14 home dhcpcd[2435]: recvfrom: Network is down
Apr 30 14:45:14 home Disabled Privacy Extensions on device c05d68a0(lo)
Apr 30 14:45:14 home dhcpcd[2460]: broadcasting DHCP_DISCOVER
Apr 30 14:45:24 home dhcpcd[2460]: timed out waiting for a valid DHCP server respon
se
Apr 30 14:45:51 home dhcpcd[2588]: broadcasting DHCP_DISCOVER
Apr 30 14:46:01 home dhcpcd[2588]: timed out waiting for a valid DHCP server respon
se
Apr 30 14:46:02 home dhcpcd[2605]: broadcasting DHCP_DISCOVER
Apr 30 14:46:07 home dhcpcd[2605]: broadcastAddr option is missing in DHCP server r
esponse. Assuming 192.168.2.255
Apr 30 14:46:07 home dhcpcd[2605]: dhcpIPaddrLeaseTime=7200 in DHCP server response
.
Apr 30 14:46:07 home dhcpcd[2605]: dhcpT1value is missing in DHCP server response. 
Assuming 3600 sec
Apr 30 14:46:07 home dhcpcd[2605]: dhcpT2value is missing in DHCP server response. 
Assuming 6300 sec
Apr 30 14:46:07 home dhcpcd[2605]: DHCP_OFFER received from ÿ (192.168.2.1)
Apr 30 14:46:07 home dhcpcd[2605]: broadcasting DHCP_REQUEST for 192.168.2.78
Apr 30 14:46:07 home dhcpcd[2605]: dhcpIPaddrLeaseTime=7200 in DHCP server response
.
Apr 30 14:46:07 home dhcpcd[2605]: dhcpT1value is missing in DHCP server response. 
Assuming 3600 sec
Apr 30 14:46:07 home dhcpcd[2605]: dhcpT2value is missing in DHCP server response. 
Assuming 6300 sec
Apr 30 14:46:07 home dhcpcd[2605]: DHCP_ACK received from ÿ (192.168.2.1)
Apr 30 14:46:13 home wlan0: no IPv6 routers present

This is the log as it's trying to boot up the interface

cheers!

[EDIT]: OK, hope I haven't confused anyone, but I thought I was answering my post on the laptop forum instead of this one:

http://bbs.archlinux.org/viewtopic.php?t=11973

The way I got the desktop network script to work properly was to change

if [ -f /etc/dhcpc/dhcpcd-${1}.pid ]; then
/bin/kill `cat /etc/dhcpc/dhcpcd-${1}.pid`

if [ -f /etc/dhcpc/dhcpcd-${1}.pid ]; then
/sbin/dhcpcd -k eth0

in the ifdown section of the script - it's important to add the interface (eth 0) to the second line here, or it doesn't work.
(this with masonm's help, thanks)

The reason I didn't post this info on this forum yet is because my wireless dhcp is still so messed up!

Cheers again!

Offline

#10 2005-05-02 00:19:29

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: dhcp not starting eth0 or wlan0 on bootup

the problem was found by MasonM - dhcpcd doesn't release the lease on shutdown - an issue seems to come up with wireless where dhcpcd doesn't stay running - I'm trying to look into this issue, but I cannot seem to track it down

Offline

#11 2005-05-02 01:54:55

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: dhcp not starting eth0 or wlan0 on bootup

check the link three posts up - MasonM solved it - it requires editing of the network script (until judd releases a new script)

Offline

#12 2005-05-02 03:58:17

tropical_disease
Member
From: Boston
Registered: 2005-02-21
Posts: 21

Re: dhcp not starting eth0 or wlan0 on bootup

sorry for not getting back to this earlier.

anyway, neomega, I also tried using two network daemons in rc.conf - great (or should I say pragmatic) minds work alike - but it was less than aestheically pleasing. The way I solved this on my desktop properly in the end was to replace the following line in the /etc/rc.d/network script from the "if down" section:

if [ -f /etc/dhcpc/dhcpcd-${1}.pid ]; then
/bin/kill `cat /etc/dhcpc/dhcpcd-${1}.pid`

replace with

if [ -f /etc/dhcpc/dhcpcd-${1}.pid ]; then
/sbin/dhcpcd -k eth0 

As mentioned earlier, credit to masonm for this.

It's important to have my interface eth0 here, or it doesn't work properly. eg "/sbin/dhcpcd -k" by itself does not work.

With this edit, the network daemon boots up first time every time, no dhcpcd problems at all.
So I suppose I can say that the problem is solved for my desktop which used eth0 to connect.

The wireless interface is obviously a different kettle of fish. No similar edits I've made to the wireless and/or network script have worked so far. I'll keep you posted if I manage to make any headway on this.

Cheers!

Offline

#13 2005-05-02 13:06:30

tropical_disease
Member
From: Boston
Registered: 2005-02-21
Posts: 21

Re: dhcp not starting eth0 or wlan0 on bootup

Once again, I'm confusing people.
My desktop is wired, connected to my router.
My notebook is wireless, using the same router.

The problem on my desktop was fixed using the edit a few lines above to the network script.

The problem with my notebook is, well, still a problem.

Cheers.

Offline

#14 2005-05-02 13:57:26

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: dhcp not starting eth0 or wlan0 on bootup

neomega wrote:

i did use masonm's edit for the network daemon but it's a shame it didn't fix things for me as it did for you.

like i said, i'm on a wired connection so it's strange how we have similar bugs.  calling the network daemon only seems to work for every other call.

i'm beginning to think it's my crappy built-in NIC or router's fault for being incompatible.  anyways though, i can definitely live with this.  linux isn't about being pretty sometimes.  hehe.   wink

Hmmm, are you shutting down properly?

The thing is, dhcpcd wasn't telling the router you were done with an IP address.  MasonM's fix releases the dhcp IP address when the network daemon stops.  Therefore, it should work afterwards, assuming you stop the network daemon properly.

Offline

#15 2005-05-02 22:37:42

tropical_disease
Member
From: Boston
Registered: 2005-02-21
Posts: 21

Re: dhcp not starting eth0 or wlan0 on bootup

i'll try it again though to make sure, sometimes you never know...

And at the risk of overdoing it, make sure you enter your interface with the script edit (in my case dhcpcd -k eth0) as the edit doesn't work without this.

Cheers!

Offline

#16 2005-09-22 00:22:42

_alexmyself
Member
From: france
Registered: 2005-09-18
Posts: 89

Re: dhcp not starting eth0 or wlan0 on bootup

hello, i'm french user so excuse my language...

i have the same problem : d'ont work at boot and run after if ./network start
i have tried the modifye /usr/sbin/dhcpcd -k ${1}     (it look like good, i have no error when shutdown..)

after the boot, ps -aux | grep dhcp return a dhcpcd running on my wireless card
if i do the ./network start it's good
but if i kill the process then ./network start don't help me

looking in this way i have find the -S option for dhcpcd, it send a second request to the server after  receive a good answer, that's good for some routers...but it doesn't change anything

i'm on a laptop with two cards, wireless and a normal one
i have no problem when i didn't put eth0 in my rc.conf
i have tried with both interface ath0 and eth0, eth0 set with dhcp or static ip but fail in twice

that's all i can say...

Offline

#17 2005-09-22 01:11:19

T-Dawg
Forum Fellow
From: Wilmington, NC
Registered: 2005-01-29
Posts: 2,734

Re: dhcp not starting eth0 or wlan0 on bootup

so your network isn't running after boot, only when you restart it? Try moving the network deamon to later posistion in DAEMONS(). Maybe hotplug hasn't loaded the module before network tries to start.

You can try the french forum too:
http://forums.archlinuxfr.org/

Offline

#18 2005-09-22 14:20:23

_alexmyself
Member
From: france
Registered: 2005-09-18
Posts: 89

Re: dhcp not starting eth0 or wlan0 on bootup

no, only the dhcp isn't working

lo--> 127...
eth0-->192....
ath0-->dhcp

lo and eth0 are running after boot
a dhcpcd is running on my ath0 (ps -aux...) certainly waiting for something he never catch

if i ./network start, a second dhcpcd run and goal an ip from router, and then network doesn't return "fail" like during boot

if i remove eth0 from rc.conf, dhcpcd start perfectly at boot

Offline

#19 2005-09-23 19:59:54

_alexmyself
Member
From: france
Registered: 2005-09-18
Posts: 89

Re: dhcp not starting eth0 or wlan0 on bootup

....i finally found....

at boot on my wifi ath0, two dhcpcd are launch, i don't know why
if i place "echo blabla.." to see if the command isn't read two times, i can see that no....
don't ask me how it's possible, i just tell what i've seen...and i've seen really better....

again in the network script, i've placed a "ifconfig ath0" just before the dhcpcd line...i was very surprised to see that my ath0 already get an ip ....
and if the dhcpcd line is removed, the ath0 don't have an ip........i've try understand....i've try hard....but sometimes, better fail......

so after 20 millions boot i've do this in /etc/rc.d/network

ifup()
{
    if [ "$1" = "" ]; then
        echo "usage: $0 ifup <interface_name>"
        return 1
    fi
    #echo "mise en place de : ${1}"
    for wif in ${WLAN_INTERFACES[@]}; do
        if [ "$wif" = "${1}" ]; then
            wvarname="$wlan_${1}"
            eval wif_line=$wvarname
            /usr/sbin/iwconfig $wif_line
            /bin/sleep 2
        fi
    done
    varname="$${1}"
    eval new_ifline=$varname
    if [ "$new_ifline" = "dhcp" ]; then
        # remove the .pid file if it exists
        /usr/sbin/dhcpcd -k ${1}
        /bin/sleep 2
        /usr/sbin/dhcpcd $DHCPCD_ARGS ${1}
    else
        /sbin/ifconfig $new_ifline
    fi
    return $?
}

it make my wifi start good, but if i put eth0 too in dhcp it tell an error, that's normal because my eth0 have no problem.......
good luck everybody , bye !!

Offline

Board footer

Powered by FluxBB