]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/networkctl.xml
Merge pull request #13423 from pwithnall/12035-session-time-limits
[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>off</term>
74 <listitem>
75 <para>the device is powered down</para>
76 </listitem>
77 </varlistentry>
78 <varlistentry>
79 <term>no-carrier</term>
80 <listitem>
81 <para>the device is powered up, but it does not yet have a carrier</para>
82 </listitem>
83 </varlistentry>
84 <varlistentry>
85 <term>dormant</term>
86 <listitem>
87 <para>the device has a carrier, but is not yet ready for normal traffic</para>
88 </listitem>
89 </varlistentry>
90 <varlistentry>
91 <term>degraded-carrier</term>
92 <listitem>
93 <para>for bond or bridge master, one of the bonding or bridge slave network interfaces is
94 in off, no-carrier, or dormant state</para>
95 </listitem>
96 </varlistentry>
97 <varlistentry>
98 <term>carrier</term>
99 <listitem>
100 <para>the link has a carrier, or for bond or bridge master, all bonding or bridge slave
101 network interfaces are enslaved to the master.</para>
102 </listitem>
103 </varlistentry>
104 <varlistentry>
105 <term>degraded</term>
106 <listitem>
107 <para>the link has carrier and addresses valid on the local link configured</para>
108 </listitem>
109 </varlistentry>
110 <varlistentry>
111 <term>enslaved</term>
112 <listitem>
113 <para>the link has carrier and is enslaved to bond or bridge master network interface</para>
114 </listitem>
115 </varlistentry>
116 <varlistentry>
117 <term>routable</term>
118 <listitem>
119 <para>the link has carrier and routable address configured</para>
120 </listitem>
121 </varlistentry>
122 </variablelist>
123 </para>
124
125 <para>The setup status is one of the following:
126 <variablelist>
127 <varlistentry>
128 <term>pending</term>
129 <listitem>
130 <para>udev is still processing the link, we don't yet know if we will manage it</para>
131 </listitem>
132 </varlistentry>
133 <varlistentry>
134 <term>failed</term>
135 <listitem>
136 <para>networkd failed to manage the link</para>
137 </listitem>
138 </varlistentry>
139 <varlistentry>
140 <term>configuring</term>
141 <listitem>
142 <para>in the process of retrieving configuration or configuring the link</para>
143 </listitem>
144 </varlistentry>
145 <varlistentry>
146 <term>configured</term>
147 <listitem>
148 <para>link configured successfully</para>
149 </listitem>
150 </varlistentry>
151 <varlistentry>
152 <term>unmanaged</term>
153 <listitem>
154 <para>networkd is not handling the link</para>
155 </listitem>
156 </varlistentry>
157 <varlistentry>
158 <term>linger</term>
159 <listitem>
160 <para>the link is gone, but has not yet been dropped by networkd</para>
161 </listitem>
162 </varlistentry>
163 </variablelist>
164 </para>
165 </listitem>
166 </varlistentry>
167
168 <varlistentry>
169 <term>
170 <command>status</command>
171 <optional><replaceable>PATTERN…</replaceable></optional>
172 </term>
173
174 <listitem>
175 <para>Show information about the specified links: type, state, kernel module driver, hardware and
176 IP address, configured DNS servers, etc. If one ore more <replaceable>PATTERN</replaceable>s are
177 specified, only links matching one of them are shown.</para>
178
179 <para>When no links are specified, an overall network status is shown. Also see the option
180 <option>--all</option>.</para>
181
182 <para>Produces output similar to:
183 <programlisting>
184 ● State: routable
185 Address: 10.193.76.5 on eth0
186 192.168.122.1 on virbr0
187 169.254.190.105 on eth0
188 fe80::5054:aa:bbbb:cccc on eth0
189 Gateway: 10.193.11.1 (CISCO SYSTEMS, INC.) on eth0
190 DNS: 8.8.8.8
191 8.8.4.4</programlisting></para>
192 </listitem>
193
194 </varlistentry>
195
196 <varlistentry>
197 <term>
198 <command>lldp</command>
199 <optional><replaceable>PATTERN…</replaceable></optional>
200 </term>
201
202 <listitem>
203 <para>Show discovered LLDP (Link Layer Discovery Protocol) neighbors. If one or more
204 <replaceable>PATTERN</replaceable>s are specified only neighbors on those interfaces are shown.
205 Otherwise shows discovered neighbors on all interfaces. Note that for this feature to work,
206 <varname>LLDP=</varname> must be turned on for the specific interface, see
207 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
208 details.</para>
209
210 <para>Produces output similar to:
211 <programlisting>LINK CHASSIS ID SYSTEM NAME CAPS PORT ID PORT DESCRIPTION
212 enp0s25 00:e0:4c:00:00:00 GS1900 ..b........ 2 Port #2
213
214 Capability Flags:
215 o - Other; p - Repeater; b - Bridge; w - WLAN Access Point; r - Router;
216 t - Telephone; d - DOCSIS cable device; a - Station; c - Customer VLAN;
217 s - Service VLAN, m - Two-port MAC Relay (TPMR)
218
219 1 neighbors listed.</programlisting></para>
220 </listitem>
221 </varlistentry>
222
223 <varlistentry>
224 <term>
225 <command>label</command>
226 </term>
227
228 <listitem><para>Show numerical address labels that can be used for address selection.
229 This is the same information that
230 <citerefentry><refentrytitle>ip-addrlabel</refentrytitle><manvolnum>8</manvolnum></citerefentry>
231 shows. See <ulink url="https://tools.ietf.org/html/rfc3484">RFC 3484</ulink>
232 for a discussion of address labels.</para>
233
234 <para>Produces output similar to:
235 <programlisting>Prefix/Prefixlen Label
236 ::/0 1
237 fc00::/7 5
238 fec0::/10 11
239 2002::/16 2
240 3ffe::/16 12
241 2001:10::/28 7
242 2001::/32 6
243 ::ffff:0.0.0.0/96 4
244 ::/96 3
245 ::1/128 0</programlisting></para>
246 </listitem>
247 </varlistentry>
248
249 <varlistentry>
250 <term>
251 <command>delete</command>
252 </term>
253 <listitem><para>Deletes virtual netdevs. Takes interface name or index number.</para></listitem>
254 </varlistentry>
255
256 <varlistentry>
257 <term>
258 <command>renew</command>
259 </term>
260 <listitem><para>Renew dynamic configurations e.g. addresses received from DHCP server.
261 Takes interface name or index number.</para></listitem>
262 </varlistentry>
263
264 <varlistentry>
265 <term>
266 <command>reconfigure</command>
267 </term>
268 <listitem><para>Reconfigure network interfaces. Takes interface name or index number.</para></listitem>
269 </varlistentry>
270
271 <varlistentry>
272 <term>
273 <command>reload</command>
274 </term>
275 <listitem><para>Reload <filename>.netdev</filename> and <filename>.network</filename> files.
276 If a new <filename>.netdev</filename> file is found, then the corresponding netdev is created.
277 Note that even if an existing <filename>.netdev</filename> is modified or removed,
278 <command>systemd-networkd</command> does not update or remove the netdev.
279 If a new, modified or removed <filename>.network</filename> file is found, then all interfaces
280 which match the file are reconfigured.</para></listitem>
281 </varlistentry>
282
283 </variablelist>
284 </refsect1>
285
286 <refsect1>
287 <title>Options</title>
288
289 <para>The following options are understood:</para>
290
291 <variablelist>
292 <varlistentry>
293 <term>
294 <option>-a</option>
295 <option>--all</option>
296 </term>
297
298 <listitem>
299 <para>Show all links with <command>status</command>.</para>
300 </listitem>
301 </varlistentry>
302
303 <varlistentry>
304 <term>
305 <option>-s</option>
306 <option>--stats</option>
307 </term>
308
309 <listitem>
310 <para>Show link statistics with <command>status</command>.</para>
311 </listitem>
312 </varlistentry>
313
314 <xi:include href="standard-options.xml" xpointer="help" />
315 <xi:include href="standard-options.xml" xpointer="version" />
316 <xi:include href="standard-options.xml" xpointer="no-legend" />
317 <xi:include href="standard-options.xml" xpointer="no-pager" />
318
319 </variablelist>
320 </refsect1>
321
322 <refsect1>
323 <title>Exit status</title>
324
325 <para>On success, 0 is returned, a non-zero failure code otherwise.</para>
326 </refsect1>
327
328 <refsect1>
329 <title>See Also</title>
330 <para>
331 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
332 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
333 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
334 <citerefentry project='die-net'><refentrytitle>ip</refentrytitle><manvolnum>8</manvolnum></citerefentry>
335 </para>
336 </refsect1>
337 </refentry>