🛠️ nmcli
Installation
Ships with NetworkManager (preinstalled where NM manages the network)
Common Commands
| Command | Description |
|---|---|
nmcli device (nmcli d) | List interfaces + state |
nmcli device wifi list | Scan for nearby APs (SSID, channel, security) |
nmcli device wifi connect <SSID> | Join an open network |
nmcli device wifi connect <SSID> password <pw> | Join a WPA network |
nmcli connection show | List saved connection profiles |
nmcli device disconnect <iface> | Disconnect an interface |
nmcli radio wifi on/off | Toggle the WiFi radio |
Reusable Commands
# --- discover networks (SSID / channel / security) ---
nmcli device wifi list
# SECURITY column "--" = OPEN network (unencrypted -> sniffable)
# --- join an OPEN network and get an IP ---
nmcli device wifi connect "HTB International WiFi"
ip -4 addr show <iface> # confirm the DHCP lease
# --- join a WPA2 network on a chosen interface ---
nmcli device wifi connect "<SSID>" password '<psk>' ifname wlan0
# --- pick WHICH radio associates (keep another free for monitor mode) ---
nmcli device wifi connect "<SSID>" ifname wlan0 # wlan0 joins; wlan1 stays for airmon-ng
# --- inspect / tear down ---
nmcli -f GENERAL,IP4 device show <iface>
nmcli device disconnect <iface>Tips & Tricks
nmcli device wifi listis the fastest way to spot an open network (the--under SECURITY) — the cue to sniff it. See Open WiFi Traffic Sniffing.- Associating gives L3 access (an IP) to interact with hosts; that’s separate from monitor-mode sniffing. Use one radio to connect and a second to capture.
iw/wpa_supplicantare the lower-level alternatives when NetworkManager isn’t running.- Polkit frequently lets users in the
netdev/sudogroups drive NetworkManager without a password — check group membership during enumeration.
Related Usage
| File | Created |
|---|---|
| HTB Machine - Layover | October 04, 2026 |
References: nmcli documentation