How can I configure OpenBSD to automatically use one of many Wi-Fi SSIDs?

0

In OpenBSD 6.0, with (for example) the iwn(4) driver, I can automatically associate with an SSID and bring up the interface with DHCP by using the following /etc/hostname.iwn0:

nwid SSID
wpakey secretkey
dhcp

How can I configure my system so that it automatically uses one of several configured SSIDs depending on which one is in range?

zigg

Posted 2016-09-06T20:45:47.223

Reputation: 362

Answers

1

OpenBSD has got a package named wpa_supplicant. It comes with an example configuration that is documented thoroughly and has reasonable defaults (see in directory /usr/local/share/examples/wpa_supplicant after installation of the package).

All you need to do is to insert a few network blocks describing your access points. They look like this:

network={
    ssid="simple"
    psk="very secret passphrase"
    priority=5
}

It is also advisable to look how to restrict ciphers (e.g. to use only WPA2). There are dozens of examples listed here.

wpa_supplicant runs as a daemon after you start it with:

wpa_supplicant -i wirelessinterface -c /path/to/wpa_supplicant.conf

Martin Sugioarto

Posted 2016-09-06T20:45:47.223

Reputation: 359