Configuring multiple wifi access

Hello,

I just installed FreeBSD on my laptop, and I have a problem I can't seem to solve with my wifi card.

I use the laptop at home as well as in my office, and obviously I'd like it to connect automatically to the appropriate network. However, my office uses DHCP with WPA-PSK, while at home I'm using static IP with WEP. So far I could configure both, but they're exclusive - I have to manually comment out one of them in rc.conf to use the other one.

Is there any way to configure the network so it can switch automatically?

Thanks in advance!
 
If you have gnome installed, I believe you can use its (user level) network manager. You would have to comment out your "ifconfig_*" lines from /etc/rc.conf so it doesn't get angry.

I believe it's /usr/local/bin/nm-applet (I'm doing this from memory: I don't have gnome on my freebsd machine and my Lady's unbunutu netbook is with her at the moment).

I would suppose that KDE has a similar functionality, & there may even be some stand-alone applications that do user-level [wireless] networking.
 
Actually, I think the gnome network manager is one of those utilities that has never been ported to FreeBSD (any takers?).

You might try net/pcbsd-netmanager.

Otherwise just enable WPA at home too (which you should be using anyway), and wpa_supplicant will auto connect to it when you start your wlan. Then just the static ip issue you need to sort out. ;)
 
aragon said:
Actually, I think the gnome network manager is one of those utilities that has never been ported to FreeBSD (any takers?).

You might try net/pcbsd-netmanager.

Otherwise just enable WPA at home too (which you should be using anyway), and wpa_supplicant will auto connect to it when you start your wlan. Then just the static ip issue you need to sort out. ;)

I think that wpa_supplicant will work fine with empty passphrases*. But, yeah, unless you're +500M from the nearest untrusted human & you have good security camers, you should most certainly be using something to secure your home network.


* from my /etc/wpa_supplicant.conf
(in part)
Code:
network={
   ssid="linksys"
   key_mgmt=NONE
}
 
Dinchamion said:
However, my office uses DHCP with WPA-PSK, while at home I'm using static IP with WEP. So far I could configure both, but they're exclusive - I have to manually comment out one of them in rc.conf to use the other one.

Is there any way to configure the network so it can switch automatically?

Automatic switching between multiple WiFi networks depending upon availability can easily be achieved, by defining a separate network block for each of the networks in your /etc/wpa_supplicant.conf file. Optionally you may assign a priority value to each network block, in order to define precedence, if multiple networks are available simultaneously.

You should consult wpa_supplicant.conf(5) for a detailed explanation of the syntax of this file, and some examples.

To use wpa_supplicant, your interface definition in /etc/rc.conf would look like:
Code:
ifconfig_XX="WPA DHCP"

The only problem I see here is that you are using a static IP at home, meaning there is no DHCP server to assign an address. Perhaps it would be possible, to tweak this using the dhclient.conf file. Or you setup a DHCP server in your home network.
 
Might it be possible to use an alias for such a scenario?
e.g.
Code:
defaultrouter="192.168.0.1"
ifconfig_wlan0="WPA DHCP"
ifconfig_wlan0_alias0="inet 192.168.0.2 netmask 255.255.255.0

I'm not sure whether DHCP handles default route correctly, worth a try anyway.
 
Thanks for the suggestions!

I don't want to set up DHCP at home, it's just another security hole in my opinion, and I don't have control over what goes on in the office.

On linux I use 'fallback': if the primary (home) network is not available, it falls back to the office one. Is this a viable option in BSD?
 
Back
Top