]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/networkctl.xml
test-hostname-util: add assert_se's to make coverity happy
[thirdparty/systemd.git] / man / networkctl.xml
CommitLineData
d9000fd3
ZJS
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"
12b42c76 3"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
d9000fd3
ZJS
4
5<!--
572eb058
ZJS
6 SPDX-License-Identifier: LGPL-2.1+
7
b975b0d5 8 This file is part of systemd.
d9000fd3 9
b975b0d5 10 Copyright 2015 Zbigniew Jędrzejewski-Szmek
d9000fd3 11
b975b0d5
ZJS
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.
d9000fd3 16
b975b0d5
ZJS
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.
d9000fd3 21
b975b0d5
ZJS
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/>.
d9000fd3
ZJS
24-->
25
e6de49ab 26<refentry id="networkctl" conditional='ENABLE_NETWORKD'
d9000fd3
ZJS
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>
cc98b302 50 <refpurpose>Query the status of network links</refpurpose>
d9000fd3
ZJS
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>
1d3eaa93 69 for an introduction to the basic concepts, functionality, and
d9000fd3
ZJS
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" />
400f73d9 92 <xi:include href="standard-options.xml" xpointer="no-legend" />
d9000fd3
ZJS
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>
1eecafb8 107 <optional><replaceable>LINK…</replaceable></optional>
d9000fd3
ZJS
108 </term>
109
110 <listitem>
e997c4b0
LP
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
d9000fd3
ZJS
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
1204 links listed.</programlisting></para>
121 </listitem>
122 </varlistentry>
123
124 <varlistentry>
125 <term>
126 <command>status</command>
1eecafb8 127 <optional><replaceable>LINK…</replaceable></optional>
d9000fd3
ZJS
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
e997c4b0
LP
135 <para>When no links are specified, an overall network status is shown. Also see the option
136 <option>--all</option>.</para>
d9000fd3 137
e997c4b0 138 <para>Produces output similar to:
d9000fd3
ZJS
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>
1eecafb8 155 <optional><replaceable>LINK…</replaceable></optional>
d9000fd3
ZJS
156 </term>
157
158 <listitem>
e997c4b0
LP
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
167enp0s25 00:e0:4c:00:00:00 GS1900 ..b........ 2 Port #2
168
169Capability Flags:
170o - Other; p - Repeater; b - Bridge; w - WLAN Access Point; r - Router;
171t - Telephone; d - DOCSIS cable device; a - Station; c - Customer VLAN;
172s - Service VLAN, m - Two-port MAC Relay (TPMR)
173
1741 neighbors listed.</programlisting></para>
d9000fd3
ZJS
175 </listitem>
176 </varlistentry>
a5be8dab
ZJS
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
d9000fd3
ZJS
204 </variablelist>
205 </refsect1>
206
207 <refsect1>
208 <title>Exit status</title>
209
a5be8dab 210 <para>On success, 0 is returned, a non-zero failure code otherwise.</para>
d9000fd3
ZJS
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>,
a5be8dab
ZJS
218 <citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
219 <citerefentry project='die-net'><refentrytitle>ip</refentrytitle><manvolnum>8</manvolnum></citerefentry>
d9000fd3
ZJS
220 </para>
221 </refsect1>
222</refentry>