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