|
List Info
Thread: DHCP with wifi (wi0)?
|
|
| DHCP with wifi (wi0)? |

|
2006-12-16 22:45:58 |
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?
Not sure, nothing has worked so far.
Any hints? I've set up DHCP servers and clients, and I've
used wifi on
NetBSD on fixed IP networks. I must be missing something.
Andy
|
|
| DHCP with wifi (wi0)? |

|
2006-12-17 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
|
|
| DHCP with wifi (wi0)? |

|
2006-12-17 18:14:24 |
On 12/17/06, Stephen Borrill <netbsd precedence.co.uk> wrote:
> 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.
It was my own fault, I wasn't using mediaopt adhoc because
I'm not on
a base station.
So far I haven't had the problem you describe, but that
seems like a good idea.
For everyone else reading, I think these basic steps should
be used:
1. Find wireless network (I'm using wiconfig wi0 -D), and
take note of ssid
2. Set up an /etc/ifconfig.wi0 file with as many specifics
for the
network as you have, but no IP related information since we
are using
DHCP. (ifconfig -m wi0 helps too)
3. Set dhclient=YES in /etc/rc.conf
4. Reboot and see if it works.
Thanks.
Andy
|
|
| DHCP with wifi (wi0)? |

|
2006-12-17 21:25:58 |
On Sun, Dec 17, 2006 at 10:11:50AM +0000, Stephen Borrill
wrote:
> 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
Any chance of posting your script on the list? TIA
> 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
The only experience I have is with WindowsXP, and it seems
to take as much
as 30 seconds or more to establish a connection. Sometimes
I start the Web
browser and it fails. It always seems to work after closing
the browser
and restarting it, though. I'm thinking I might have
problems like you
describe.
--
henry nelson
WWW_HOME=http://yuba(dot)ne(dot)jp/(tilde)home
/
|
|
| DHCP with wifi (wi0)? |

|
2006-12-17 22:54:23 |
Hi Andy.
On 2006.12.16 15:45:58 -0700, Andy Ruhl wrote:
> What is the proper way to setup DHCP for a wifi
adapter? I can't find
> documents for this.
If you've done DHCP client configuration previously using
dhclient
then you are pretty much set: the wireless stuff generally
Just
Works. Any of my configuration twiddles are simply to
automate
processes at my various locations like authenticating to the
network
and starting/stopping gaim and the like.
You haven't made it clear what exactly isn't working as you
expected,
so it's a bit difficult to make recommendations. Is your
wireless
card binding to the wrong network (i.e., a different ssid
than you
expected)? Are you getting no signal? Dhclient isn't
latching onto
anything?
If you're having difficulties getting an IP address, I'd
suggest
just invoking dhclient from the command line and carefully
observe
(and post here) what you see. When I was first learning the
wireless
stuff, I frequently did cycles of:
# dhclient -r # release configuration
# dhclient
My /etc/rc.conf has:
dhclient=YES
dhclient_flags="-q -nw"
(-q = quiet, -nw = go daemon immediately) I don't specify
any
interfaces explicitly as I use dhclient for both my wired
ethernet
and wireless adapter. You can also specify the interface
explicitly
in /etc/dhclient.conf.
My /etc/dhclient.conf contains the following, but really
none of
it should be required.
# so my firewall can use a nice identifier
send dhcp-client-identifier "monolith";
# ignore what the server sends: X11 clients can get
messed up
# if the host name changes underneath them
supersede host-name "monolith";
# these might be useless, but they can't hurt
request subnet-mask, broadcast-address, routers,
domain-name, domain-name-servers;
I find it useful for debugging to dump the dhclient
environment
provided by putting the following in
/etc/dhclient-exit-hooks:
set >/var/tmp/dhc-env.$
You can also get much of the same information from
/var/db/dhclient.leases.
It would have helped if you'd included the output from
running the
different commands: `wiconfig wi0 -D', `ifconfig wi0', and
the
contents of /var/db/dhclient.leases.
If your NetBSD machine will be moving around (i.e., a
laptop), then
I'd recommend using wpa_supplicant(8), if your wifi card
supports
it: you can configure multiple networks (= locations) with
different
priorities and it will select the right one from the mix.
The NetBSD wiki has some recipes:
http://wiki.netbsd.se/index.php/How_to_get_connect
ed_using_WPA
Hope this helps somewhat.
Brian.
--
Brian de Alwis | Software Practices Lab | UBC | http://www.cs.ubc.ca/~bsd/
"Amusement to an observing mind is study." -
Benjamin Disraeli
|
|
| DHCP with wifi (wi0)? |

|
2006-12-19 06:19:26 |
On Sun, Dec 17, 2006 at 04:54:23PM -0600, Brian de Alwis
wrote:
> The NetBSD wiki has some recipes:
>
> http://wiki.netbsd.se/index.php/How_to_get_connect
ed_using_WPA
Thank you very much for this! What was really important for
me was:
"WPA support for NetBSD is available since NetBSD
4.0". Now I know I
have to upgrade to 4.0 before I even get started. That
saved days, if
not weeks, of frustration.
> Hope this helps somewhat.
Tremendously.
--
henry nelson
WWW_HOME=http://yuba(dot)ne(dot)jp/(tilde)home
/
|
|
[1-6]
|
|