]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/networkctl.xml
network: introduce 'degraded-carrier' operstate to order all states
[thirdparty/systemd.git] / man / networkctl.xml
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6 SPDX-License-Identifier: LGPL-2.1+
7 -->
8
9 <refentry id="networkctl" conditional='ENABLE_NETWORKD'
10 xmlns:xi="http://www.w3.org/2001/XInclude">
11
12 <refentryinfo>
13 <title>networkctl</title>
14 <productname>systemd</productname>
15 </refentryinfo>
16
17 <refmeta>
18 <refentrytitle>networkctl</refentrytitle>
19 <manvolnum>1</manvolnum>
20 </refmeta>
21
22 <refnamediv>
23 <refname>networkctl</refname>
24 <refpurpose>Query the status of network links</refpurpose>
25 </refnamediv>
26
27 <refsynopsisdiv>
28 <cmdsynopsis>
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>
33 </cmdsynopsis>
34 </refsynopsisdiv>
35
36 <refsect1>
37 <title>Description</title>
38
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>
45 </refsect1>
46
47 <refsect1>
48 <title>Options</title>
49
50 <para>The following options are understood:</para>
51
52 <variablelist>
53 <varlistentry>
54 <term>
55 <option>-a</option>
56 <option>--all</option>
57 </term>
58
59 <listitem>
60 <para>Show all links with <command>status</command>.</para>
61 </listitem>
62 </varlistentry>
63
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" />
68
69 </variablelist>
70 </refsect1>
71
72 <refsect1>
73 <title>Commands</title>
74
75 <para>The following commands are understood:</para>
76
77 <variablelist>
78 <varlistentry>
79 <term>
80 <command>list</command>
81 <optional><replaceable>PATTERN…</replaceable></optional>
82 </term>
83
84 <listitem>
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:
89
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
95
96 4 links listed.</programlisting></para>
97
98 <para>The operational status is one of the following:
99 <variablelist>
100 <varlistentry>
101 <term>off</term>
102 <listitem>
103 <para>the device is powered down</para>
104 </listitem>
105 </varlistentry>
106 <varlistentry>
107 <term>no-carrier</term>
108 <listitem>
109 <para>the device is powered up, but it does not yet have a carrier</para>
110 </listitem>
111 </varlistentry>
112 <varlistentry>
113 <term>dormant</term>
114 <listitem>
115 <para>the device has a carrier, but is not yet ready for normal traffic</para>
116 </listitem>
117 </varlistentry>
118 <varlistentry>
119 <term>degraded-carrier</term>
120 <listitem>
121 <para>for bond or bridge master, one of the bonding or bridge slave network interfaces is
122 in off, no-carrier, or dormant state</para>
123 </listitem>
124 </varlistentry>
125 <varlistentry>
126 <term>carrier</term>
127 <listitem>
128 <para>the link has a carrier, or for bond or bridge master, all bonding or bridge slave
129 network interfaces are enslaved to the master.</para>
130 </listitem>
131 </varlistentry>
132 <varlistentry>
133 <term>degraded</term>
134 <listitem>
135 <para>the link has carrier and addresses valid on the local link configured</para>
136 </listitem>
137 </varlistentry>
138 <varlistentry>
139 <term>enslaved</term>
140 <listitem>
141 <para>the link has carrier and is enslaved to bond or bridge master network interface</para>
142 </listitem>
143 </varlistentry>
144 <varlistentry>
145 <term>routable</term>
146 <listitem>
147 <para>the link has carrier and routable address configured</para>
148 </listitem>
149 </varlistentry>
150 </variablelist>
151 </para>
152
153 <para>The setup status is one of the following:
154 <variablelist>
155 <varlistentry>
156 <term>pending</term>
157 <listitem>
158 <para>udev is still processing the link, we don't yet know if we will manage it</para>
159 </listitem>
160 </varlistentry>
161 <varlistentry>
162 <term>failed</term>
163 <listitem>
164 <para>networkd failed to manage the link</para>
165 </listitem>
166 </varlistentry>
167 <varlistentry>
168 <term>configuring</term>
169 <listitem>
170 <para>in the process of retrieving configuration or configuring the link</para>
171 </listitem>
172 </varlistentry>
173 <varlistentry>
174 <term>configured</term>
175 <listitem>
176 <para>link configured successfully</para>
177 </listitem>
178 </varlistentry>
179 <varlistentry>
180 <term>unmanaged</term>
181 <listitem>
182 <para>networkd is not handling the link</para>
183 </listitem>
184 </varlistentry>
185 <varlistentry>
186 <term>linger</term>
187 <listitem>
188 <para>the link is gone, but has not yet been dropped by networkd</para>
189 </listitem>
190 </varlistentry>
191 </variablelist>
192 </para>
193 </listitem>
194 </varlistentry>
195
196 <varlistentry>
197 <term>
198 <command>status</command>
199 <optional><replaceable>PATTERN…</replaceable></optional>
200 </term>
201
202 <listitem>
203 <para>Show information about the specified links: type, state, kernel module driver, hardware and
204 IP address, configured DNS servers, etc. If one ore more <replaceable>PATTERN</replaceable>s are
205 specified, only links matching one of them are shown.</para>
206
207 <para>When no links are specified, an overall network status is shown. Also see the option
208 <option>--all</option>.</para>
209
210 <para>Produces output similar to:
211 <programlisting>
212 ● State: routable
213 Address: 10.193.76.5 on eth0
214 192.168.122.1 on virbr0
215 169.254.190.105 on eth0
216 fe80::5054:aa:bbbb:cccc on eth0
217 Gateway: 10.193.11.1 (CISCO SYSTEMS, INC.) on eth0
218 DNS: 8.8.8.8
219 8.8.4.4</programlisting></para>
220 </listitem>
221
222 </varlistentry>
223
224 <varlistentry>
225 <term>
226 <command>lldp</command>
227 <optional><replaceable>PATTERN…</replaceable></optional>
228 </term>
229
230 <listitem>
231 <para>Show discovered LLDP (Link Layer Discovery Protocol) neighbors. If one or more
232 <replaceable>PATTERN</replaceable>s are specified only neighbors on those interfaces are shown.
233 Otherwise shows discovered neighbors on all interfaces. Note that for this feature to work,
234 <varname>LLDP=</varname> must be turned on for the specific interface, see
235 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
236 details.</para>
237
238 <para>Produces output similar to:
239 <programlisting>LINK CHASSIS ID SYSTEM NAME CAPS PORT ID PORT DESCRIPTION
240 enp0s25 00:e0:4c:00:00:00 GS1900 ..b........ 2 Port #2
241
242 Capability Flags:
243 o - Other; p - Repeater; b - Bridge; w - WLAN Access Point; r - Router;
244 t - Telephone; d - DOCSIS cable device; a - Station; c - Customer VLAN;
245 s - Service VLAN, m - Two-port MAC Relay (TPMR)
246
247 1 neighbors listed.</programlisting></para>
248 </listitem>
249 </varlistentry>
250
251 <varlistentry>
252 <term>
253 <command>label</command>
254 </term>
255
256 <listitem><para>Show numerical address labels that can be used for address selection.
257 This is the same information that
258 <citerefentry><refentrytitle>ip-addrlabel</refentrytitle><manvolnum>8</manvolnum></citerefentry>
259 shows. See <ulink url="https://tools.ietf.org/html/rfc3484">RFC 3484</ulink>
260 for a discussion of address labels.</para>
261
262 <para>Produces output similar to:
263 <programlisting>Prefix/Prefixlen Label
264 ::/0 1
265 fc00::/7 5
266 fec0::/10 11
267 2002::/16 2
268 3ffe::/16 12
269 2001:10::/28 7
270 2001::/32 6
271 ::ffff:0.0.0.0/96 4
272 ::/96 3
273 ::1/128 0</programlisting></para>
274 </listitem>
275 </varlistentry>
276
277 </variablelist>
278 </refsect1>
279
280 <refsect1>
281 <title>Exit status</title>
282
283 <para>On success, 0 is returned, a non-zero failure code otherwise.</para>
284 </refsect1>
285
286 <refsect1>
287 <title>See Also</title>
288 <para>
289 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
290 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
291 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
292 <citerefentry project='die-net'><refentrytitle>ip</refentrytitle><manvolnum>8</manvolnum></citerefentry>
293 </para>
294 </refsect1>
295 </refentry>