nmcli | Cheatsheet
Ask networkmanager about online status
Get General status
Listing NetworkManager polkit permissions
nmcli general permissions
Print info line by line
List all the available device
Show info about connections
Import wireguard config to nmcli
nmcli connection import type wireguard file "/path/to/wg0.conf"
Show devices
Show the Network Manager status of all network interfaces
List all connection
List the current settings for the connection name
Check if NetworkManager is running
nmcli -t -f RUNNING general
List all the configuration of interface
Change hostname using nmcli
Delete setup
Delete Setup
nmcli con del "Wired connection 1"
Reload connection using nmcli (restart)
Set Wifi down
nmcli connection down id Wifi
Set Wifi up
nmcli connection up id Wifi
Set Modem down
nmcli connection down id MODEM
Set Modem up
nmcli connection up id MODEM
Set Ethernet down
nmcli connection down id Wired
Set Ethernet up
nmcli connection up id Wired
Listing available Wi-Fi APs
Connect to a password-protected wifi network
SSID="ssid"
PASSWORD="WPA3-PASS"
nmcli device wifi connect "$SSID" password "$PASSWORD"
Connect to a password-protected wifi network and get asked for password
SSID="ssid"
nmcli --ask device wifi connect "$SSID"
nmcli -p -f general,wifi-properties device show wlan0
Add wifi-hotspot helpo
Create wifi-hotspot
nmcli dev \
wifi hotspot \
ifname wlp2s0 \
con-name wuseman \
ssid SSID-wuseman \
password "SSID-wuseman-password"
Show wifi password
nmcli dev wifi show-password
Set vpn connection up
nmcli --ask con up my-vpn-con
Set DNS
nmcli con mod <connectionName> ipv4.dns "8.8.8.8 8.8.4.4"
Ignore autodns
nmcli con mod <connectionName> ipv4.ignore-auto-dns yes
Show active connections
nmcli -g name,type connection show --active|awk -F: '/ethernet|wireless/ { print $1 }'