Skip to content

Wireless Networking

pkgdemon edited this page Aug 21, 2026 · 1 revision

Wireless on NextBSD is owned by wland(8), a daemon launchd starts at boot. You drive it with wlan(8), and you do not run wland by hand.

wlan is a pure-C Mach client — it looks up the org.nextbsd.wlan Mach service and issues MIG RPCs. It links neither CoreFoundation nor SystemConfiguration, which makes it the only supported way for anything above the Mach line, including the Gershwin desktop, to drive WLAN.

Joining a network

wlan scan
wlan connect <ssid> <passphrase>
wlan status

That is the whole workflow. A worked example:

# wlan scan
SSID                             BSSID              SIGNAL   CH SECURITY
Home                             a4:2b:b0:11:22:33  ****  -42   6 WPA2
Cafe                             de:ad:be:ef:00:01  **    -71  36 open

# wlan connect Home hunter2hunter2
associating with 'Home' on wlan0...

# wlan status
interface: wlan0
state:     connected
ssid:      Home
bssid:     a4:2b:b0:11:22:33
signal:    -42 dBm
channel:   6
security:  WPA2

Omit the passphrase for an open network. Omit the interface — every command takes an optional trailing one — and wlan acts on the first interface wland owns, which on a single-radio machine is the only one.

Networks are remembered. A successful connect stores the network, so wland autojoins it at the next boot without asking again. disconnect stops the autojoin until you ask for that network again.

Commands

Command Does
wlan list List the WLAN interfaces wland manages
wlan scan [if] Scan and print SSID, BSSID, signal, channel, security
wlan status [if] Current association — state, SSID, BSSID, signal, channel, security
wlan connect <ssid> [passphrase] [if] Associate, and remember the network
wlan disconnect [if] Disassociate and stop autojoining

wlan list is authoritative in a way ifconfig is not: net80211 VAPs go through ether_ifattach and report IFT_ETHER, so media type alone cannot tell wlan0 from em0.

"It says connected but I have no IP"

This is the one thing worth reading before you need it. 802.11 has two moments that look alike and are not:

State Meaning
associated Joined the BSS, net80211 in RUN state — but the port is not yet keyed. The interface reports link UP at this instant, which is exactly why a naive DHCP client fires a DHCPDISCOVER here and has every packet silently dropped.
connected The WPA 4-way handshake finished and the port is keyed. Now traffic flows.

NextBSD does not guess. wland publishes State:/Network/Interface/<if>/AirPort with an Authenticated flag that is true only in the connected state, and ipconfigd holds DHCP until it sees it.

So if wlan status says associated, you have no IP address on purpose — that is the system working correctly. Wait a moment and check again. If it stays at associated, authentication is failing, and that is nearly always a wrong passphrase.

Both connect and scan return as soon as the operation has been requested, not when it completes — holding a Mach reply port open through a full-band sweep or a 4-way handshake would be rude. Watch progress with wlan status.

When something is wrong

Message Means
cannot reach org.nextbsd.wlan wland is not running. Check launchctl list | grep wland and /var/log/wland.stderr.
no WLAN interfaces No 802.11 radio was found, so no VAP was cloned. Check sysctl net.wlan.devices — if empty, the driver did not attach, or on arm64 net80211 is not in the kernel at all.
wpa_supplicant is not reachable The interface exists but its wpa_supplicant died or never started. /var/log/wland.stderr will say why.

The log is at /var/log/wland.stderr and is the first place to look for any of these.

Driver support matters here too: on amd64, Intel wireless arrives as IntelWiFi.kext — see Hardware Support. If kextstat does not show a driver bound to your card, wland has no radio to manage.

Files

Path What
/usr/sbin/wland The daemon
/System/Library/LaunchDaemons/org.nextbsd.wland.plist Its launchd job
/var/log/wland.stderr The log
/Local/Library/Preferences/SystemConfiguration/org.nextbsd.wland.plist Known networks

Passphrases are stored in plaintext in the known-networks plist. It is root-owned, but it is not a keychain. Do not put a passphrase there that you care about elsewhere.

Current limits

  • WPA-Enterprise (802.1X) networks cannot be joined. scan lists them, but connect only knows PSK and open networks.
  • scan may return a short list the first time. It sleeps a fixed interval before reading the cache rather than waiting for a scan-complete event, so a slow radio can under-report. Run it again for fresher results.

See also

Clone this wiki locally