nmcli: NetworkManager Reference Manual (original) (raw)

show [--active] [--order [+-]category:... ]

List in-memory and on-disk connection profiles, some of which may also be active if a device is using that connection profile. Without a parameter, all profiles are listed. When --active option is specified, only the active profiles are shown.

The --order option can be used to get custom ordering of connections. The connections can be ordered by active status (active), name (name), type (type) or D-Bus path (path). If connections are equal according to a sort order category, an additional category can be specified. The default sorting order is equivalent to--order activeđź“›path. + or no prefix means sorting in ascending order (alphabetically or in numbers),- means reverse (descending) order. The category names can be abbreviated (e.g. --order -a:na).

show [--active] [ id | uuid | path | apath ]ID...

Show details for specified connections. By default, both static configuration and active connection data are displayed. When--active option is specified, only the active profiles are taken into account. Use global --show-secrets option to display secrets associated with the profile.

id, uuid,path and apath keywords can be used if ID is ambiguous. Optional_ID_-specifying keywords are:

id the ID denotes a connection name.
uuid the ID denotes a connection UUID.
path the ID denotes a D-Bus static connection path in the format of /org/freedesktop/NetworkManager/Settings/num or just num.
apath the ID denotes a D-Bus active connection path in the format of /org/freedesktop/NetworkManager/ActiveConnection/num or just_num_.

It is possible to filter the output using the global--fields option. Use the following values:

profile only shows static profile configuration.
active only shows active connection data (when the profile is active).

You can also specify particular fields. For static configuration, use setting and property names as described innm-settings-nmcli(5) manual page. For active data use GENERAL, IP4, DHCP4, IP6, DHCP6, VPN.

When no command is given to the nmcli connection, the default action is nmcli connection show.

up [ id | uuid | path ]ID [ifname _ifname_] [ap _BSSID_] [passwd-file _file_]

Activate a connection. The connection is identified by its name, UUID or D-Bus path. If ID is ambiguous, a keyword id,uuid or path can be used. When requiring a particular device to activate the connection on, theifname option with interface name should be given. If the_ID_ is not given an ifname is required, and NetworkManager will activate the best available connection for the givenifname. In case of a VPN connection, theifname option specifies the device of the base connection. The ap option specify what particular AP should be used in case of a Wi-Fi connection.

If --wait option is not specified, the default timeout will be 90 seconds.

See connection show above for the description of the_ID_-specifying keywords.

Available options are:

ifname interface that will be used for activation.
ap BSSID of the AP which the command should connect to (for Wi-Fi connections).
passwd-file some networks may require credentials during activation. You can give these credentials using this option. Each line of the file should contain one password in the form: setting_name.property_name:the password For example, for WPA Wi-Fi with PSK, the line would be 802-11-wireless-security.psk:secret12345 For 802.1X password, the line would be 802-1x.password:my 1X password nmcli also accepts wifi-sec and wifi strings instead of802-11-wireless-security. When NetworkManager requires a password and it is not given, nmcli will ask for it when run with --ask. If --ask was not passed, NetworkManager can ask another secret agent that may be running (typically a GUI secret agent, such as nm-applet or gnome-shell).

down [ id | uuid | path | apath ]ID...

Deactivate a connection from a device without preventing the device from further auto-activation. Multiple connections can be passed to the command.

Be aware that this command deactivates the specified active connection, but the device on which the connection was active, is still ready to connect and will perform auto-activation by looking for a suitable connection that has the 'autoconnect' flag set. Note that the deactivating connection profile is internally blocked from autoconnecting again. Hence it will not autoconnect until reboot or until the user performs an action that unblocks autoconnect, like modifying the profile or explicitly activating it.

In most cases you may want to use device down command instead.

The connection is identified by its name, UUID or D-Bus path. If_ID_ is ambiguous, a keyword id,uuid, path orapath can be used.

See connection show above for the description of the _ID_-specifying keywords.

If --wait option is not specified, the default timeout will be 10 seconds.

modify [--temporary] [ id | uuid | path ] [ID] { option value | [+|-]setting.property value } ...

Add, modify or remove properties in the connection profile.

To set the property just specify the property name followed by the value. An empty value ("") resets the property value to the default.

See nm-settings-nmcli(5) for complete reference of setting and property names, their descriptions and default values. The setting and_property_ can be abbreviated provided they are unique.

If you want to append an item or a flag to the existing value, use+ prefix for the property name or alias. If you want to remove items from a container-type or flag property, use - prefix. For certain properties you can also remove elements by specifying the zero-based index(es). The + and - modifiers only have a real effect for properties that support them. These are for example multi-value (container) properties or flags like ipv4.dns,ip4, ipv4.addresses, bond.options,802-1x.phase1-auth-flags etc.

