How do you handle wifi-configurations?


I use my FreeBSD notebook with wireless connection at many places, therefor I have to configure the wifi-link quite often.

What I do is looking for the best network/accesspoint (ifconfig wpi0 scan), then I make the required settings in wpa_supplicant and start everything with a simple script:

# cat
ifconfig wpi0 up
wpa_supplicant -B -i wpi0 -c/etc/wpa_supplicant.conf
dhclient wpi0

Sometimes I encounter problems with dhclient, the nameservers in /etc/resolv.conf are not correct (deleting /var/db/dhclient.leases.wpi0 helps occasionally).

Most problems occur if there are many accesspoints in a large building (at conferences) and switch between them. Maybe I should kill all dhclient processes on the wireless interface before starting the above script again?!

Other problems I have, "ifconfig wpi0 scan" isn't that accurate (empty lists where definitely networks are) and a "list scan" shows very old informations. Linux/Windows users next to me usually have a lot less problems like that (with same hardware!).

How do you guys handle the wireless configuration? Using /etc/rc.conf isn't really helpful if you need to connect to more than one network.

I use FreeBSD regularly on my laptop, constantly switching between two networks (and sometimes a third). Just using wpa_supplicant from rc.conf works fine for me.