🛠️ nmcli

Installation

Ships with NetworkManager (preinstalled where NM manages the network)

Common Commands

CommandDescription
nmcli device (nmcli d)List interfaces + state
nmcli device wifi listScan 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 showList saved connection profiles
nmcli device disconnect <iface>Disconnect an interface
nmcli radio wifi on/offToggle 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 list is 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_supplicant are the lower-level alternatives when NetworkManager isn’t running.
  • Polkit frequently lets users in the netdev / sudo groups drive NetworkManager without a password — check group membership during enumeration.
FileCreated
HTB Machine - LayoverOctober 04, 2026

References: nmcli documentation