]>
Commit | Line | Data |
---|---|---|
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 | ||
68 | 4 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 | |
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> | |
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 | |
236 | <citerefentry><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 | ||
9cd8c766 SS |
255 | <varlistentry> |
256 | <term> | |
257 | <command>delete</command> | |
258 | </term> | |
259 | <listitem><para>Deletes virtual netdevs. Takes interface name or index number.</para></listitem> | |
260 | </varlistentry> | |
261 | ||
c30ffcee SS |
262 | <varlistentry> |
263 | <term> | |
264 | <command>up</command> | |
265 | </term> | |
266 | <listitem><para>Bring devices up. Takes interface name or index number.</para></listitem> | |
267 | </varlistentry> | |
268 | ||
269 | <varlistentry> | |
270 | <term> | |
271 | <command>down</command> | |
272 | </term> | |
273 | <listitem><para>Bring devices down. Takes interface name or index number.</para></listitem> | |
274 | </varlistentry> | |
275 | ||
308e7dfd YW |
276 | <varlistentry> |
277 | <term> | |
278 | <command>renew</command> | |
279 | </term> | |
280 | <listitem><para>Renew dynamic configurations e.g. addresses received from DHCP server. | |
281 | Takes interface name or index number.</para></listitem> | |
282 | </varlistentry> | |
283 | ||
3efdd6af SS |
284 | <varlistentry> |
285 | <term> | |
286 | <command>forcerenew</command> | |
287 | </term> | |
288 | <listitem><para>Send a FORCERENEW message to all connected clients, triggering DHCP reconfiguration. | |
289 | Takes interface name or index number.</para></listitem> | |
290 | </varlistentry> | |
291 | ||
8dc85c5e YW |
292 | <varlistentry> |
293 | <term> | |
294 | <command>reconfigure</command> | |
295 | </term> | |
296 | <listitem><para>Reconfigure network interfaces. Takes interface name or index number.</para></listitem> | |
297 | </varlistentry> | |
298 | ||
a227674c YW |
299 | <varlistentry> |
300 | <term> | |
301 | <command>reload</command> | |
302 | </term> | |
303 | <listitem><para>Reload <filename>.netdev</filename> and <filename>.network</filename> files. | |
304 | If a new <filename>.netdev</filename> file is found, then the corresponding netdev is created. | |
305 | Note that even if an existing <filename>.netdev</filename> is modified or removed, | |
306 | <command>systemd-networkd</command> does not update or remove the netdev. | |
307 | If a new, modified or removed <filename>.network</filename> file is found, then all interfaces | |
308 | which match the file are reconfigured.</para></listitem> | |
309 | </varlistentry> | |
310 | ||
d9000fd3 ZJS |
311 | </variablelist> |
312 | </refsect1> | |
313 | ||
e1fac8a6 ZJS |
314 | <refsect1> |
315 | <title>Options</title> | |
316 | ||
317 | <para>The following options are understood:</para> | |
318 | ||
319 | <variablelist> | |
320 | <varlistentry> | |
321 | <term> | |
322 | <option>-a</option> | |
323 | <option>--all</option> | |
324 | </term> | |
325 | ||
326 | <listitem> | |
327 | <para>Show all links with <command>status</command>.</para> | |
328 | </listitem> | |
329 | </varlistentry> | |
330 | ||
331 | <varlistentry> | |
332 | <term> | |
333 | <option>-s</option> | |
334 | <option>--stats</option> | |
335 | </term> | |
336 | ||
337 | <listitem> | |
338 | <para>Show link statistics with <command>status</command>.</para> | |
10c71c36 YW |
339 | </listitem> |
340 | </varlistentry> | |
341 | ||
342 | <varlistentry> | |
343 | <term><option>-l</option></term> | |
344 | <term><option>--full</option></term> | |
345 | ||
346 | <listitem> | |
a42d9490 | 347 | <para>Do not ellipsize the output.</para> |
10c71c36 YW |
348 | </listitem> |
349 | </varlistentry> | |
350 | ||
351 | <varlistentry> | |
352 | <term><option>-n</option></term> | |
353 | <term><option>--lines=</option></term> | |
354 | ||
355 | <listitem> | |
356 | <para>When used with <command>status</command>, controls the number of journal lines to show, | |
357 | counting from the most recent ones. Takes a positive integer argument. Defaults to 10.</para> | |
e1fac8a6 ZJS |
358 | </listitem> |
359 | </varlistentry> | |
360 | ||
361 | <xi:include href="standard-options.xml" xpointer="help" /> | |
362 | <xi:include href="standard-options.xml" xpointer="version" /> | |
363 | <xi:include href="standard-options.xml" xpointer="no-legend" /> | |
364 | <xi:include href="standard-options.xml" xpointer="no-pager" /> | |
365 | ||
366 | </variablelist> | |
367 | </refsect1> | |
368 | ||
d9000fd3 ZJS |
369 | <refsect1> |
370 | <title>Exit status</title> | |
371 | ||
a5be8dab | 372 | <para>On success, 0 is returned, a non-zero failure code otherwise.</para> |
d9000fd3 ZJS |
373 | </refsect1> |
374 | ||
375 | <refsect1> | |
376 | <title>See Also</title> | |
377 | <para> | |
378 | <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
379 | <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
a5be8dab ZJS |
380 | <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
381 | <citerefentry project='die-net'><refentrytitle>ip</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
d9000fd3 ZJS |
382 | </para> |
383 | </refsect1> | |
384 | </refentry> |