nmcli Cheat Sheet¶
Commands for managing network interfaces and Wi-Fi connections via nmcli.
nmcli (NetworkManager Command Line Interface) is a command-line tool for controlling NetworkManager and reporting network status.
General Information¶
Show help for nmcli:
Show overall network status:
Get/Set logging level:
Device Management¶
List all network devices:
Show status of all devices:
Show detailed information for a device:
Connect a device:
Disconnect a device:
Connection Management¶
List all connections:
List only active connections:
Show details of a connection:
Activate a connection:
Deactivate a connection:
Delete a connection profile:
Modify a connection setting:
Practical Examples¶
Wi-Fi¶
-
Scan for Wi-Fi networks:
nmcli device wifi list -
Connect to a Wi-Fi network:
nmcli device wifi connect "SSID_NAME" password "YOUR_PASSWORD"
Ethernet/IP Configuration¶
- Set static IP address:
nmcli connection modify "Wired connection 1" ipv4.addresses 192.168.1.100/24
nmcli connection modify "Wired connection 1" ipv4.gateway 192.168.1.1
nmcli connection modify "Wired connection 1" ipv4.dns 8.8.8.8
nmcli connection modify "Wired connection 1" ipv4.method manual
nmcli connection up "Wired connection 1"