]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/networkctl.xml
verify: use manager_load_startable_unit_or_warn() to load units for verification
[thirdparty/systemd.git] / man / networkctl.xml
1 <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
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 This file is part of systemd.
9
10 Copyright 2015 Zbigniew Jędrzejewski-Szmek
11
12 systemd is free software; you can redistribute it and/or modify it
13 under the terms of the GNU Lesser General Public License as published by
14 the Free Software Foundation; either version 2.1 of the License, or
15 (at your option) any later version.
16
17 systemd is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Lesser General Public License for more details.
21
22 You should have received a copy of the GNU Lesser General Public License
23 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 -->
25
26 <refentry id="networkctl" conditional='ENABLE_NETWORKD'
27 xmlns:xi="http://www.w3.org/2001/XInclude">
28
29 <refentryinfo>
30 <title>networkctl</title>
31 <productname>systemd</productname>
32
33 <authorgroup>
34 <author>
35 <contrib>Documentation</contrib>
36 <firstname>Zbigniew</firstname>
37 <surname>Jędrzejewski-Szmek</surname>
38 <email>zbyszek@in.waw.pl</email>
39 </author>
40 </authorgroup>
41 </refentryinfo>
42
43 <refmeta>
44 <refentrytitle>networkctl</refentrytitle>
45 <manvolnum>1</manvolnum>
46 </refmeta>
47
48 <refnamediv>
49 <refname>networkctl</refname>
50 <refpurpose>Query the status of network links</refpurpose>
51 </refnamediv>
52
53 <refsynopsisdiv>
54 <cmdsynopsis>
55 <command>networkctl</command>
56 <arg choice="opt" rep="repeat">OPTIONS</arg>
57 <arg choice="plain">COMMAND</arg>
58 <arg choice="opt" rep="repeat">LINK</arg>
59 </cmdsynopsis>
60 </refsynopsisdiv>
61
62 <refsect1>
63 <title>Description</title>
64
65 <para><command>networkctl</command> may be used to introspect the
66 state of the network links as seen by
67 <command>systemd-networkd</command>. Please refer to
68 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
69 for an introduction to the basic concepts, functionality, and
70 configuration syntax.</para>
71 </refsect1>
72
73 <refsect1>
74 <title>Options</title>
75
76 <para>The following options are understood:</para>
77
78 <variablelist>
79 <varlistentry>
80 <term>
81 <option>-a</option>
82 <option>--all</option>
83 </term>
84
85 <listitem>
86 <para>Show all links with <command>status</command>.</para>
87 </listitem>
88 </varlistentry>
89
90 <xi:include href="standard-options.xml" xpointer="help" />
91 <xi:include href="standard-options.xml" xpointer="version" />
92 <xi:include href="standard-options.xml" xpointer="no-legend" />
93 <xi:include href="standard-options.xml" xpointer="no-pager" />
94
95 </variablelist>
96 </refsect1>
97
98 <refsect1>
99 <title>Commands</title>
100
101 <para>The following commands are understood:</para>
102
103 <variablelist>
104 <varlistentry>
105 <term>
106 <command>list</command>
107 <optional><replaceable>LINK…</replaceable></optional>
108 </term>
109
110 <listitem>
111 <para>Show a list of existing links and their status. If no further arguments are specified shows all links,
112 otherwise just the specified links. Produces output similar to:
113
114 <programlisting>IDX LINK TYPE OPERATIONAL SETUP
115 1 lo loopback carrier unmanaged
116 2 eth0 ether routable configured
117 3 virbr0 ether no-carrier unmanaged
118 4 virbr0-nic ether off unmanaged
119
120 4 links listed.</programlisting></para>
121 </listitem>
122 </varlistentry>
123
124 <varlistentry>
125 <term>
126 <command>status</command>
127 <optional><replaceable>LINK…</replaceable></optional>
128 </term>
129
130 <listitem>
131 <para>Show information about the specified links: type,
132 state, kernel module driver, hardware and IP address,
133 configured DNS servers, etc.</para>
134
135 <para>When no links are specified, an overall network status is shown. Also see the option
136 <option>--all</option>.</para>
137
138 <para>Produces output similar to:
139 <programlisting>
140 ● State: routable
141 Address: 10.193.76.5 on eth0
142 192.168.122.1 on virbr0
143 169.254.190.105 on eth0
144 fe80::5054:aa:bbbb:cccc on eth0
145 Gateway: 10.193.11.1 (CISCO SYSTEMS, INC.) on eth0
146 DNS: 8.8.8.8
147 8.8.4.4</programlisting></para>
148 </listitem>
149
150 </varlistentry>
151
152 <varlistentry>
153 <term>
154 <command>lldp</command>
155 <optional><replaceable>LINK…</replaceable></optional>
156 </term>
157
158 <listitem>
159 <para>Show discovered LLDP (Link Layer Discovery Protocol) neighbors. If one or more link names are specified
160 only neighbors on those interfaces are shown. Otherwise shows discovered neighbors on all interfaces. Note
161 that for this feature to work, <varname>LLDP=</varname> must be turned on on the specific interface, see
162 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
163 details.</para>
164
165 <para>Produces output similar to:
166 <programlisting>LINK CHASSIS ID SYSTEM NAME CAPS PORT ID PORT DESCRIPTION
167 enp0s25 00:e0:4c:00:00:00 GS1900 ..b........ 2 Port #2
168
169 Capability Flags:
170 o - Other; p - Repeater; b - Bridge; w - WLAN Access Point; r - Router;
171 t - Telephone; d - DOCSIS cable device; a - Station; c - Customer VLAN;
172 s - Service VLAN, m - Two-port MAC Relay (TPMR)
173
174 1 neighbors listed.</programlisting></para>
175 </listitem>
176 </varlistentry>
177
178 <varlistentry>
179 <term>
180 <command>label</command>
181 </term>
182
183 <listitem><para>Show numerical address labels that can be used for address selection.
184 This is the same information that
185 <citerefentry><refentrytitle>ip-addrlabel</refentrytitle><manvolnum>8</manvolnum></citerefentry>
186 shows. See <ulink url="https://tools.ietf.org/html/rfc3484">RFC 3484</ulink>
187 for a discussion of address labels.</para>
188
189 <para>Produces output similar to:
190 <programlisting>Prefix/Prefixlen Label
191 ::/0 1
192 fc00::/7 5
193 fec0::/10 11
194 2002::/16 2
195 3ffe::/16 12
196 2001:10::/28 7
197 2001::/32 6
198 ::ffff:0.0.0.0/96 4
199 ::/96 3
200 ::1/128 0</programlisting></para>
201 </listitem>
202 </varlistentry>
203
204 </variablelist>
205 </refsect1>
206
207 <refsect1>
208 <title>Exit status</title>
209
210 <para>On success, 0 is returned, a non-zero failure code otherwise.</para>
211 </refsect1>
212
213 <refsect1>
214 <title>See Also</title>
215 <para>
216 <citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
217 <citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
218 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
219 <citerefentry project='die-net'><refentrytitle>ip</refentrytitle><manvolnum>8</manvolnum></citerefentry>
220 </para>
221 </refsect1>
222 </refentry>