with apologies

`nmcli` connection to internal WiFi

Richard Mortier · February 14, 2025 · #tech #cambridge #linux

Using my fancy (?) new(-ish) Linux laptop running NixOS, I finally had cause to connect to our internal Wi-Fi network. This was not entirely trivial due to the various configuration options required. So here goes, for the record, what I did as an aide memoir for me and in case it’s useful for anyone else…

First, create the connection – the Wi-Fi network in question is named Internal-CL:

$ sudo nmcli connection add type wifi con-name Internal-CL ssid Internal-CL
Connection 'Internal-CL' (8f1ddcc9-4b1f-4e5d-9992-522714685eb4) successfully added.

Then, configure it:

$ sudo nmcli connection edit Internal-CL

===| nmcli interactive connection editor |===

Editing existing '802-11-wireless' connection: 'Internal-CL'

Type 'help' or '?' for available commands.
Type 'print' to show all the connection properties.
Type 'describe [<setting>.<prop>]' for detailed property description.

You may edit the following settings: connection, 802-11-wireless (wifi), 802-11-wireless-security (wifi-sec), 802-1x, ethtool, match, ipv4, ipv6, hostname, link, tc, proxy
nmcli> set 802-1x.eap peap
nmcli> set 802-1x.phase2-auth mschapv2
nmcli> set 802-1x.identity YOUR-IDENTITY
nmcli> set 802-1x.password YOUR-PASSWORD
nmcli> set wifi-sec.key-mgmt wpa-eap
nmcli> save
Connection 'Internal-CL' (8f1ddcc9-4b1f-4e5d-9992-522714685eb4) successfully updated.
nmcli> activate
Monitoring connection activation (press any key to continue)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/12)

nmcli> quit

Obviously you will need to provide your own values for YOUR-IDENTITY and YOUR-PASSWORD :)