Can't get DHCP to work on boot

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
superjet
Posts: 6
Joined: Thu 07 Jul 2005, 16:36

Can't get DHCP to work on boot

#1 Post by superjet »

Hello there fellow Puppy users.
I have an older machine I am giving to a friend for his 3 year old son.
Puppy seems to be the perfect OS for the kid (And maybe the family if they use it and fall in love with it as I have!)
I have a DWL-G510 Dlink wireless card in the machine. Through this forum, I have gotten the card to run up to the point of running DHCP.
If I go to the wireless setup wizard and touch "Toggle DHCP", it catches an IP address and all goes well.
I would really like this to be seamless for the little tyke and I am at the end of my rope trying to get it to work.
Here is my /etc/rc.d/rc.local file:
modprobe ndiswrapper sleep 5
iwconfig wlan0 essid "wireless"
dhcpcd wlan0

Can anyone give me some direction here please?

Thanks!
Jamie

OK Update.
I rebooted the machine with the same results.
From a prompt, I rand dhcpcd wlan0 and got :
"DHCP is already running"
" dhcpcd: if not then delete /etc/dhcpc/dhcpcd-wlan0.pid file"

So I go back to WAG, touch "DHCP toggle" and everything works as it should.

What magic does DHCP toggle posess?
Last edited by superjet on Fri 07 Oct 2005, 18:11, edited 2 times in total.

keenerd
Posts: 176
Joined: Sat 20 Aug 2005, 19:24

#2 Post by keenerd »

The DHCP Toggle command has two parts, one to turn on dhcpcd, the other to turn it off. I'm going to guess that dhcpcd is off before you press Toggle.

This is the chunk of code it runs:

Code: Select all

  rm /etc/dhcpc/dhcpcd-${WLAN}.*
  dhcpcd $WLAN 
Of course, typing that in at the prompt will do nothing. $WLAN is a variable.

Try this:

Code: Select all

  rm /etc/dhcpc/dhcpcd-wlan0.*
  dhcpcd wlan0 
Oh, in your rc.local, make sure "modprobe ndiswrapper" and "sleep 5" are on two seperate lines.

On other disclaimer - WAG does a lot of thing to make get your wireless working automatically. There is a good chance the magic command is something else entirely.

Maybe this will work?

Code: Select all

  ifconfig wlan0 192.168.0.3
  rm /etc/dhcpc/dhcpcd-wlan0.*
  dhcpcd wlan0 
The exact IP address used doesn't really matter. I find that giving wlan0 an IP address usually enables the card. It doesn't matter if the IP is no good. It will be replaced after dhcpcd runs.

superjet
Posts: 6
Joined: Thu 07 Jul 2005, 16:36

#3 Post by superjet »

Thanks for the quick reply!
Well, I moved the sleep 5 to it's own line and that did it.
Works like a charm.

I did add the static IP and then the next line to remove it.
That worked....every other reboot. The reboots that would not work would throw an error saying something about the file being too big.

Thanks for the help!

superjet
Posts: 6
Joined: Thu 07 Jul 2005, 16:36

#4 Post by superjet »

Ummm, yes. Well you see, I had a network cable plugged into the Ethernet port so my access was actually wired not wireless. (Embarrasment)
So, back to the drawingboard.
I have tried the scripts as you advised and I can't get the DHCP to boot straight away.
Anyone else have any suggestions?

superjet
Posts: 6
Joined: Thu 07 Jul 2005, 16:36

#5 Post by superjet »

OK. So persistance paid off.
The script ended up needing to be:

modprobe ndiswrapper
sleep 5
iwconfig wlan0 essid "wireless"
sleep 5
dhcpcd wlan0

Glad to have it working, thanks for the nudge down the right path!
Best regards,
Jamie

Post Reply