nmcli notes This note was created on 2024-04-02 This note was last edited on 2024-04-02 === Usage === Check if NetworkManager is running and there's a connection to Internet: $ nmcli general List all interfaces and their status: $ nmcli -f general List all the available devices: $ nmcli device status List all the available connections $ nmcli connection show List interface configuration: $ nmcli connection show Show active connections: $ nmcli connection show --active Activate a connection: $ nmcli connection up Deactivate connection $ nmcli connection down Delete connection # nmcli connection delete Reload connection: # nmcli connection reload Interactively edit or add a connection: # nmcli connection edit > print ipv4.address > remove ipv4.address "192.168.10.2/24" > set ipv4.address 192.168.10.10/24 > print ipv4.address > verify > quit Enable of disable autoconnect: # nmcli connection modify connection.autoconnect no Get DNS server for a connection: $ nmcli -g ipv4.dns connection show Set DNS server for a connection: # nmcli connection modify ipv4.dns 9.9.9.9 Import WireGuard connection profile: # nmcli connection import type wireguard file "/path/to/wg0.conf" Set name for imported WireGuard connection profile named "wg0.conf": # nmcli connection modify wg0 connection.id Import OpenVPN connection profile: # nmcli connection import type openvpn file /path/to/your/config.ovpn Get current hostname $ nmcli general hostname Update hostname # nmcli general hostname