]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/networkctl.xml
string-util: simplify logic in strjoin_real()
[thirdparty/systemd.git] / man / networkctl.xml
CommitLineData
514094f9 1<?xml version='1.0'?>
3a54a157
ZJS
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
0307f791 4<!-- SPDX-License-Identifier: LGPL-2.1+ -->
d9000fd3 5
e6de49ab 6<refentry id="networkctl" conditional='ENABLE_NETWORKD'
d9000fd3
ZJS
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8
9 <refentryinfo>
10 <title>networkctl</title>
11 <productname>systemd</productname>
d9000fd3
ZJS
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>networkctl</refentrytitle>
16 <manvolnum>1</manvolnum>
17 </refmeta>
18
19 <refnamediv>
20 <refname>networkctl</refname>
cc98b302 21 <refpurpose>Query the status of network links</refpurpose>
d9000fd3
ZJS
22 </refnamediv>
23
24 <refsynopsisdiv>
25 <cmdsynopsis>
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>
30 </cmdsynopsis>
31 </refsynopsisdiv>
32
33 <refsect1>
34 <title>Description</title>
35
36 <para><command>networkctl</command> may be used to introspect 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>
1d3eaa93 40 for an introduction to the basic concepts, functionality, and
d9000fd3
ZJS
41 configuration syntax.</para>
42 </refsect1>
43
d9000fd3
ZJS
44 <refsect1>
45 <title>Commands</title>
46
47 <para>The following commands are understood:</para>
48
49 <variablelist>
50 <varlistentry>
51 <term>
52 <command>list</command>
f3eeecf4 53 <optional><replaceable>PATTERN…</replaceable></optional>
d9000fd3
ZJS
54 </term>
55
56 <listitem>
f3eeecf4
YW
57 <para>Show a list of existing links and their status. If one ore 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,
e997c4b0
LP
60 otherwise just the specified links. Produces output similar to:
61
62 <programlisting>IDX LINK TYPE OPERATIONAL SETUP
d9000fd3
ZJS
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
67
684 links listed.</programlisting></para>
abcf95e9
JAK
69
70 <para>The operational status is one of the following:
71 <variablelist>
5cbaf95e
DDM
72 <varlistentry>
73 <term>missing</term>
74 <listitem>
75 <para>the device is missing</para>
76 </listitem>
77 </varlistentry>
abcf95e9
JAK
78 <varlistentry>
79 <term>off</term>
80 <listitem>
81 <para>the device is powered down</para>
82 </listitem>
83 </varlistentry>
84 <varlistentry>
85 <term>no-carrier</term>
86 <listitem>
87 <para>the device is powered up, but it does not yet have a carrier</para>
88 </listitem>
89 </varlistentry>
90 <varlistentry>
91 <term>dormant</term>
92 <listitem>
93 <para>the device has a carrier, but is not yet ready for normal traffic</para>
94 </listitem>
95 </varlistentry>
c9cc0383
YW
96 <varlistentry>
97 <term>degraded-carrier</term>
98 <listitem>
99 <para>for bond or bridge master, one of the bonding or bridge slave network interfaces is
100 in off, no-carrier, or dormant state</para>
101 </listitem>
102 </varlistentry>
abcf95e9
JAK
103 <varlistentry>
104 <term>carrier</term>
105 <listitem>
7d4ea8f9
YW
106 <para>the link has a carrier, or for bond or bridge master, all bonding or bridge slave
107 network interfaces are enslaved to the master.</para>
abcf95e9
JAK
108 </listitem>
109 </varlistentry>
110 <varlistentry>
111 <term>degraded</term>
112 <listitem>
c9cc0383 113 <para>the link has carrier and addresses valid on the local link configured</para>
abcf95e9
JAK
114 </listitem>
115 </varlistentry>
806c86ad
YW
116 <varlistentry>
117 <term>enslaved</term>
118 <listitem>
7d4ea8f9 119 <para>the link has carrier and is enslaved to bond or bridge master network interface</para>
806c86ad
YW
120 </listitem>
121 </varlistentry>
abcf95e9
JAK
122 <varlistentry>
123 <term>routable</term>
124 <listitem>
125 <para>the link has carrier and routable address configured</para>
126 </listitem>
127 </varlistentry>
128 </variablelist>
129 </para>
130
131 <para>The setup status is one of the following:
132 <variablelist>
133 <varlistentry>
134 <term>pending</term>
135 <listitem>
136 <para>udev is still processing the link, we don't yet know if we will manage it</para>
137 </listitem>
138 </varlistentry>
139 <varlistentry>
140 <term>failed</term>
141 <listitem>
142 <para>networkd failed to manage the link</para>
143 </listitem>
144 </varlistentry>
145 <varlistentry>
146 <term>configuring</term>
147 <listitem>
148 <para>in the process of retrieving configuration or configuring the link</para>
149 </listitem>
150 </varlistentry>
151 <varlistentry>
152 <term>configured</term>
153 <listitem>
154 <para>link configured successfully</para>
155 </listitem>
156 </varlistentry>
157 <varlistentry>
158 <term>unmanaged</term>
159 <listitem>
160 <para>networkd is not handling the link</para>
161 </listitem>
162 </varlistentry>
163 <varlistentry>
164 <term>linger</term>
165 <listitem>
166 <para>the link is gone, but has not yet been dropped by networkd</para>
167 </listitem>
168 </varlistentry>
169 </variablelist>
170 </para>
d9000fd3
ZJS
171 </listitem>
172 </varlistentry>
173
174 <varlistentry>
175 <term>
176 <command>status</command>
f3eeecf4 177 <optional><replaceable>PATTERN…</replaceable></optional>
d9000fd3
ZJS
178 </term>
179
180 <listitem>
f3eeecf4
YW
181 <para>Show information about the specified links: type, state, kernel module driver, hardware and
182 IP address, configured DNS servers, etc. If one ore more <replaceable>PATTERN</replaceable>s are
183 specified, only links matching one of them are shown.</para>
d9000fd3 184
e997c4b0
LP
185 <para>When no links are specified, an overall network status is shown. Also see the option
186 <option>--all</option>.</para>
d9000fd3 187
e997c4b0 188 <para>Produces output similar to:
d9000fd3
ZJS
189 <programlisting>
190● State: routable
191 Address: 10.193.76.5 on eth0
192 192.168.122.1 on virbr0
193 169.254.190.105 on eth0
194 fe80::5054:aa:bbbb:cccc on eth0
195 Gateway: 10.193.11.1 (CISCO SYSTEMS, INC.) on eth0
196 DNS: 8.8.8.8
197 8.8.4.4</programlisting></para>
198 </listitem>
199
200 </varlistentry>
201
202 <varlistentry>
203 <term>
204 <command>lldp</command>
f3eeecf4 205 <optional><replaceable>PATTERN…</replaceable></optional>
d9000fd3
ZJS
206 </term>
207
208 <listitem>
f3eeecf4
YW
209 <para>Show discovered LLDP (Link Layer Discovery Protocol) neighbors. If one or more
210 <replaceable>PATTERN</replaceable>s are specified only neighbors on those interfaces are shown.
211 Otherwise shows discovered neighbors on all interfaces. Note that for this feature to work,
212 <varname>LLDP=</varname> must be turned on for the specific interface, see
e997c4b0
LP
213 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
214 details.</para>
215
216 <para>Produces output similar to:
217 <programlisting>LINK CHASSIS ID SYSTEM NAME CAPS PORT ID PORT DESCRIPTION
218enp0s25 00:e0:4c:00:00:00 GS1900 ..b........ 2 Port #2
219
220Capability Flags:
221o - Other; p - Repeater; b - Bridge; w - WLAN Access Point; r - Router;
222t - Telephone; d - DOCSIS cable device; a - Station; c - Customer VLAN;
223s - Service VLAN, m - Two-port MAC Relay (TPMR)
224
2251 neighbors listed.</programlisting></para>
d9000fd3
ZJS
226 </listitem>
227 </varlistentry>
a5be8dab
ZJS
228
229 <varlistentry>
230 <term>
231 <command>label</command>
232 </term>
233
234 <listitem><para>Show numerical address labels that can be used for address selection.
235 This is the same information that
b7a47345 236 <citerefentry project='die-net'><refentrytitle>ip-addrlabel</refentrytitle><manvolnum>8</manvolnum></citerefentry>
a5be8dab
ZJS
237 shows. See <ulink url="https://tools.ietf.org/html/rfc3484">RFC 3484</ulink>
238 for a discussion of address labels.</para>
239
240 <para>Produces output similar to:
241 <programlisting>Prefix/Prefixlen Label
242 ::/0 1
243 fc00::/7 5
244 fec0::/10 11
245 2002::/16 2
246 3ffe::/16 12
247 2001:10::/28 7
248 2001::/32 6
249::ffff:0.0.0.0/96 4
250 ::/96 3
251 ::1/128 0</programlisting></para>
252 </listitem>
253 </varlistentry>
254
9cd8c766
SS
255 <varlistentry>
256 <term>
257 <command>delete</command>
f2c676c6 258 <replaceable>DEVICE…</replaceable>
9cd8c766
SS
259 </term>
260 <listitem><para>Deletes virtual netdevs. Takes interface name or index number.</para></listitem>
261 </varlistentry>
262
c30ffcee
SS
263 <varlistentry>
264 <term>
265 <command>up</command>
f2c676c6 266 <replaceable>DEVICE…</replaceable>
c30ffcee
SS
267 </term>
268 <listitem><para>Bring devices up. Takes interface name or index number.</para></listitem>
269 </varlistentry>
270
271 <varlistentry>
272 <term>
273 <command>down</command>
f2c676c6 274 <replaceable>DEVICE…</replaceable>
c30ffcee
SS
275 </term>
276 <listitem><para>Bring devices down. Takes interface name or index number.</para></listitem>
277 </varlistentry>
278
308e7dfd
YW
279 <varlistentry>
280 <term>
281 <command>renew</command>
f2c676c6 282 <replaceable>DEVICE…</replaceable>
308e7dfd
YW
283 </term>
284 <listitem><para>Renew dynamic configurations e.g. addresses received from DHCP server.
285 Takes interface name or index number.</para></listitem>
286 </varlistentry>
287
3efdd6af
SS
288 <varlistentry>
289 <term>
290 <command>forcerenew</command>
f2c676c6 291 <replaceable>DEVICE…</replaceable>
3efdd6af
SS
292 </term>
293 <listitem><para>Send a FORCERENEW message to all connected clients, triggering DHCP reconfiguration.
294 Takes interface name or index number.</para></listitem>
295 </varlistentry>
296
8dc85c5e
YW
297 <varlistentry>
298 <term>
299 <command>reconfigure</command>
f2c676c6 300 <replaceable>DEVICE…</replaceable>
8dc85c5e 301 </term>
ed89e54a
YW
302 <listitem><para>Reconfigure network interfaces. Takes interface name or index number. Note that
303 this does not reload <filename>.netdev</filename> or <filename>.network</filename>
69e3234d 304 corresponding to the the specified interface. So, if you edit config files, it is necessary to
ed89e54a 305 call <command>networkctl reload</command> first to apply new settings.</para></listitem>
8dc85c5e
YW
306 </varlistentry>
307
a227674c
YW
308 <varlistentry>
309 <term>
310 <command>reload</command>
311 </term>
312 <listitem><para>Reload <filename>.netdev</filename> and <filename>.network</filename> files.
313 If a new <filename>.netdev</filename> file is found, then the corresponding netdev is created.
314 Note that even if an existing <filename>.netdev</filename> is modified or removed,
315 <command>systemd-networkd</command> does not update or remove the netdev.
316 If a new, modified or removed <filename>.network</filename> file is found, then all interfaces
317 which match the file are reconfigured.</para></listitem>
318 </varlistentry>
319
d9000fd3
ZJS
320 </variablelist>
321 </refsect1>
322
e1fac8a6
ZJS
323 <refsect1>
324 <title>Options</title>
325
326 <para>The following options are understood:</para>
327
328 <variablelist>
329 <varlistentry>
330 <term>
331 <option>-a</option>
332 <option>--all</option>
333 </term>
334
335 <listitem>
336 <para>Show all links with <command>status</command>.</para>
337 </listitem>
338 </varlistentry>
339
340 <varlistentry>
341 <term>
342 <option>-s</option>
343 <option>--stats</option>
344 </term>
345
346 <listitem>
347 <para>Show link statistics with <command>status</command>.</para>
10c71c36
YW
348 </listitem>
349 </varlistentry>
350
351 <varlistentry>
352 <term><option>-l</option></term>
353 <term><option>--full</option></term>
354
355 <listitem>
a42d9490 356 <para>Do not ellipsize the output.</para>
10c71c36
YW
357 </listitem>
358 </varlistentry>
359
360 <varlistentry>
361 <term><option>-n</option></term>
362 <term><option>--lines=</option></term>
363
364 <listitem>
365 <para>When used with <command>status</command>, controls the number of journal lines to show,
366 counting from the most recent ones. Takes a positive integer argument. Defaults to 10.</para>
e1fac8a6
ZJS
367 </listitem>
368 </varlistentry>
369
370 <xi:include href="standard-options.xml" xpointer="help" />
371 <xi:include href="standard-options.xml" xpointer="version" />
372 <xi:include href="standard-options.xml" xpointer="no-legend" />
373 <xi:include href="standard-options.xml" xpointer="no-pager" />
374
375 </variablelist>
376 </refsect1>
377
d9000fd3
ZJS
378 <refsect1>
379 <title>Exit status</title>
380
a5be8dab 381 <para>On success, 0 is returned, a non-zero failure code otherwise.</para>
d9000fd3
ZJS
382 </refsect1>
383
384 <refsect1>
385 <title>See Also</title>
386 <para>
387 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
388 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
a5be8dab
ZJS
389 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
390 <citerefentry project='die-net'><refentrytitle>ip</refentrytitle><manvolnum>8</manvolnum></citerefentry>
d9000fd3
ZJS
391 </para>
392 </refsect1>
393</refentry>