Connect to a new WiFi Hotspot
Show SSIDs
nmcli d wifi list
Connect to the
WiFi hotspot/SSID. The following command prompts the user to enter the password in a dialog:
nmcli d wifi connect <ssid>
The password can also be stated non-interactively (note the keyword password
):
nmcli d wifi connect <ssid> password <password>
Open a hotspot
In order to create a hotspot, the wifi adapter should support AP (=access point) mode.
If this is the case can be verified with
sudo iw list | grep -A 10 'Supported interface modes'
Create the hotspot (unfortunately, I was unable to connect to the hotspot created with the following command):
sudo nmcli device wifi hotspot con-name tq84-hotspot ssid tq84-ssid band bg password tq84-password
Show the hotspots' password (both as ASCII text and as QR code):
nmcli dev wifi show-password
Remove the hotspot:
sudo nmcli connection delete tq84-hotspot
Trying to create a hotspot like outlined in
this stackexchange answer seemed to have more success (after I modified the
802-11-wireless-security.pmf
parameter to
1
).
Find the device name (in my case wlp111s0
):
nmcli device
Then set up the hotspot:
# sudo nmcli connection add type wifi ifname wlp111s0 con-name tq84-hotspot autoconnect no ssid tq84-ssid
sudo nmcli connection add type wifi ifname wlp111s0 con-name tq84-hotspot autoconnect yes ssid tq84-ssid
sudo nmcli connection modify tq84-hotspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
sudo nmcli connection modify tq84-hotspot wifi-sec.key-mgmt wpa-psk
sudo nmcli connection modify tq84-hotspot wifi-sec.psk tq84password
sudo nmcli connection modify tq84-hotspot 802-11-wireless-security.pmf 1
sudo nmcli connection up tq84-hotspot