2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id=
"networkctl" conditional='ENABLE_NETWORKD'
7 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
10 <title>networkctl
</title>
11 <productname>systemd
</productname>
15 <refentrytitle>networkctl
</refentrytitle>
16 <manvolnum>1</manvolnum>
20 <refname>networkctl
</refname>
21 <refpurpose>Query or modify the status of network links
</refpurpose>
26 <command>networkctl
</command>
27 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
28 <arg choice=
"plain">COMMAND
</arg>
29 <arg choice=
"opt" rep=
"repeat">LINK
</arg>
34 <title>Description
</title>
36 <para><command>networkctl
</command> may be used to query or modify the
37 state of the network links as seen by
38 <command>systemd-networkd
</command>. Please refer to
39 <citerefentry><refentrytitle>systemd-networkd.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
40 for an introduction to the basic concepts, functionality, and
41 configuration syntax.
</para>
45 <title>Commands
</title>
47 <para>The following commands are understood:
</para>
52 <command>list
</command>
53 <optional><replaceable>PATTERN…
</replaceable></optional>
57 <para>Show a list of existing links and their status. If one or more
58 <replaceable>PATTERN
</replaceable>s are specified, only links matching one of them are shown.
59 If no further arguments are specified shows all links,
60 otherwise just the specified links. Produces output similar to:
62 <programlisting>IDX LINK TYPE OPERATIONAL SETUP
63 1 lo loopback carrier unmanaged
64 2 eth0 ether routable configured
65 3 virbr0 ether no-carrier unmanaged
66 4 virbr0-nic ether off unmanaged
68 4 links listed.
</programlisting></para>
70 <para>The operational status is one of the following:
75 <para>the device is missing
</para>
77 <xi:include href=
"version-info.xml" xpointer=
"v245"/>
83 <para>the device is powered down
</para>
85 <xi:include href=
"version-info.xml" xpointer=
"v240"/>
89 <term>no-carrier
</term>
91 <para>the device is powered up, but it does not yet have a carrier
</para>
93 <xi:include href=
"version-info.xml" xpointer=
"v240"/>
99 <para>the device has a carrier, but is not yet ready for normal traffic
</para>
101 <xi:include href=
"version-info.xml" xpointer=
"v240"/>
105 <term>degraded-carrier
</term>
107 <para>one of the bonding or bridge slave network interfaces is in off, no-carrier, or dormant state, and the master interface has no address.
</para>
109 <xi:include href=
"version-info.xml" xpointer=
"v242"/>
115 <para>the link has a carrier, or for bond or bridge master, all bonding or bridge slave
116 network interfaces are enslaved to the master
</para>
118 <xi:include href=
"version-info.xml" xpointer=
"v240"/>
122 <term>degraded
</term>
124 <para>the link has carrier and addresses valid on the local link configured. For bond or
125 bridge master this means that not all slave network interfaces have carrier but at least
128 <xi:include href=
"version-info.xml" xpointer=
"v240"/>
132 <term>enslaved
</term>
134 <para>the link has carrier and is enslaved to bond or bridge master network interface
</para>
136 <xi:include href=
"version-info.xml" xpointer=
"v242"/>
140 <term>routable
</term>
142 <para>the link has carrier and routable address configured. For bond or bridge master it is
143 not necessary for all slave network interfaces to have carrier, but at least one must.
</para>
145 <xi:include href=
"version-info.xml" xpointer=
"v240"/>
151 <para>The setup status is one of the following:
156 <para>udev is still processing the link, we don't yet know if we will manage it
</para>
158 <xi:include href=
"version-info.xml" xpointer=
"v240"/>
162 <term>initialized
</term>
164 <para>udev has processed the link, but we don't yet know if we will manage it
</para>
166 <xi:include href=
"version-info.xml" xpointer=
"v251"/>
170 <term>configuring
</term>
172 <para>in the process of retrieving configuration or configuring the link
</para>
174 <xi:include href=
"version-info.xml" xpointer=
"v240"/>
178 <term>configured
</term>
180 <para>link configured successfully
</para>
182 <xi:include href=
"version-info.xml" xpointer=
"v240"/>
186 <term>unmanaged
</term>
188 <para>networkd is not handling the link
</para>
190 <xi:include href=
"version-info.xml" xpointer=
"v240"/>
196 <para>networkd failed to manage the link
</para>
198 <xi:include href=
"version-info.xml" xpointer=
"v240"/>
204 <para>the link is gone, but has not yet been dropped by networkd
</para>
206 <xi:include href=
"version-info.xml" xpointer=
"v240"/>
212 <xi:include href=
"version-info.xml" xpointer=
"v219"/>
218 <command>status
</command>
219 <optional><replaceable>PATTERN…
</replaceable></optional>
223 <para>Show information about the specified links: type, state, kernel module driver, hardware and
224 IP address, configured DNS servers, etc. If one or more
<replaceable>PATTERN
</replaceable>s are
225 specified, only links matching one of them are shown.
</para>
227 <para>When no links are specified, an overall network status is shown. Also see the option
228 <option>--all
</option>.
</para>
230 <para>Produces output similar to:
234 Address:
10.193.76.5 on eth0
235 192.168.122.1 on virbr0
236 169.254.190.105 on eth0
237 fe80::
5054:aa:bbbb:cccc on eth0
238 Gateway:
10.193.11.1 (CISCO SYSTEMS, INC.) on eth0
240 8.8.4.4</programlisting></para>
242 <para>In the overall network status, the online state depends on the individual online state of all
243 required links. Managed links are required for online by default. In this case, the online state is
244 one of the following:
249 <para>all links have unknown online status (i.e. there are no required links)
</para>
251 <xi:include href=
"version-info.xml" xpointer=
"v249"/>
257 <para>all required links are offline
</para>
259 <xi:include href=
"version-info.xml" xpointer=
"v249"/>
265 <para>some, but not all, required links are online
</para>
267 <xi:include href=
"version-info.xml" xpointer=
"v249"/>
273 <para>all required links are online
</para>
275 <xi:include href=
"version-info.xml" xpointer=
"v249"/>
281 <xi:include href=
"version-info.xml" xpointer=
"v219"/>
288 <command>lldp
</command>
289 <optional><replaceable>PATTERN…
</replaceable></optional>
293 <para>Show discovered LLDP (Link Layer Discovery Protocol) neighbors. If one or more
294 <replaceable>PATTERN
</replaceable>s are specified only neighbors on those interfaces are shown.
295 Otherwise shows discovered neighbors on all interfaces. Note that for this feature to work,
296 <varname>LLDP=
</varname> must be turned on for the specific interface, see
297 <citerefentry><refentrytitle>systemd.network
</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
300 <para>Produces output similar to:
301 <programlisting>LINK CHASSIS ID SYSTEM NAME CAPS PORT ID PORT DESCRIPTION
302 enp0s25
00:e0:
4c:
00:
00:
00 GS1900 ..b........
2 Port #
2
305 o - Other; p - Repeater; b - Bridge; w - WLAN Access Point; r - Router;
306 t - Telephone; d - DOCSIS cable device; a - Station; c - Customer VLAN;
307 s - Service VLAN, m - Two-port MAC Relay (TPMR)
309 1 neighbors listed.
</programlisting></para>
311 <xi:include href=
"version-info.xml" xpointer=
"v219"/>
317 <command>label
</command>
320 <listitem><para>Show numerical address labels that can be used for address selection.
321 This is the same information that
322 <citerefentry project='die-net'
><refentrytitle>ip-addrlabel
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
323 shows. See
<ulink url=
"https://tools.ietf.org/html/rfc3484">RFC
3484</ulink>
324 for a discussion of address labels.
</para>
326 <para>Produces output similar to:
327 <programlisting>Prefix/Prefixlen Label
337 ::
1/
128 0</programlisting></para>
339 <xi:include href=
"version-info.xml" xpointer=
"v234"/>
345 <command>delete
</command>
346 <replaceable>DEVICE…
</replaceable>
348 <listitem><para>Deletes virtual netdevs. Takes interface name or index number.
</para>
350 <xi:include href=
"version-info.xml" xpointer=
"v243"/></listitem>
355 <command>up
</command>
356 <replaceable>DEVICE…
</replaceable>
358 <listitem><para>Bring devices up. Takes interface name or index number.
</para>
360 <xi:include href=
"version-info.xml" xpointer=
"v246"/></listitem>
365 <command>down
</command>
366 <replaceable>DEVICE…
</replaceable>
368 <listitem><para>Bring devices down. Takes interface name or index number.
</para>
370 <xi:include href=
"version-info.xml" xpointer=
"v246"/></listitem>
375 <command>renew
</command>
376 <replaceable>DEVICE…
</replaceable>
378 <listitem><para>Renew dynamic configurations e.g. addresses received from DHCP server.
379 Takes interface name or index number.
</para>
381 <xi:include href=
"version-info.xml" xpointer=
"v244"/></listitem>
386 <command>forcerenew
</command>
387 <replaceable>DEVICE…
</replaceable>
389 <listitem><para>Send a FORCERENEW message to all connected clients, triggering DHCP reconfiguration.
390 Takes interface name or index number.
</para>
392 <xi:include href=
"version-info.xml" xpointer=
"v246"/></listitem>
397 <command>reconfigure
</command>
398 <replaceable>DEVICE…
</replaceable>
400 <listitem><para>Reconfigure network interfaces. Takes interface name or index number. Note that
401 this does not reload
<filename>.netdev
</filename> or
<filename>.network
</filename>
402 corresponding to the specified interface. So, if you edit config files, it is necessary to call
403 <command>networkctl reload
</command> first to apply new settings.
</para>
405 <xi:include href=
"version-info.xml" xpointer=
"v244"/></listitem>
410 <command>reload
</command>
412 <listitem><para>Reload
<filename>.netdev
</filename> and
<filename>.network
</filename> files.
413 If a new
<filename>.netdev
</filename> file is found, then the corresponding netdev is created.
414 Note that even if an existing
<filename>.netdev
</filename> is modified or removed,
415 <command>systemd-networkd
</command> does not update or remove the netdev.
416 If a new, modified or removed
<filename>.network
</filename> file is found, then all interfaces
417 which match the file are reconfigured.
</para>
419 <xi:include href=
"version-info.xml" xpointer=
"v244"/></listitem>
424 <command>edit
</command>
425 <replaceable>FILE
</replaceable>|
<replaceable>@DEVICE
</replaceable>…
427 <listitem><para>Edit network configuration files, which include
<filename>.network
</filename>,
428 <filename>.netdev
</filename>, and
<filename>.link
</filename> files. If no network config file
429 matching the given name is found, a new one will be created under
<filename>/etc/
</filename>.
430 Specially, if the name is prefixed by
<literal>@
</literal>, it will be treated as
431 a network interface, and editing will be performed on the network config files associated
432 with it. Additionally, the interface name can be suffixed with
<literal>:network
</literal> (default)
433 or
<literal>:link
</literal>, in order to choose the type of network config to operate on.
</para>
435 <para>If
<option>--drop-in=
</option> is specified, edit the drop-in file instead of
436 the main configuration file. Unless
<option>--no-reload
</option> is specified,
437 <command>systemd-networkd
</command> will be reloaded after the edit of the
438 <filename>.network
</filename> or
<filename>.netdev
</filename> files finishes.
439 The same applies for
<filename>.link
</filename> files and
440 <citerefentry><refentrytitle>systemd-udevd
</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
441 Note that the changed link settings are not automatically applied after reloading.
442 To achieve that, trigger uevents for the corresponding interface. Refer to
443 <citerefentry><refentrytitle>systemd.link
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
444 for more information.
</para>
446 <xi:include href=
"version-info.xml" xpointer=
"v254"/></listitem>
451 <command>cat
</command>
452 <replaceable>FILE
</replaceable>|
<replaceable>@DEVICE
</replaceable>…
454 <listitem><para>Show network configuration files. This command honors
455 the
<literal>@
</literal> prefix in the same way as
<command>edit
</command>.
</para>
457 <xi:include href=
"version-info.xml" xpointer=
"v254"/></listitem>
463 <title>Options
</title>
465 <para>The following options are understood:
</para>
471 <option>--all
</option>
475 <para>Show all links with
<command>status
</command>.
</para>
477 <xi:include href=
"version-info.xml" xpointer=
"v219"/>
484 <option>--stats
</option>
488 <para>Show link statistics with
<command>status
</command>.
</para>
490 <xi:include href=
"version-info.xml" xpointer=
"v243"/>
495 <term><option>-l
</option></term>
496 <term><option>--full
</option></term>
499 <para>Do not ellipsize the output.
</para>
501 <xi:include href=
"version-info.xml" xpointer=
"v245"/>
506 <term><option>-n
</option></term>
507 <term><option>--lines=
</option></term>
510 <para>When used with
<command>status
</command>, controls the number of journal lines to show,
511 counting from the most recent ones. Takes a positive integer argument. Defaults to
10.
</para>
513 <xi:include href=
"version-info.xml" xpointer=
"v245"/>
518 <term><option>--drop-in=
</option><replaceable>NAME
</replaceable></term>
521 <para>When used with
<command>edit
</command>, edit the drop-in file
<replaceable>NAME
</replaceable>
522 instead of the main configuration file.
</para>
524 <xi:include href=
"version-info.xml" xpointer=
"v254"/>
529 <term><option>--no-reload
</option></term>
532 <para>When used with
<command>edit
</command>,
533 <citerefentry><refentrytitle>systemd-networkd.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
535 <citerefentry><refentrytitle>systemd-udevd.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
536 will not be reloaded after the editing finishes.
</para>
538 <xi:include href=
"version-info.xml" xpointer=
"v254"/>
542 <xi:include href=
"standard-options.xml" xpointer=
"json" />
543 <xi:include href=
"standard-options.xml" xpointer=
"help" />
544 <xi:include href=
"standard-options.xml" xpointer=
"version" />
545 <xi:include href=
"standard-options.xml" xpointer=
"no-legend" />
546 <xi:include href=
"standard-options.xml" xpointer=
"no-pager" />
552 <title>Exit status
</title>
554 <para>On success,
0 is returned, a non-zero failure code otherwise.
</para>
558 <title>See Also
</title>
560 <citerefentry><refentrytitle>systemd-networkd.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
561 <citerefentry><refentrytitle>systemd.network
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
562 <citerefentry><refentrytitle>systemd.netdev
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
563 <citerefentry project='die-net'
><refentrytitle>ip
</refentrytitle><manvolnum>8</manvolnum></citerefentry>