1NMCLI(1)                    General Commands Manual                   NMCLI(1)
2
3
4

NAME

6       nmcli - command-line tool for controlling NetworkManager
7

SYNOPSIS

9       nmcli  [ OPTIONS ] OBJECT { COMMAND | help }
10
11
12       OBJECT := { nm | con | dev }
13
14
15       OPTIONS := {
16       -t[erse]
17       -p[retty]
18       -m[mode] tabular | multiline
19       -f[ields] <field1,field2,...> | all | common
20       -e[scape] yes | no
21       -v[ersion]
22       -h[elp]
23       }
24
25

DESCRIPTION

27       nmcli is a command-line tool for controlling NetworkManager and getting
28       its status.  It is not meant as a replacement of nm-applet or other
29       similar clients.  Rather it's a complementary utility to these pro‐
30       grams.  The main nmcli's usage is on servers, headless machines or just
31       for power users who prefer the command line.
32
33       The use cases comprise:
34
35       —   Initscripts: ifup/ifdown can utilize NetworkManager via nmcli
36           instead of having to manage connections itself and possible inter‐
37           fere with NetworkManager.
38
39       —   Servers, headless machines: No GUI is available; then nmcli is used
40           to talk directly to NetworkManager and control only system-wide
41           connections.
42
43       —   User sessions: For this case, nmcli can talk to nm-applet to find
44           user connections.  It can still talk directly to NetworkManager for
45           manipulating these connections.  As nmcli doesn't have direct
46           access to user configuration data in GConf, nm-applet handles that
47           itself.  That may, for example, cause the applet to pop up keyring
48           dialogs when secrets are needed.
49
50   OPTIONS
51       -t, --terse
52              Output is terse.  This mode is designed and suitable for com‐
53              puter (script) processing.
54
55       -p, --pretty
56              Output is pretty.  This causes nmcli to produce easy readable
57              outputs for humans, i.e. values are aligned, headers are
58              printed, etc.
59
60       -m, --mode tabular | multiline
61              Switch between tabular and multiline output.  If omitted,
62              default is tabular for most commands.  For the commands produc‐
63              ing more structured information, that cannot be displayed on a
64              single line, default is multiline. Currenly, they are:
65                'nmcli con list id|uuid <name>'
66                'nmcli dev list'
67              tabular   - Output is a table where each line describes a single
68              entry.  Columns define particular properties of the entry.
69              multiline - Each entry comprises more lines, each property on
70              its own line.  The values are prefixed with the property name.
71
72       -f, --fields <field1,field2,...> | all | common
73              This option is used to specify what fields (column names) should
74              be printed.  Valid field names differ for specific commands.
75              List available fields by providing an invalid value to the
76              --fields option.
77              all is used to print all valid field values of the command.
78              common is used to print common field values of the command.  If
79              omitted, default is common.  The option is mandatory when
80              --terse is used.  In this case, generic values all and common
81              cannot be used.  (This is to maintain compatibility when new
82              fields are added in the future).
83
84       -e, --escape yes | no
85              Whether to escape ':' and '\' characters in terse tabular mode.
86              The escape character is '\'.  If omitted, default is yes.
87
88       -v, --version
89              Show nmcli version.
90
91       -h, --help
92              Print help information.
93
94   OBJECT
95       nm     NetworkManager
96              Use this object to inquire and change state of NetworkManager.
97
98
99          COMMAND := { status | sleep | wakeup | wifi | wwan }
100
101
102              status
103                     Show overall status of NetworkManager.  This is the
104                     default action, when no command is provided to nm object.
105                     Reference to D-Bus:
106                     No simple reference.
107
108              sleep
109                     Put NetworkManager to sleeping mode.  Thus all interfaces
110                     that NetworkManager manages are deactivated.
111                     Reference to D-Bus:
112                     interface: org.freedesktop.NetworkManager
113                     method:    Sleep
114                     arguments: TRUE
115
116              wakeup
117                     Awake NetworkManager from sleep.  When NetworkManager is
118                     awaken, devices are available to be activated.
119                     Reference to D-Bus:
120                     interface: org.freedesktop.NetworkManager
121                     method:    Sleep
122                     arguments: FALSE
123
124              wifi [on|off]
125                     Inquire or set status of WiFi in NetworkManager.  Without
126                     any further argument, WiFi status is printed; on enables
127                     WiFi; off disables WiFi.
128                     Reference to D-Bus:
129                     No simple reference.
130
131              wwan [on|off]
132                     Inquire or set status of WWAN in NetworkManager.  Without
133                     any further argument, WWAN status is printed; on enables
134                     WWAN; off disables WWAN.
135                     Reference to D-Bus:
136                     No simple reference.
137
138
139       con    Connections
140              Get information about NetworkManager's connections.
141
142
143          COMMAND := { list | status | up | down }
144
145
146              list [id <id> | uuid <id> | system | user]
147                     List configured connections.  Without a parameter, con‐
148                     figured connection from both system and user settings
149                     services are listed.  system argument filters only sys‐
150                     tem-wide connections, user prints user connections only.
151                     In order to get connection details, id with connection's
152                     name or uuid with connection's UUID shall be specified.
153                     When no command is given to con object, the default
154                     action is 'nmcli con list'.
155                     Reference to D-Bus:
156                     No simple reference.
157
158              status
159                     Print status of active connections.
160                     Reference to D-Bus:
161                     No simple reference.
162
163              up id <id> | uuid <id> [iface <iface>] [ap <hwaddr>] [--nowait]
164              [--timeout <timeout>]
165                     Activate a connection.  The connection is identified by
166                     its name using id or UUID using uuid.  For requiring par‐
167                     ticular device to activate the connection on, iface
168                     option with interface name should be given.  ap option
169                     can further concretize what AP should be used in case of
170                     WiFi connection.  --nowait option causes nmcli to exit
171                     immediately and not to wait for command completion.
172                     --timeout option provides a means to specify how long to
173                     wait for operation completion.
174                     Reference to D-Bus:
175                     interface: org.freedesktop.NetworkManager
176                     method:    ActivateConnection
177                     arguments: according to arguments
178
179              down id <id> | uuid <id>
180                     Deactivate a connection.  The connection is identified by
181                     its name using id or UUID using uuid.
182                     Reference to D-Bus:
183                     interface: org.freedesktop.NetworkManager
184                     method:    DeactivateConnection
185                     arguments: according to arguments
186
187
188       dev    Devices
189              Get information about devices.
190
191
192          COMMAND := { status | list | disconnect | wifi }
193
194
195              status
196                     Print status of devices.  This is the default action,
197                     when no command is specified to dev object.
198                     Reference to D-Bus:
199                     No simple reference.
200
201              list [iface <iface>]
202                     Get detailed information about devices.  Without an argu‐
203                     ment, all devices are examined.  To get information for a
204                     specific device, iface argument with the interface name
205                     should be provided.
206                     Reference to D-Bus:
207                     No simple reference.
208
209              disconnect iface <iface> [--nowait] [--timeout <timeout>]
210                     Disconnect a device and prevent the device from automati‐
211                     cally activating further connections without user/manual
212                     intervention.  --nowait option causes nmcli to exit imme‐
213                     diately and not to wait for command completion.  --time‐
214                     out option provides a means to specify how long to wait
215                     for operation completion.
216                     Reference to D-Bus:
217                     interface: org.freedesktop.NetworkManager.Device
218                     method:    Disconnect
219                     arguments: none
220
221              wifi [list [iface <iface>] [hwaddr <hwaddr>]]
222                     List available WiFi access points.  iface and hwaddr
223                     options can be used to get just APs for particular inter‐
224                     face or specific AP, respectively.
225                     Reference to D-Bus:
226                     No simple reference.
227
228

BUGS

230       There are probably some.  If you find a bug, please report to
231       https://bugzilla.gnome.org/ - product NetworkManager.
232
233

SEE ALSO

235       nm-tool(1), NetworkManager(8).
236
237
238
239                                 14 April 2010                        NMCLI(1)
Impressum