]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/networkctl.xml
Merge pull request #17238 from keszybz/man-tmp-noexec
[thirdparty/systemd.git] / man / networkctl.xml
1 <?xml version='1.0'?>
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+ -->
5
6 <refentry id="networkctl" conditional='ENABLE_NETWORKD'
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8
9 <refentryinfo>
10 <title>networkctl</title>
11 <productname>systemd</productname>
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>networkctl</refentrytitle>
16 <manvolnum>1</manvolnum>
17 </refmeta>
18
19 <refnamediv>
20 <refname>networkctl</refname>
21 <refpurpose>Query the status of network links</refpurpose>
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>
40 for an introduction to the basic concepts, functionality, and
41 configuration syntax.</para>
42 </refsect1>
43
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>
53 <optional><replaceable>PATTERN…</replaceable></optional>
54 </term>
55
56 <listitem>
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,
60 otherwise just the specified links. Produces output similar to:
61
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
67
68 4 links listed.</programlisting></para>
69
70 <para>The operational status is one of the following:
71 <variablelist>
72 <varlistentry>
73 <term>missing</term>
74 <listitem>
75 <para>the device is missing</para>
76 </listitem>
77 </varlistentry>
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>
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>
103 <varlistentry>
104 <term>carrier</term>
105 <listitem>
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>
108 </listitem>
109 </varlistentry>
110 <varlistentry>
111 <term>degraded</term>
112 <listitem>
113 <para>the link has carrier and addresses valid on the local link configured</para>
114 </listitem>
115 </varlistentry>
116 <varlistentry>
117 <term>enslaved</term>
118 <listitem>
119 <para>the link has carrier and is enslaved to bond or bridge master network interface</para>
120 </listitem>
121 </varlistentry>
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>
171 </listitem>
172 </varlistentry>
173
174 <varlistentry>
175 <term>
176 <command>status</command>
177 <optional><replaceable>PATTERN…</replaceable></optional>
178 </term>
179
180 <listitem>
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>
184
185 <para>When no links are specified, an overall network status is shown. Also see the option
186 <option>--all</option>.</para>
187
188 <para>Produces output similar to:
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>
205 <optional><replaceable>PATTERN…</replaceable></optional>
206 </term>
207
208 <listitem>
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
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
218 enp0s25 00:e0:4c:00:00:00 GS1900 ..b........ 2 Port #2
219
220 Capability Flags:
221 o - Other; p - Repeater; b - Bridge; w - WLAN Access Point; r - Router;
222 t - Telephone; d - DOCSIS cable device; a - Station; c - Customer VLAN;
223 s - Service VLAN, m - Two-port MAC Relay (TPMR)
224
225 1 neighbors listed.</programlisting></para>
226 </listitem>
227 </varlistentry>
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
236 <citerefentry project='die-net'><refentrytitle>ip-addrlabel</refentrytitle><manvolnum>8</manvolnum></citerefentry>
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
255 <varlistentry>
256 <term>
257 <command>delete</command>
258 <replaceable>DEVICE…</replaceable>
259 </term>
260 <listitem><para>Deletes virtual netdevs. Takes interface name or index number.</para></listitem>
261 </varlistentry>
262
263 <varlistentry>
264 <term>
265 <command>up</command>
266 <replaceable>DEVICE…</replaceable>
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>
274 <replaceable>DEVICE…</replaceable>
275 </term>
276 <listitem><para>Bring devices down. Takes interface name or index number.</para></listitem>
277 </varlistentry>
278
279 <varlistentry>
280 <term>
281 <command>renew</command>
282 <replaceable>DEVICE…</replaceable>
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
288 <varlistentry>
289 <term>
290 <command>forcerenew</command>
291 <replaceable>DEVICE…</replaceable>
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
297 <varlistentry>
298 <term>
299 <command>reconfigure</command>
300 <replaceable>DEVICE…</replaceable>
301 </term>
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>
304 corresponding to the the specified interface. So, if you edit config files, it is necessary to
305 call <command>networkctl reload</command> first to apply new settings.</para></listitem>
306 </varlistentry>
307
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
320 </variablelist>
321 </refsect1>
322
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>
348 </listitem>
349 </varlistentry>
350
351 <varlistentry>
352 <term><option>-l</option></term>
353 <term><option>--full</option></term>
354
355 <listitem>
356 <para>Do not ellipsize the output.</para>
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>
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
378 <refsect1>
379 <title>Exit status</title>
380
381 <para>On success, 0 is returned, a non-zero failure code otherwise.</para>
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>,
389 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
390 <citerefentry project='die-net'><refentrytitle>ip</refentrytitle><manvolnum>8</manvolnum></citerefentry>
391 </para>
392 </refsect1>
393 </refentry>