The connection is identified by its name, UUID or D-Bus path. If_ID_ is ambiguous, a keyword id,uuid or path can be used. The ID is not used with the global--offline option.

When the global --offline is used, the command reads the connection from the standard input and prints the modified connection to standard output instead of making the the NetworkManager daemon act upon specified connection.

modify [--temporary] [ id | uuid | path ]ID remove setting

Removes a setting from the connection profile.

add [save { yes | no }] { option value | [+|-]setting.property value } ...

Create a new connection using specified properties.

You need to describe the newly created connections with the property and value pairs. See nm-settings-nmcli(5) for the complete reference. The syntax is the same as of the nmcli connection modify command.

To construct a meaningful connection you at the very least need to set theconnection.type property (or use the type alias) to one of known NetworkManager connection types:

The most typical uses are described in the Examples section.

Aside from the properties and values two special options are accepted:

save Controls whether the connection should be persistent, i.e. NetworkManager should store it on disk (default: yes).
-- If a single -- argument is encountered it is ignored. This is for compatibility with older versions on nmcli.

When the global --offline is used, the command prints the resulting connection to standard output instead of actually adding the connection via the NetworkManager daemon.

edit { [ id | uuid | path ]ID | [type _type_] [con-name _name_] }

Edit an existing connection or add a new one, using an interactive editor.

The existing connection is identified by its name, UUID or D-Bus path. If_ID_ is ambiguous, a keyword id,uuid, or path can be used. Seeconnection show above for the description of the_ID-specifying keywords. Not providing anID_ means that a new connection will be added.

The interactive editor will guide you through the connection editing and allow you to change connection parameters according to your needs by means of a simple menu-driven interface. The editor indicates what settings and properties can be modified and provides in-line help.

Available options:

type type of the new connection; valid types are the same as forconnection add command.
con-name name for the new connection. It can be changed later in the editor.

See alsonm-settings-nmcli(5) for all NetworkManager settings and property names, and their descriptions; andnmcli-examples(7) for sample editor sessions.

clone [--temporary] [ id | uuid | path ]ID newname

Clone a connection. The connection to be cloned is identified by its name, UUID or D-Bus path. If ID is ambiguous, a keywordid, uuid or path can be used. See connection show above for the description of the ID-specifying keywords. newname is the name of the new cloned connection. The new connection will be the exact copy except the connection.id (newname) and connection.uuid (generated) properties.

The new connection profile will be saved as persistent unless--temporary option is specified, in which case the new profile won't exist after NetworkManager restart.

delete [ id | uuid | path ]ID...

Delete a configured connection. The connection to be deleted is identified by its name, UUID or D-Bus path. If ID is ambiguous, a keyword id, uuid or path can be used. See connection show above for the description of the _ID_-specifying keywords.

If --wait option is not specified, the default timeout will be 10 seconds.

monitor [ id | uuid | path ]ID...

Monitor connection profile activity. This command prints a line whenever the specified connection changes. The connection to be monitored is identified by its name, UUID or D-Bus path. If ID is ambiguous, a keywordid, uuid or path can be used. See connection show above for the description of the_ID_-specifying keywords.

Monitors all connection profiles in case none is specified. The command terminates when all monitored connections disappear. If you want to monitor connection creation consider using the global monitor with nmcli monitor command.

reload

Reload all connection files from disk. NetworkManager does not monitor changes to connection. So you need to use this command in order to tell NetworkManager to re-read the connection profiles from disk when a change was made to them.

load filename...

Load/reload one or more connection files from disk. Use this after manually editing a connection file to ensure that NetworkManager is aware of its latest state.

import [--temporary]type type file file

Import an external/foreign configuration as a NetworkManager connection profile. The type of the input file is specified by type option.

Only VPN configurations are supported at the moment. The configuration is imported by NetworkManager VPN plugins. type values are the same as for vpn-type option in nmcli connection add. VPN configurations are imported by VPN plugins. Therefore the proper VPN plugin has to be installed so that nmcli could import the data.

The imported connection profile will be saved as persistent unless--temporary option is specified, in which case the new profile won't exist after NetworkManager restart.

export [ id | uuid | path ]ID [_file_]

Export a connection.

Only VPN connections are supported at the moment. A proper VPN plugin has to be installed so that nmcli could export a connection. If no_file_ is provided, the VPN configuration data will be printed to standard output.

migrate [--plugin plugin... ] [ id | uuid | path ] [ID...]

Migrate connection profiles to a different settings plugin, such as keyfile (default) or ifcfg-rh.

The connection to be migrated is identified by its name, UUID or D-Bus path. If ID is ambiguous, a keyword id,uuid or path can be used. See connection show above for the description of the_ID_-specifying keywords.

If no connections are specified, the command acts on all available connections. Therefore, with no arguments, the command migrates all connection profiles to the keyfile plugin.

If --wait option is not specified, the default timeout will be 10 seconds.