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