nmcliwhere OBJECT can be one ofOPTIONS
OBJECT {COMMAND
| help }
general
, networking
, radio
, connection
, or device
. The most used options are: -t, --terse
for use in scripts, the -p, --pretty
option for users, and the -h, --help
option. Command completion has been implemented for nmcli, so remember to press Tab when ever you are unsure of the command options available. See the nmcli(1)
man page for a complete list of the options and commands.
~]$ nmcli help
Usage: nmcli [OPTIONS] OBJECT { COMMAND | help }
OPTIONS
-t[erse] terse output
-p[retty] pretty output
-m[ode] tabular|multiline output mode
-f[ields] <field1,field2,...>|all|common specify fields to output
-e[scape] yes|no escape columns separators in values
-n[ocheck] don't check nmcli and NetworkManager versions
-a[sk] ask for missing parameters
-w[ait] <seconds> set timeout waiting for finishing operations
-v[ersion] show program version
-h[elp] print this help
OBJECT
g[eneral] NetworkManager's general status and operations
n[etworking] overall networking control
r[adio] NetworkManager radio switches
c[onnection] NetworkManager's connections
d[evice] devices managed by NetworkManager
~]$ nmcli general help
Usage: nmcli general { COMMAND | help }
COMMAND := { status | permissions | logging }
status
permissions
logging [level <log level>] [domains <log domains>]
In the second example above the help is related to the object general
.
nmcli-examples(5)
man page has many useful examples. A brief selection is shown here:
nmcli general statusTo control NetworkManager logging:
nmcli general loggingTo show all connections:
nmcli connection showTo show only currently active connections, add the
-a, --active
option as follows: nmcli connection show --activeTo show devices recognized by NetworkManager and their state:
nmcli device status
nmcli connection modify id 'MyCafe' 802-11-wireless.mtu 1350Can be reduced to the following command:
nmcli con mod MyCafe 802-11-wireless.mtu 1350The
id
option can been omitted because the connection ID (name) is unambiguous for nmcli in this case. As you become familiar with the commands, further abbreviations can be made. For example: nmcli connection add type ethernetcan be reduced to:
nmcli c a type eth
Note
nmcli con up id bond0 nmcli con up id port0 nmcli dev disconnect iface bond0 nmcli dev disconnect iface eth0
Note
nmcli dev disconnect iface iface-name
rather than nmcli con down id id-string
because disconnection places the interface into a “manual” mode, in which no automatic connection will be started until the user tells NetworkManager to start a connection or until an external event like a carrier change, hibernate, or sleep, occurs.
~]$ nmcli con edit
You will be prompted to enter a valid connection type from the list displayed. After entering a connection type you will be placed at the nmcli prompt. If you are familiar with the connection types you can add a valid connection type
option to the nmcli con edit
command and be taken straight to the nmcli prompt. The format is as follows for editing an existing connection profile: nmcli con edit [id | uuid | path] IDFor adding and editing a new connection profile, the following format applies:
nmcli con edit [type new-connection-type] [con-name new-connection-name]
help
at the nmcli prompt to see a list of valid commands. Use the describe
command to get a description of settings and their properties. The format is as follows: describe setting.propertyFor example:
nmcli> describe team.config
type
— The connection type.adsl
, bond
, bond-slave
, bridge
, bridge-slave
, bluetooth
, cdma
, ethernet
, gsm
, infiniband
, olpc-mesh
, team
, team-slave
, vlan
, wifi
, wimax
.
TYPE_SPECIFIC_OPTIONS
list in the nmcli(1)
man page. The type
option is applicable after the following: nmcli connection add
and nmcli connection edit
.
con-name
— The name assigned to a connection profile. type
-ifname[-number]
id
option also refers to the connection profile name.
id
— An identification string assigned by the user to a connection profile.nmcli connection
commands to identify a connection. The NAME field in the output always denotes the connection ID (name). It refers to the same connection profile name that the con-name
does.
uuid
— A unique identification string assigned by the system to a connection profile.nmcli connection
commands to identify a connection.