Subject: Re: DHCP with wifi (wi0)?
To: Andy Ruhl <acruhl@gmail.com>
From: Stephen Borrill <netbsd@precedence.co.uk>
List: netbsd-help
Date: 12/17/2006 10:11:50
On Sat, 16 Dec 2006, Andy Ruhl wrote:
> I asked this in a roundabout way before, but I'll shorten it and ask again:
>
> What is the proper way to setup DHCP for a wifi adapter? I can't find
> documents for this.
>
>> From what I gather, I can't just use this line in rc.conf, because it
> hasn't worked yet:
>
> dhclient=YES dhclient_flags="wi0"
>
> I'm guessing I need to do some sort of minimal wifi network setup first?
>
> For instance, I do this:
>
> wiconfig wi0 -D
>
> I get some wireless network, let's say it's wide open for now so
> authentication isn't a problem.
>
> So then I think I set up an /etc/ifconfig.wi0 file with just this:
>
> ssid "ssid name"
>
> Then try getting an IP via dhcp by restarting dhclient?
Well, it all sound about right. My first thought was ordering between the
network and dhclient script, but network comes first so should set the
ssid. I should point out that in our product, we've written our own
network script from scratch. What we found was that when you set the ssid
or nwkey, the network isn't active immediately (you may even want an up in
your ifconfig.wi0 file) and so dhclient would often fail. So we set up
ssid and nwkey, sleep for a while, check ifconfig for status: active, if
not present ifconfig down and up and then go back to the sleep. We repeat
5 times before giving up. I've found this works flawlessly.
--
Stephen