Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
DHCPCD works with manual start, but not init script [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
odborg
Tux's lil' helper
Tux's lil' helper


Joined: 12 Apr 2002
Posts: 89
Location: Aalborg, Denmark

PostPosted: Wed Feb 21, 2007 10:24 pm    Post subject: DHCPCD works with manual start, but not init script [SOLVED] Reply with quote

Pretty much as the subject says.

It works with gentoo-sources-2.6.18-r6 and the rt61 driver from portage.
It fails with gentoo-sources-2.6.19-r5, and cvs rt61 driver from http://rt2x00.serialmonkey.com (the one in portage does not compile with 2.6.19).

I cannot get a response from my dhcp server unless i start dhcpcd manually:
Code:
/etc/init.d/net.ra0 start
 * Service net.ra0 starting
Info, MAC address = 00:06:f4:0c:ca:f3
Debug, broadcasting DHCP_REQUEST for 192.168.0.10
Debug, timed out waiting for DHCP_ACK response
Debug, broadcasting DHCP_DISCOVER
Error, timed out waiting for a valid DHCP server response                                                                                                                                                                                                      [ !! ]
 * ERROR:  net.ra0 failed to start


Code:
dhcpcd -t 10 -nd ra0
Info, MAC address = 00:06:f4:0c:ca:f3
Debug, broadcasting DHCP_REQUEST for 192.168.0.10
Debug, broadcastAddr option is missing in DHCP server response. Assuming 192.168.0.255
Debug, dhcpIPaddrLeaseTime=4294967295 in DHCP server response.
Debug, dhcpT1value is missing in DHCP server response. Assuming 2147483647 sec
Debug, dhcpT2value is missing in DHCP server response. Assuming 3758096383 sec
Debug, DHCP_ACK received from  (192.168.0.1)
Debug, broadcasting ARPOP_REQUEST for 192.168.0.10
Info, verified 192.168.0.10 address is not in use
Info, your IP address = 192.168.0.10
Debug, orig hostname = gatekeeper


I've been trying to debug this myself, but cannot figure out where in /etc/init.d/net.* dhcpcd is started (I want to compare options passed to dhcpcd).
I've tried with "-t 60" (timeout 60 sec).

EDIT:
Might as well show you /etc/conf.d/wireless (which works when booting 2.6.18 and driver from portage):
Code:
modules=( "iwconfig" )
preferred_aps=( "Nextender" )

config_Nextender=( "dhcp" )
dhcp_Nextender="nodns"
key_Nextender="1122334455 enc open"

#config_ra0=( "192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255" )
iwconfig_ra0="key 1122334455"
essid_ra0="Nextender"
channel_ra0="6"
dhcp_ra0="nontp"
dhcpcd_ra0="-t 10 -dn"


I need help debugging this!!!


Last edited by odborg on Thu Feb 22, 2007 10:57 pm; edited 1 time in total
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Feb 22, 2007 8:46 am    Post subject: Reply with quote

Turn off parallel startup and run it with --verbose so we can see more of what the script is doing.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
odborg
Tux's lil' helper
Tux's lil' helper


Joined: 12 Apr 2002
Posts: 89
Location: Aalborg, Denmark

PostPosted: Thu Feb 22, 2007 10:57 pm    Post subject: Reply with quote

I've managed to get this to work by looking at the configuration of other posts on this forum. The working /etc/conf.d/wireless now looks like (note especially the change in first line 'modules_ra0=( "!iwconfig" )':
Code:
modules_ra0=( "!iwconfig" )
#preferred_aps=( "Nextender" )

#config_Nextender=( "dhcp" )
#dhcp_Nextender="nodns"
#key_Nextender="1122334455 enc open"

#config_ra0=( "192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255" )
config_ra0=( "dhcp" )

#iwconfig_ra0="key 1122334455"
#essid_ra0="Nextender"
#channel_ra0="6"

dhcp_ra0="nontp nodns"
dhcpcd_ra0="-t 10"

The new driver must be using information from /etc/Wireless/RT61STA/rt61sta.dat (which hasn't been changed, was also there during kernel-2.6.18 and rt61 driver from portage)

Just in case you would still like to see the ouput during failure:

Code:
RC_PARALLEL_STARTUP="no" /etc/init.d/net.ra0 start --verbose
 * Service net.ra0 starting
 * Starting ra0
 *   Loading networking modules for ra0
 *     modules: apipa arping ccwgroup tuntap macchanger macnet rename iwconfig essidnet iptunnel iproute2 system dhcpcd ip6to4
 *       iwconfig provides wireless
 *       iproute2 provides interface
 *       dhcpcd provides dhcp
 *   Configuring ra0 for MAC address 00:06:F4:0C:CA:F3 ...                                                                                                          [ ok ]
 *   Configuring wireless network for ra0
 *   Connecting to "Nextender" in managed mode (WEP enabled) ...                                                                                                    [ ok ]
 *     ra0 connected to ESSID "Nextender"
 *     in managed mode on channel 6 (WEP enabled)
 *   Configuring ra0 for ESSID "Nextender" ...                                                                                                                      [ ok ]
 *   Bringing up ra0
 *     dhcp
 *       Running dhcpcd ...
Error, timed out waiting for a valid DHCP server response                                                                                                           [ !! ]
 * ERROR:  net.ra0 failed to start


And with the modified /etc/conf.d/wireless:
Code:
RC_PARALLEL_STARTUP="no" /etc/init.d/net.ra0 start --verbose
 * Service net.ra0 starting
 * Starting ra0
 *   Loading networking modules for ra0
 *     modules: apipa arping ccwgroup essidnet iptunnel tuntap macchanger macnet rename iproute2 system dhcpcd ip6to4
 *       iproute2 provides interface
 *       dhcpcd provides dhcp
 *   Configuring ra0 for ESSID "Nextender" ...                                                                                                                      [ ok ]
 *   Configuring ra0 for MAC address 00:06:F4:0C:CA:F3 ...                                                                                                          [ ok ]
 *   Bringing up ra0
 *     dhcp
 *       Running dhcpcd ...                                                                                                                                         [ ok ]
 *       ra0 received address 192.168.0.10/24
 * Service net.ra0 started


I also captured dhcp udp dackages with wireshark. Only difference except the dhcp request nr, was in a field specified as reserved 0h00 0h00(when working) vs 0h80 0h00(when not).
According to my router log, the router never recieved the dhcp request when i tried to use /etc/init.d/net.ra0 with 'modules_ra0=( "iwconfig" )'.

Thanks for your help, I've noticed that you often help gentoo users on the forum.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri Feb 23, 2007 9:01 am    Post subject: Reply with quote

Care to email me those traces so I can see where it's going wrong?

But the answer is that the enc type is probably wrong. You're specifying open where I think it should be restricted.
(I had a user with the exact same issue on IRC last week)
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum