Networking
Turn networking on/off from CLI
Run
nmcli n[etworking] <on>/<off>
as root to turn networking on and off.
Connect to WiFi networks from CLI
All of the following commands require root rights.
List all available WiFi networks with
nmcli d[evice] wifi list ifname <WiFi interface e.g. wlan0>
Connect to a network with
nmcli d[evice] wifi connect '$SSID' --ask
and enter the relevant network password.
If you don't mind having the password in your shell history, you can also use:
nmcli d[evice] wifi connect '$SSID' password '$PASSWORD' ifname <WiFi interface>
Scan the network
- Find the ip address of your own device with
ip addr - Take network part of ip address and pass it to
nmap -sn x.x.x.0/24