2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 SPDX-License-Identifier: LGPL-2.1+
9 <refentry id=
"networkctl" conditional='ENABLE_NETWORKD'
10 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
13 <title>networkctl
</title>
14 <productname>systemd
</productname>
18 <refentrytitle>networkctl
</refentrytitle>
19 <manvolnum>1</manvolnum>
23 <refname>networkctl
</refname>
24 <refpurpose>Query the status of network links
</refpurpose>
29 <command>networkctl
</command>
30 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
31 <arg choice=
"plain">COMMAND
</arg>
32 <arg choice=
"opt" rep=
"repeat">LINK
</arg>
37 <title>Description
</title>
39 <para><command>networkctl
</command> may be used to introspect the
40 state of the network links as seen by
41 <command>systemd-networkd
</command>. Please refer to
42 <citerefentry><refentrytitle>systemd-networkd.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
43 for an introduction to the basic concepts, functionality, and
44 configuration syntax.
</para>
48 <title>Options
</title>
50 <para>The following options are understood:
</para>
56 <option>--all
</option>
60 <para>Show all links with
<command>status
</command>.
</para>
64 <xi:include href=
"standard-options.xml" xpointer=
"help" />
65 <xi:include href=
"standard-options.xml" xpointer=
"version" />
66 <xi:include href=
"standard-options.xml" xpointer=
"no-legend" />
67 <xi:include href=
"standard-options.xml" xpointer=
"no-pager" />
73 <title>Commands
</title>
75 <para>The following commands are understood:
</para>
80 <command>list
</command>
81 <optional><replaceable>PATTERN…
</replaceable></optional>
85 <para>Show a list of existing links and their status. If one ore more
86 <replaceable>PATTERN
</replaceable>s are specified, only links matching one of them are shown.
87 If no further arguments are specified shows all links,
88 otherwise just the specified links. Produces output similar to:
90 <programlisting>IDX LINK TYPE OPERATIONAL SETUP
91 1 lo loopback carrier unmanaged
92 2 eth0 ether routable configured
93 3 virbr0 ether no-carrier unmanaged
94 4 virbr0-nic ether off unmanaged
96 4 links listed.
</programlisting></para>
98 <para>The operational status is one of the following:
103 <para>the device is powered down
</para>
107 <term>no-carrier
</term>
109 <para>the device is powered up, but it does not yet have a carrier
</para>
115 <para>the device has a carrier, but is not yet ready for normal traffic
</para>
121 <para>the link has a carrier
</para>
125 <term>degraded
</term>
127 <para>the link has carrier and addresses valid on the local link configured
</para>
131 <term>routable
</term>
133 <para>the link has carrier and routable address configured
</para>
139 <para>The setup status is one of the following:
144 <para>udev is still processing the link, we don't yet know if we will manage it
</para>
150 <para>networkd failed to manage the link
</para>
154 <term>configuring
</term>
156 <para>in the process of retrieving configuration or configuring the link
</para>
160 <term>configured
</term>
162 <para>link configured successfully
</para>
166 <term>unmanaged
</term>
168 <para>networkd is not handling the link
</para>
174 <para>the link is gone, but has not yet been dropped by networkd
</para>
184 <command>status
</command>
185 <optional><replaceable>PATTERN…
</replaceable></optional>
189 <para>Show information about the specified links: type, state, kernel module driver, hardware and
190 IP address, configured DNS servers, etc. If one ore more
<replaceable>PATTERN
</replaceable>s are
191 specified, only links matching one of them are shown.
</para>
193 <para>When no links are specified, an overall network status is shown. Also see the option
194 <option>--all
</option>.
</para>
196 <para>Produces output similar to:
199 Address:
10.193.76.5 on eth0
200 192.168.122.1 on virbr0
201 169.254.190.105 on eth0
202 fe80::
5054:aa:bbbb:cccc on eth0
203 Gateway:
10.193.11.1 (CISCO SYSTEMS, INC.) on eth0
205 8.8.4.4</programlisting></para>
212 <command>lldp
</command>
213 <optional><replaceable>PATTERN…
</replaceable></optional>
217 <para>Show discovered LLDP (Link Layer Discovery Protocol) neighbors. If one or more
218 <replaceable>PATTERN
</replaceable>s are specified only neighbors on those interfaces are shown.
219 Otherwise shows discovered neighbors on all interfaces. Note that for this feature to work,
220 <varname>LLDP=
</varname> must be turned on for the specific interface, see
221 <citerefentry><refentrytitle>systemd.network
</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
224 <para>Produces output similar to:
225 <programlisting>LINK CHASSIS ID SYSTEM NAME CAPS PORT ID PORT DESCRIPTION
226 enp0s25
00:e0:
4c:
00:
00:
00 GS1900 ..b........
2 Port #
2
229 o - Other; p - Repeater; b - Bridge; w - WLAN Access Point; r - Router;
230 t - Telephone; d - DOCSIS cable device; a - Station; c - Customer VLAN;
231 s - Service VLAN, m - Two-port MAC Relay (TPMR)
233 1 neighbors listed.
</programlisting></para>
239 <command>label
</command>
242 <listitem><para>Show numerical address labels that can be used for address selection.
243 This is the same information that
244 <citerefentry><refentrytitle>ip-addrlabel
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
245 shows. See
<ulink url=
"https://tools.ietf.org/html/rfc3484">RFC
3484</ulink>
246 for a discussion of address labels.
</para>
248 <para>Produces output similar to:
249 <programlisting>Prefix/Prefixlen Label
259 ::
1/
128 0</programlisting></para>
267 <title>Exit status
</title>
269 <para>On success,
0 is returned, a non-zero failure code otherwise.
</para>
273 <title>See Also
</title>
275 <citerefentry><refentrytitle>systemd-networkd.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
276 <citerefentry><refentrytitle>systemd.network
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
277 <citerefentry><refentrytitle>systemd.netdev
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
278 <citerefentry project='die-net'
><refentrytitle>ip
</refentrytitle><manvolnum>8</manvolnum></citerefentry>