WIFI configuration guide under Linux terminal
Install the dependency (if nmcli
is not already available in your system):
sudo apt install network-manager
List connections:
nmcli con show
Check interface status:
nmcli device status
Check if WIFI is enabled:
nmcli radio wifi
Enable WIFI:
nmcli radio wifi on
Scan for WIFI:
sudo nmcli device wifi rescan
List available WIFI:
nmcli device wifi list
Connect to specified network, require nmcli
to prompt you for password (which avoids writing out your password on screen). Assuming that the SSID of the network is hotspot
and the interface is wlan0
:
sudo nmcli --ask device wifi connect hotspot ifname wlan0
Optional configurations
Automatically connect to the WIFI at startup
Set the connection to auto-connect:
sudo nmcli connection modify "hotspot" connection.autoconnect yes
Set the connection to be available to all users:
sudo nmcli connection modify "hotspot" connection.permissions ""
Check the details of a connection
nmcli connection show "hotspot"
Delete a connection profile
sudo nmcli connection delete "hotspot"
References
https://www.makeuseof.com/connect-to-wifi-with-nmcli/
ChatGPT