LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

nmcli-connection

manages NetworkManager connection profiles

TLDR

List all NetworkManager connections
$ nmcli connection
copy
Activate a connection
$ nmcli connection up uuid
copy
Deactivate a connection
$ nmcli connection down uuid
copy
Create an auto-configured connection
$ nmcli connection add ifname eth0 type ethernet ipv4.method auto ipv6.method auto
copy
Create a static IPv4 connection
$ nmcli connection add ifname eth0 type ethernet ip4 10.0.0.7/8 gw4 10.0.0.1 ipv4.dns 10.0.0.1
copy
Create a static IPv6 connection
$ nmcli connection add ifname eth0 type ethernet ip6 2001:db8::2/64 gw6 2001:db8::1
copy
Import a VPN connection from file
$ nmcli connection import type openvpn file vpn_config.ovpn
copy

SYNOPSIS

nmcli connection {show|up|down|add|edit|modify|clone|delete|monitor|reload|load|migrate|import|export} [ARGUMENTS]

DESCRIPTION

nmcli connection manages NetworkManager connection profiles. It can list, activate, deactivate, create, modify, and delete network connection configurations including Ethernet, Wi-Fi, VPN, and other connection types.

COMMANDS

show [id]

List connections or show details of a specific connection
up id|uuid
Activate a connection
down id|uuid
Deactivate a connection
add
Create a new connection profile
edit [id|uuid]
Launch the interactive connection editor
modify id|uuid
Change connection properties. Property values support `+`/`-` prefixes to append or remove list items
clone id|uuid NEW_NAME
Duplicate an existing profile under a new name
delete id|uuid
Remove a connection profile
monitor [id|uuid]
Watch activity changes for all or a specific profile in real time
reload
Reload all connection files from disk
load filename
Load a single connection file on disk into NetworkManager
migrate
Migrate profiles from legacy keyfile/ifcfg locations into the default store
import type TYPE file FILE
Import an external connection (e.g., VPN)
export id
Export a connection profile

COMMON ADD OPTIONS

ifname: Interface name to bind the connectiontype: Connection type (ethernet, wifi, vpn, bridge, etc.)con-name: Custom connection nameip4: IPv4 address with prefixgw4: IPv4 gateway addressip6: IPv6 address with prefixgw6: IPv6 gateway addressipv4.method: auto, manual, or disabledipv6.method: auto, manual, or ignoreipv4.dns: DNS server addresses

COMMON GLOBAL OPTIONS

--ask

Interactively prompt for any required but missing argument. Not suitable for scripts.
--wait seconds
Override the default timeout when waiting on an operation such as up.
--active
On show, list only currently active connections.
--offline
Edit connection files without going through the running NetworkManager daemon.
--temporary
On modify, keep the change in memory only — discarded at daemon restart.

CAVEATS

Connection names with spaces require quoting. Use UUIDs when multiple connections share the same name. Changes made with modify take effect on the next activation unless --temporary is used.

HISTORY

Part of the nmcli command-line interface for NetworkManager. Provides scriptable network configuration management.

SEE ALSO

nmcli(1), nmcli(1), nmtui(1)

Copied to clipboard
Kai