1 <?xml version='
1.0'
?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
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+
8 This file is part of systemd.
10 Copyright 2015 Zbigniew Jędrzejewski-Szmek
12 systemd is free software; you can redistribute it and/or modify it
13 under the terms of the GNU Lesser General Public License as published by
14 the Free Software Foundation; either version 2.1 of the License, or
15 (at your option) any later version.
17 systemd is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Lesser General Public License for more details.
22 You should have received a copy of the GNU Lesser General Public License
23 along with systemd; If not, see <http://www.gnu.org/licenses/>.
26 <refentry id=
"networkctl" conditional='ENABLE_NETWORKD'
27 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
30 <title>networkctl
</title>
31 <productname>systemd
</productname>
35 <contrib>Documentation
</contrib>
36 <firstname>Zbigniew
</firstname>
37 <surname>Jędrzejewski-Szmek
</surname>
38 <email>zbyszek@in.waw.pl
</email>
44 <refentrytitle>networkctl
</refentrytitle>
45 <manvolnum>1</manvolnum>
49 <refname>networkctl
</refname>
50 <refpurpose>Query the status of network links
</refpurpose>
55 <command>networkctl
</command>
56 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
57 <arg choice=
"plain">COMMAND
</arg>
58 <arg choice=
"opt" rep=
"repeat">LINK
</arg>
63 <title>Description
</title>
65 <para><command>networkctl
</command> may be used to introspect the
66 state of the network links as seen by
67 <command>systemd-networkd
</command>. Please refer to
68 <citerefentry><refentrytitle>systemd-networkd.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
69 for an introduction to the basic concepts, functionality, and
70 configuration syntax.
</para>
74 <title>Options
</title>
76 <para>The following options are understood:
</para>
82 <option>--all
</option>
86 <para>Show all links with
<command>status
</command>.
</para>
90 <xi:include href=
"standard-options.xml" xpointer=
"help" />
91 <xi:include href=
"standard-options.xml" xpointer=
"version" />
92 <xi:include href=
"standard-options.xml" xpointer=
"no-legend" />
93 <xi:include href=
"standard-options.xml" xpointer=
"no-pager" />
99 <title>Commands
</title>
101 <para>The following commands are understood:
</para>
106 <command>list
</command>
107 <optional><replaceable>LINK…
</replaceable></optional>
111 <para>Show a list of existing links and their status. If no further arguments are specified shows all links,
112 otherwise just the specified links. Produces output similar to:
114 <programlisting>IDX LINK TYPE OPERATIONAL SETUP
115 1 lo loopback carrier unmanaged
116 2 eth0 ether routable configured
117 3 virbr0 ether no-carrier unmanaged
118 4 virbr0-nic ether off unmanaged
120 4 links listed.
</programlisting></para>
126 <command>status
</command>
127 <optional><replaceable>LINK…
</replaceable></optional>
131 <para>Show information about the specified links: type,
132 state, kernel module driver, hardware and IP address,
133 configured DNS servers, etc.
</para>
135 <para>When no links are specified, an overall network status is shown. Also see the option
136 <option>--all
</option>.
</para>
138 <para>Produces output similar to:
141 Address:
10.193.76.5 on eth0
142 192.168.122.1 on virbr0
143 169.254.190.105 on eth0
144 fe80::
5054:aa:bbbb:cccc on eth0
145 Gateway:
10.193.11.1 (CISCO SYSTEMS, INC.) on eth0
147 8.8.4.4</programlisting></para>
154 <command>lldp
</command>
155 <optional><replaceable>LINK…
</replaceable></optional>
159 <para>Show discovered LLDP (Link Layer Discovery Protocol) neighbors. If one or more link names are specified
160 only neighbors on those interfaces are shown. Otherwise shows discovered neighbors on all interfaces. Note
161 that for this feature to work,
<varname>LLDP=
</varname> must be turned on on the specific interface, see
162 <citerefentry><refentrytitle>systemd.network
</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
165 <para>Produces output similar to:
166 <programlisting>LINK CHASSIS ID SYSTEM NAME CAPS PORT ID PORT DESCRIPTION
167 enp0s25
00:e0:
4c:
00:
00:
00 GS1900 ..b........
2 Port #
2
170 o - Other; p - Repeater; b - Bridge; w - WLAN Access Point; r - Router;
171 t - Telephone; d - DOCSIS cable device; a - Station; c - Customer VLAN;
172 s - Service VLAN, m - Two-port MAC Relay (TPMR)
174 1 neighbors listed.
</programlisting></para>
180 <command>label
</command>
183 <listitem><para>Show numerical address labels that can be used for address selection.
184 This is the same information that
185 <citerefentry><refentrytitle>ip-addrlabel
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
186 shows. See
<ulink url=
"https://tools.ietf.org/html/rfc3484">RFC
3484</ulink>
187 for a discussion of address labels.
</para>
189 <para>Produces output similar to:
190 <programlisting>Prefix/Prefixlen Label
200 ::
1/
128 0</programlisting></para>
208 <title>Exit status
</title>
210 <para>On success,
0 is returned, a non-zero failure code otherwise.
</para>
214 <title>See Also
</title>
216 <citerefentry><refentrytitle>systemd-networkd.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
217 <citerefentry><refentrytitle>systemd.network
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
218 <citerefentry><refentrytitle>systemd.netdev
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
219 <citerefentry project='die-net'
><refentrytitle>ip
</refentrytitle><manvolnum>8</manvolnum></citerefentry>