| 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.5/docbookx.dtd"> |
| 4 |
<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
| 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 or modify 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 query or modify 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 or 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>missing</term> |
| 74 |
<listitem> |
| 75 |
<para>The device is missing.</para> |
| 76 |
|
| 77 |
<xi:include href="version-info.xml" xpointer="v245"/> |
| 78 |
</listitem> |
| 79 |
</varlistentry> |
| 80 |
<varlistentry> |
| 81 |
<term>off</term> |
| 82 |
<listitem> |
| 83 |
<para>The device is powered down.</para> |
| 84 |
|
| 85 |
<xi:include href="version-info.xml" xpointer="v240"/> |
| 86 |
</listitem> |
| 87 |
</varlistentry> |
| 88 |
<varlistentry> |
| 89 |
<term>no-carrier</term> |
| 90 |
<listitem> |
| 91 |
<para>The device is powered up, but does not yet have a carrier.</para> |
| 92 |
|
| 93 |
<xi:include href="version-info.xml" xpointer="v240"/> |
| 94 |
</listitem> |
| 95 |
</varlistentry> |
| 96 |
<varlistentry> |
| 97 |
<term>dormant</term> |
| 98 |
<listitem> |
| 99 |
<para>The device has a carrier, but is not yet ready for normal traffic.</para> |
| 100 |
|
| 101 |
<xi:include href="version-info.xml" xpointer="v240"/> |
| 102 |
</listitem> |
| 103 |
</varlistentry> |
| 104 |
<varlistentry> |
| 105 |
<term>degraded-carrier</term> |
| 106 |
<listitem> |
| 107 |
<para>One of the bonding or bridge slave network interfaces is in off, no-carrier, or |
| 108 |
dormant state, and the master interface has no address.</para> |
| 109 |
|
| 110 |
<xi:include href="version-info.xml" xpointer="v242"/> |
| 111 |
</listitem> |
| 112 |
</varlistentry> |
| 113 |
<varlistentry> |
| 114 |
<term>carrier</term> |
| 115 |
<listitem> |
| 116 |
<para>The link has carrier, or for bond or bridge master, all bonding or bridge slave |
| 117 |
network interfaces are enslaved to the master.</para> |
| 118 |
|
| 119 |
<xi:include href="version-info.xml" xpointer="v240"/> |
| 120 |
</listitem> |
| 121 |
</varlistentry> |
| 122 |
<varlistentry> |
| 123 |
<term>degraded</term> |
| 124 |
<listitem> |
| 125 |
<para>The link has carrier and addresses valid on the local link configured. For bond or |
| 126 |
bridge master this means that not all slave network interfaces have carrier but at least |
| 127 |
one does.</para> |
| 128 |
|
| 129 |
<xi:include href="version-info.xml" xpointer="v240"/> |
| 130 |
</listitem> |
| 131 |
</varlistentry> |
| 132 |
<varlistentry> |
| 133 |
<term>enslaved</term> |
| 134 |
<listitem> |
| 135 |
<para>The link has carrier and is enslaved to bond or bridge master network interface. |
| 136 |
</para> |
| 137 |
|
| 138 |
<xi:include href="version-info.xml" xpointer="v242"/> |
| 139 |
</listitem> |
| 140 |
</varlistentry> |
| 141 |
<varlistentry> |
| 142 |
<term>routable</term> |
| 143 |
<listitem> |
| 144 |
<para>The link has carrier and routable address configured. For bond or bridge master it is |
| 145 |
not necessary for all slave network interfaces to have carrier, but at least one must.</para> |
| 146 |
|
| 147 |
<xi:include href="version-info.xml" xpointer="v240"/> |
| 148 |
</listitem> |
| 149 |
</varlistentry> |
| 150 |
</variablelist> |
| 151 |
</para> |
| 152 |
|
| 153 |
<para>The setup status is one of the following: |
| 154 |
<variablelist> |
| 155 |
<varlistentry> |
| 156 |
<term>pending</term> |
| 157 |
<listitem> |
| 158 |
<para><citerefentry><refentrytitle>systemd-udevd</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 159 |
is still processing the link, we do not yet know if we will manage it.</para> |
| 160 |
|
| 161 |
<xi:include href="version-info.xml" xpointer="v240"/> |
| 162 |
</listitem> |
| 163 |
</varlistentry> |
| 164 |
<varlistentry> |
| 165 |
<term>initialized</term> |
| 166 |
<listitem> |
| 167 |
<para><citerefentry><refentrytitle>systemd-udevd</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 168 |
has processed the link, but we do not yet know if we will manage it.</para> |
| 169 |
|
| 170 |
<xi:include href="version-info.xml" xpointer="v251"/> |
| 171 |
</listitem> |
| 172 |
</varlistentry> |
| 173 |
<varlistentry> |
| 174 |
<term>configuring</term> |
| 175 |
<listitem> |
| 176 |
<para>Configuration for the link is being retrieved or the link is being configured.</para> |
| 177 |
|
| 178 |
<xi:include href="version-info.xml" xpointer="v240"/> |
| 179 |
</listitem> |
| 180 |
</varlistentry> |
| 181 |
<varlistentry> |
| 182 |
<term>configured</term> |
| 183 |
<listitem> |
| 184 |
<para>Link has been configured successfully.</para> |
| 185 |
|
| 186 |
<xi:include href="version-info.xml" xpointer="v240"/> |
| 187 |
</listitem> |
| 188 |
</varlistentry> |
| 189 |
<varlistentry> |
| 190 |
<term>unmanaged</term> |
| 191 |
<listitem> |
| 192 |
<para><command>systemd-networkd</command> is not handling the link.</para> |
| 193 |
|
| 194 |
<xi:include href="version-info.xml" xpointer="v240"/> |
| 195 |
</listitem> |
| 196 |
</varlistentry> |
| 197 |
<varlistentry> |
| 198 |
<term>failed</term> |
| 199 |
<listitem> |
| 200 |
<para><command>systemd-networkd</command> failed to configure the link.</para> |
| 201 |
|
| 202 |
<xi:include href="version-info.xml" xpointer="v240"/> |
| 203 |
</listitem> |
| 204 |
</varlistentry> |
| 205 |
<varlistentry> |
| 206 |
<term>linger</term> |
| 207 |
<listitem> |
| 208 |
<para>The link is gone, but has not yet been dropped by <command>systemd-networkd</command>.</para> |
| 209 |
|
| 210 |
<xi:include href="version-info.xml" xpointer="v240"/> |
| 211 |
</listitem> |
| 212 |
</varlistentry> |
| 213 |
</variablelist> |
| 214 |
</para> |
| 215 |
|
| 216 |
<xi:include href="version-info.xml" xpointer="v219"/> |
| 217 |
</listitem> |
| 218 |
</varlistentry> |
| 219 |
|
| 220 |
<varlistentry> |
| 221 |
<term> |
| 222 |
<command>status</command> |
| 223 |
<optional><replaceable>PATTERN…</replaceable></optional> |
| 224 |
</term> |
| 225 |
|
| 226 |
<listitem> |
| 227 |
<para>Show information about the specified links: type, state, kernel module driver, hardware and |
| 228 |
IP address, configured DNS servers, etc. If one or more <replaceable>PATTERN</replaceable>s are |
| 229 |
specified, only links matching one of them are shown.</para> |
| 230 |
|
| 231 |
<para>When no links are specified, an overall network status is shown. Also see the option |
| 232 |
<option>--all</option>.</para> |
| 233 |
|
| 234 |
<para>Produces output similar to: |
| 235 |
<programlisting> |
| 236 |
● State: routable |
| 237 |
Online state: online |
| 238 |
Address: 10.193.76.5 on eth0 |
| 239 |
192.168.122.1 on virbr0 |
| 240 |
169.254.190.105 on eth0 |
| 241 |
fe80::5054:aa:bbbb:cccc on eth0 |
| 242 |
Gateway: 10.193.11.1 (CISCO SYSTEMS, INC.) on eth0 |
| 243 |
DNS: 8.8.8.8 |
| 244 |
8.8.4.4</programlisting></para> |
| 245 |
|
| 246 |
<para>In the overall network status, the online state depends on the individual online state of all |
| 247 |
required links. Managed links are required for online by default. In this case, the online state is |
| 248 |
one of the following: |
| 249 |
<variablelist> |
| 250 |
<varlistentry> |
| 251 |
<term>unknown</term> |
| 252 |
<listitem> |
| 253 |
<para>All links have unknown online status (i.e. there are no required links).</para> |
| 254 |
|
| 255 |
<xi:include href="version-info.xml" xpointer="v249"/> |
| 256 |
</listitem> |
| 257 |
</varlistentry> |
| 258 |
<varlistentry> |
| 259 |
<term>offline</term> |
| 260 |
<listitem> |
| 261 |
<para>All required links are offline.</para> |
| 262 |
|
| 263 |
<xi:include href="version-info.xml" xpointer="v249"/> |
| 264 |
</listitem> |
| 265 |
</varlistentry> |
| 266 |
<varlistentry> |
| 267 |
<term>partial</term> |
| 268 |
<listitem> |
| 269 |
<para>Some, but not all, required links are online.</para> |
| 270 |
|
| 271 |
<xi:include href="version-info.xml" xpointer="v249"/> |
| 272 |
</listitem> |
| 273 |
</varlistentry> |
| 274 |
<varlistentry> |
| 275 |
<term>online</term> |
| 276 |
<listitem> |
| 277 |
<para>All required links are online.</para> |
| 278 |
|
| 279 |
<xi:include href="version-info.xml" xpointer="v249"/> |
| 280 |
</listitem> |
| 281 |
</varlistentry> |
| 282 |
</variablelist> |
| 283 |
</para> |
| 284 |
|
| 285 |
<xi:include href="version-info.xml" xpointer="v219"/> |
| 286 |
</listitem> |
| 287 |
|
| 288 |
</varlistentry> |
| 289 |
|
| 290 |
<varlistentry> |
| 291 |
<term> |
| 292 |
<command>dhcp-lease</command> |
| 293 |
<replaceable>INTERFACE</replaceable> |
| 294 |
<optional><replaceable>CODE<optional><replaceable>:FORMAT</replaceable></optional></replaceable></optional> |
| 295 |
… |
| 296 |
</term> |
| 297 |
|
| 298 |
<listitem> |
| 299 |
<para>Show the DHCP message of the acquired lease (i.e. the received DHCPACK message). Takes an |
| 300 |
interface name and optional DHCP option codes. If no option code is specified, both the DHCP |
| 301 |
message header and all options are shown. If one or more option codes are specified, only the |
| 302 |
specified options are shown.</para> |
| 303 |
|
| 304 |
<para>When called with the <option>--json=</option> option, the entire DHCP message is shown in |
| 305 |
JSON format. In that case, any specified option codes are ignored.</para> |
| 306 |
|
| 307 |
<para>By default, each option is displayed in a human-readable format, depending on the option. |
| 308 |
For example, DNS server addresses are shown as a list of IP addresses (e.g. |
| 309 |
<literal>192.0.2.1</literal>), and the lease time is shown as a human-readable duration (e.g. |
| 310 |
<literal>8h</literal>).</para> |
| 311 |
|
| 312 |
<para>Each option code may optionally be followed by a formatter, separated by a colon (e.g. |
| 313 |
<literal>42:address</literal>). This can be useful if the default formatting is not appropriate. |
| 314 |
</para> |
| 315 |
|
| 316 |
<para>The following formatters are supported:</para> |
| 317 |
<variablelist> |
| 318 |
<varlistentry> |
| 319 |
<term><option>auto</option></term> |
| 320 |
<listitem> |
| 321 |
<para>Use the default formatting.</para> |
| 322 |
</listitem> |
| 323 |
</varlistentry> |
| 324 |
<varlistentry> |
| 325 |
<term><option>hex</option></term> |
| 326 |
<listitem> |
| 327 |
<para>Show the raw bytes in hexadecimal, separated by colons.</para> |
| 328 |
</listitem> |
| 329 |
</varlistentry> |
| 330 |
<varlistentry> |
| 331 |
<term><option>flag</option></term> |
| 332 |
<listitem> |
| 333 |
<para>Treat the option as having zero-length data and display <literal>yes</literal>.</para> |
| 334 |
</listitem> |
| 335 |
</varlistentry> |
| 336 |
<varlistentry> |
| 337 |
<term><option>bool</option></term> |
| 338 |
<listitem> |
| 339 |
<para>Treat the option as a 1-byte boolean and display <literal>yes</literal> or <literal>no</literal>.</para> |
| 340 |
</listitem> |
| 341 |
</varlistentry> |
| 342 |
<varlistentry> |
| 343 |
<term><option>uint8</option></term> |
| 344 |
<listitem> |
| 345 |
<para>Treat the option as a 1-byte unsigned integer.</para> |
| 346 |
</listitem> |
| 347 |
</varlistentry> |
| 348 |
<varlistentry> |
| 349 |
<term><option>uint16</option></term> |
| 350 |
<listitem> |
| 351 |
<para>Treat the option as a 2-byte unsigned integer.</para> |
| 352 |
</listitem> |
| 353 |
</varlistentry> |
| 354 |
<varlistentry> |
| 355 |
<term><option>time</option></term> |
| 356 |
<listitem> |
| 357 |
<para>Treat the option as a 4-byte time value in seconds and display it as a human-readable duration.</para> |
| 358 |
</listitem> |
| 359 |
</varlistentry> |
| 360 |
<varlistentry> |
| 361 |
<term><option>string</option></term> |
| 362 |
<listitem> |
| 363 |
<para>Treat the option as a string.</para> |
| 364 |
</listitem> |
| 365 |
</varlistentry> |
| 366 |
<varlistentry> |
| 367 |
<term><option>address</option></term> |
| 368 |
<listitem> |
| 369 |
<para>Treat the option as one or more IPv4 addresses and display them in human-readable form.</para> |
| 370 |
</listitem> |
| 371 |
</varlistentry> |
| 372 |
</variablelist> |
| 373 |
|
| 374 |
<para>Produces output similar to: |
| 375 |
<programlisting>$ networkctl dhcp-lease eth0 |
| 376 |
Header: |
| 377 |
KEY VALUE |
| 378 |
Hardware Type: ETHER |
| 379 |
Hardware Address: 41:42:43:31:32:33 |
| 380 |
Client Address: 192.0.2.123 |
| 381 |
Server Address: 192.0.2.1 |
| 382 |
|
| 383 |
Options: |
| 384 |
CODE NAME DATA |
| 385 |
1 subnet mask 255.255.255.0 |
| 386 |
3 router 192.0.2.1 |
| 387 |
6 domain name server 192.0.2.1 |
| 388 |
12 hostname test-node |
| 389 |
15 domain name lan |
| 390 |
28 broadcast address 192.0.2.255 |
| 391 |
42 NTP server 192.0.2.11 |
| 392 |
192.0.2.12 |
| 393 |
51 lease time 1d |
| 394 |
53 message type 5 |
| 395 |
54 server identifier 192.0.2.1 |
| 396 |
58 renewal time 11h 5min 38s |
| 397 |
59 rebinding time 20h 5min 38s |
| 398 |
119 domain search hoge.example.com |
| 399 |
foo.example.com</programlisting> |
| 400 |
</para> |
| 401 |
|
| 402 |
<xi:include href="version-info.xml" xpointer="v261"/> |
| 403 |
</listitem> |
| 404 |
</varlistentry> |
| 405 |
|
| 406 |
<varlistentry> |
| 407 |
<term> |
| 408 |
<command>lldp</command> |
| 409 |
<optional><replaceable>PATTERN…</replaceable></optional> |
| 410 |
</term> |
| 411 |
|
| 412 |
<listitem> |
| 413 |
<para>Show discovered LLDP (Link Layer Discovery Protocol) neighbors. If one or more |
| 414 |
<replaceable>PATTERN</replaceable>s are specified only neighbors on those interfaces are shown. |
| 415 |
Otherwise, shows discovered neighbors on all interfaces. Note that for this feature to work, |
| 416 |
<varname>LLDP=</varname> must be turned on for the specific interface, see |
| 417 |
<citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry> for |
| 418 |
details.</para> |
| 419 |
|
| 420 |
<para>Produces output similar to: |
| 421 |
<programlisting>LINK SYSTEM-NAME SYSTEM-DESCRIPTION CHASSIS-ID PORT-ID PORT-DESCRIPTION CAPS |
| 422 |
enp0s25 GS1900 - 00:e0:4c:00:00:00 2 Port #2 ..b........ |
| 423 |
|
| 424 |
Capability Flags: |
| 425 |
o - Other; p - Repeater; b - Bridge; w - WLAN Access Point; r - Router; |
| 426 |
t - Telephone; d - DOCSIS cable device; a - Station; c - Customer VLAN; |
| 427 |
s - Service VLAN, m - Two-port MAC Relay (TPMR) |
| 428 |
|
| 429 |
1 neighbor(s) listed.</programlisting></para> |
| 430 |
|
| 431 |
<xi:include href="version-info.xml" xpointer="v219"/> |
| 432 |
</listitem> |
| 433 |
</varlistentry> |
| 434 |
|
| 435 |
<varlistentry> |
| 436 |
<term> |
| 437 |
<command>label</command> |
| 438 |
</term> |
| 439 |
|
| 440 |
<listitem><para>Show numerical address labels that can be used for address selection. |
| 441 |
This is the same information that |
| 442 |
<citerefentry project='die-net'><refentrytitle>ip-addrlabel</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 443 |
shows. See <ulink url="https://tools.ietf.org/html/rfc3484">RFC 3484</ulink> |
| 444 |
for a discussion of address labels.</para> |
| 445 |
|
| 446 |
<para>Produces output similar to: |
| 447 |
<programlisting>Prefix/Prefixlen Label |
| 448 |
::/0 1 |
| 449 |
fc00::/7 5 |
| 450 |
fec0::/10 11 |
| 451 |
2002::/16 2 |
| 452 |
3ffe::/16 12 |
| 453 |
2001:10::/28 7 |
| 454 |
2001::/32 6 |
| 455 |
::ffff:0.0.0.0/96 4 |
| 456 |
::/96 3 |
| 457 |
::1/128 0</programlisting></para> |
| 458 |
|
| 459 |
<xi:include href="version-info.xml" xpointer="v234"/> |
| 460 |
</listitem> |
| 461 |
</varlistentry> |
| 462 |
|
| 463 |
<varlistentry> |
| 464 |
<term> |
| 465 |
<command>delete</command> |
| 466 |
<replaceable>DEVICE…</replaceable> |
| 467 |
</term> |
| 468 |
<listitem><para>Deletes virtual netdevs. Takes interface name or index number.</para> |
| 469 |
|
| 470 |
<xi:include href="version-info.xml" xpointer="v243"/></listitem> |
| 471 |
</varlistentry> |
| 472 |
|
| 473 |
<varlistentry> |
| 474 |
<term> |
| 475 |
<command>up</command> |
| 476 |
<replaceable>DEVICE…</replaceable> |
| 477 |
</term> |
| 478 |
<listitem><para>Bring devices up. Takes interface name or index number.</para> |
| 479 |
|
| 480 |
<xi:include href="version-info.xml" xpointer="v246"/></listitem> |
| 481 |
</varlistentry> |
| 482 |
|
| 483 |
<varlistentry> |
| 484 |
<term> |
| 485 |
<command>down</command> |
| 486 |
<replaceable>DEVICE…</replaceable> |
| 487 |
</term> |
| 488 |
<listitem><para>Bring devices down. Takes interface name or index number.</para> |
| 489 |
|
| 490 |
<xi:include href="version-info.xml" xpointer="v246"/></listitem> |
| 491 |
</varlistentry> |
| 492 |
|
| 493 |
<varlistentry> |
| 494 |
<term> |
| 495 |
<command>renew</command> |
| 496 |
<replaceable>DEVICE…</replaceable> |
| 497 |
</term> |
| 498 |
<listitem><para>Renew dynamic configurations e.g. addresses received from DHCP server. |
| 499 |
Takes interface name or index number.</para> |
| 500 |
|
| 501 |
<xi:include href="version-info.xml" xpointer="v244"/></listitem> |
| 502 |
</varlistentry> |
| 503 |
|
| 504 |
<varlistentry> |
| 505 |
<term> |
| 506 |
<command>forcerenew</command> |
| 507 |
<replaceable>DEVICE…</replaceable> |
| 508 |
</term> |
| 509 |
<listitem><para>Send a FORCERENEW message to all connected clients, triggering DHCP reconfiguration. |
| 510 |
Takes interface name or index number.</para> |
| 511 |
|
| 512 |
<xi:include href="version-info.xml" xpointer="v246"/></listitem> |
| 513 |
</varlistentry> |
| 514 |
|
| 515 |
<varlistentry> |
| 516 |
<term> |
| 517 |
<command>reconfigure</command> |
| 518 |
<replaceable>DEVICE…</replaceable> |
| 519 |
</term> |
| 520 |
<listitem><para>Reconfigure network interfaces. Takes interface name or index number. Note that |
| 521 |
this does not reload <filename>.netdev</filename> or <filename>.network</filename> |
| 522 |
corresponding to the specified interface. So, if you edit config files, it is necessary to call |
| 523 |
<command>networkctl reload</command> first to apply new settings.</para> |
| 524 |
|
| 525 |
<xi:include href="version-info.xml" xpointer="v244"/></listitem> |
| 526 |
</varlistentry> |
| 527 |
|
| 528 |
<varlistentry> |
| 529 |
<term> |
| 530 |
<command>reload</command> |
| 531 |
</term> |
| 532 |
<listitem> |
| 533 |
<para>Reload <filename>.netdev</filename> and <filename>.network</filename> files.</para> |
| 534 |
|
| 535 |
<para>If a new or modified <filename>.netdev</filename> file is found, then the corresponding |
| 536 |
netdev is created or updated, respectively. Note, if the corresponding interface already exists, |
| 537 |
then some of new settings may not be applied. E.g., VLAN ID cannot be changed after the interface |
| 538 |
was created, so changing [VLAN] <varname>Id=</varname> will not take effect if the matching VLAN |
| 539 |
interface already exists. To apply such settings, the interfaces need to be removed manually before |
| 540 |
reload. Also note that even if a <filename>.netdev</filename> file is removed, |
| 541 |
<citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 542 |
does not remove the existing netdev corresponding to the file. |
| 543 |
</para> |
| 544 |
|
| 545 |
<para>If a new, modified, or removed <filename>.network</filename> file is found, then all |
| 546 |
interfaces that matched the file are reconfigured.</para> |
| 547 |
|
| 548 |
<xi:include href="version-info.xml" xpointer="v244"/> |
| 549 |
</listitem> |
| 550 |
</varlistentry> |
| 551 |
|
| 552 |
<varlistentry> |
| 553 |
<term> |
| 554 |
<command>edit</command> |
| 555 |
<replaceable>FILE</replaceable>|<replaceable>@DEVICE</replaceable>… |
| 556 |
</term> |
| 557 |
<listitem><para>Edit network configuration files, which include <filename>.network</filename>, |
| 558 |
<filename>.netdev</filename>, and <filename>.link</filename> files. If no network config file |
| 559 |
matching the given name is found, a new one will be created under <filename>/etc/</filename> or |
| 560 |
<filename>/run/</filename>, depending on whether <option>--runtime</option> is specified. |
| 561 |
Specially, if the name is prefixed by <literal>@</literal>, it will be treated as |
| 562 |
a network interface, and editing will be performed on the network config files associated |
| 563 |
with it. Additionally, the interface name can be suffixed with <literal>:network</literal> (default), |
| 564 |
<literal>:link</literal>, or <literal>:netdev</literal>, in order to choose the type of network config |
| 565 |
to operate on.</para> |
| 566 |
|
| 567 |
<para>If <option>--drop-in=</option> is specified, edit the drop-in file instead of |
| 568 |
the main configuration file. Unless <option>--no-reload</option> is specified, |
| 569 |
<citerefentry><refentrytitle>systemd-networkd</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 570 |
will be reloaded after the edit of the <filename>.network</filename> or <filename>.netdev</filename> |
| 571 |
files finishes. The same applies for <filename>.link</filename> files and |
| 572 |
<citerefentry><refentrytitle>systemd-udevd</refentrytitle><manvolnum>8</manvolnum></citerefentry>. |
| 573 |
Note that the changed link settings are not automatically applied after reloading. |
| 574 |
To achieve that, trigger uevents for the corresponding interface. Refer to |
| 575 |
<citerefentry><refentrytitle>systemd.link</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
| 576 |
for more information.</para> |
| 577 |
|
| 578 |
<para>If <option>--stdin</option> is specified, the new content will be read from standard input. |
| 579 |
In this mode, the old content of the file is discarded.</para> |
| 580 |
|
| 581 |
<xi:include href="version-info.xml" xpointer="v254"/></listitem> |
| 582 |
</varlistentry> |
| 583 |
|
| 584 |
<varlistentry> |
| 585 |
<term> |
| 586 |
<command>cat</command> |
| 587 |
<optional><replaceable>FILE</replaceable>|<replaceable>@DEVICE</replaceable>…</optional> |
| 588 |
</term> |
| 589 |
<listitem> |
| 590 |
<para>Show network configuration files. This command honors the <literal>@</literal> prefix in a |
| 591 |
similar way as <command>edit</command>, with support for an additional suffix <literal>:all</literal> |
| 592 |
for showing all types of configuration files associated with the interface at once. When no argument |
| 593 |
is specified, <citerefentry><refentrytitle>networkd.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
| 594 |
and its drop-in files will be shown.</para> |
| 595 |
|
| 596 |
<xi:include href="version-info.xml" xpointer="v254"/> |
| 597 |
</listitem> |
| 598 |
</varlistentry> |
| 599 |
|
| 600 |
<varlistentry> |
| 601 |
<term> |
| 602 |
<command>mask</command> |
| 603 |
<replaceable>FILE</replaceable>… |
| 604 |
</term> |
| 605 |
<listitem><para>Mask network configuration files, which include <filename>.network</filename>, |
| 606 |
<filename>.netdev</filename>, and <filename>.link</filename> files. A symlink of the given name will |
| 607 |
be created under <filename>/etc/</filename> or <filename>/run/</filename>, depending on |
| 608 |
whether <option>--runtime</option> is specified, that points to <filename>/dev/null</filename>. |
| 609 |
If a non-empty config file with the specified name exists under the target directory or a directory |
| 610 |
with higher priority (e.g. <option>--runtime</option> is used while an existing config resides |
| 611 |
in <filename>/etc/</filename>), the operation is aborted.</para> |
| 612 |
|
| 613 |
<para>This command honors <option>--no-reload</option> in the same way as <command>edit</command>. |
| 614 |
</para> |
| 615 |
|
| 616 |
<xi:include href="version-info.xml" xpointer="v256"/></listitem> |
| 617 |
</varlistentry> |
| 618 |
|
| 619 |
<varlistentry> |
| 620 |
<term> |
| 621 |
<command>unmask</command> |
| 622 |
<replaceable>FILE</replaceable>… |
| 623 |
</term> |
| 624 |
<listitem><para>Unmask network configuration files, i.e. reverting the effect of <command>mask</command>. |
| 625 |
Note that this command operates regardless of the scope of the directory, i.e. <option>--runtime</option> |
| 626 |
is of no effect.</para> |
| 627 |
|
| 628 |
<para>This command honors <option>--no-reload</option> in the same way as <command>edit</command> |
| 629 |
and <command>mask</command>.</para> |
| 630 |
|
| 631 |
<xi:include href="version-info.xml" xpointer="v256"/></listitem> |
| 632 |
</varlistentry> |
| 633 |
|
| 634 |
<varlistentry> |
| 635 |
<term> |
| 636 |
<command>persistent-storage</command> |
| 637 |
<replaceable>BOOL</replaceable> |
| 638 |
</term> |
| 639 |
<listitem> |
| 640 |
<para>Notify |
| 641 |
<citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 642 |
that the persistent storage for the service is ready. This is called by |
| 643 |
<filename>systemd-networkd-persistent-storage.service</filename>. Usually, this command should not |
| 644 |
be called manually by users or administrators.</para> |
| 645 |
|
| 646 |
<xi:include href="version-info.xml" xpointer="v256"/> |
| 647 |
</listitem> |
| 648 |
</varlistentry> |
| 649 |
</variablelist> |
| 650 |
</refsect1> |
| 651 |
|
| 652 |
<refsect1> |
| 653 |
<title>Options</title> |
| 654 |
|
| 655 |
<para>The following options are understood:</para> |
| 656 |
|
| 657 |
<variablelist> |
| 658 |
<varlistentry> |
| 659 |
<term> |
| 660 |
<option>-a</option> |
| 661 |
<option>--all</option> |
| 662 |
</term> |
| 663 |
|
| 664 |
<listitem> |
| 665 |
<para>Show all links with <command>status</command>.</para> |
| 666 |
|
| 667 |
<xi:include href="version-info.xml" xpointer="v219"/> |
| 668 |
</listitem> |
| 669 |
</varlistentry> |
| 670 |
|
| 671 |
<varlistentry> |
| 672 |
<term> |
| 673 |
<option>-s</option> |
| 674 |
<option>--stats</option> |
| 675 |
</term> |
| 676 |
|
| 677 |
<listitem> |
| 678 |
<para>Show link statistics with <command>status</command>.</para> |
| 679 |
|
| 680 |
<xi:include href="version-info.xml" xpointer="v243"/> |
| 681 |
</listitem> |
| 682 |
</varlistentry> |
| 683 |
|
| 684 |
<varlistentry> |
| 685 |
<term><option>-l</option></term> |
| 686 |
<term><option>--full</option></term> |
| 687 |
|
| 688 |
<listitem> |
| 689 |
<para>Do not ellipsize the output.</para> |
| 690 |
|
| 691 |
<xi:include href="version-info.xml" xpointer="v245"/> |
| 692 |
</listitem> |
| 693 |
</varlistentry> |
| 694 |
|
| 695 |
<varlistentry> |
| 696 |
<term><option>-n</option></term> |
| 697 |
<term><option>--lines=</option></term> |
| 698 |
|
| 699 |
<listitem> |
| 700 |
<para>When used with <command>status</command>, controls the number of journal lines to show, |
| 701 |
counting from the most recent ones. Takes a positive integer argument. Defaults to 10.</para> |
| 702 |
|
| 703 |
<xi:include href="version-info.xml" xpointer="v245"/> |
| 704 |
</listitem> |
| 705 |
</varlistentry> |
| 706 |
|
| 707 |
<varlistentry> |
| 708 |
<term><option>--drop-in=<replaceable>NAME</replaceable></option></term> |
| 709 |
|
| 710 |
<listitem> |
| 711 |
<para>When used with <command>edit</command>, edit the drop-in file <replaceable>NAME</replaceable> |
| 712 |
instead of the main configuration file.</para> |
| 713 |
|
| 714 |
<xi:include href="version-info.xml" xpointer="v254"/> |
| 715 |
</listitem> |
| 716 |
</varlistentry> |
| 717 |
|
| 718 |
<varlistentry> |
| 719 |
<term><option>--no-reload</option></term> |
| 720 |
|
| 721 |
<listitem> |
| 722 |
<para>When used with <command>edit</command>, <command>mask</command>, or <command>unmask</command>, |
| 723 |
<citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 724 |
or |
| 725 |
<citerefentry><refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 726 |
will not be reloaded after the operation finishes.</para> |
| 727 |
|
| 728 |
<xi:include href="version-info.xml" xpointer="v254"/> |
| 729 |
</listitem> |
| 730 |
</varlistentry> |
| 731 |
|
| 732 |
<varlistentry> |
| 733 |
<term><option>--runtime</option></term> |
| 734 |
|
| 735 |
<listitem> |
| 736 |
<para>When used with <command>edit</command> or <command>mask</command>, |
| 737 |
operate on the file under <filename>/run/</filename> instead of <filename>/etc/</filename>.</para> |
| 738 |
|
| 739 |
<xi:include href="version-info.xml" xpointer="v256"/> |
| 740 |
</listitem> |
| 741 |
</varlistentry> |
| 742 |
|
| 743 |
<varlistentry> |
| 744 |
<term><option>--stdin</option></term> |
| 745 |
|
| 746 |
<listitem> |
| 747 |
<para>When used with <command>edit</command>, the contents of the file will be read from standard |
| 748 |
input and the editor will not be launched. In this mode, the old contents of the file are |
| 749 |
automatically replaced. This is useful to "edit" configuration from scripts, especially so that |
| 750 |
drop-in directories are created and populated in one go.</para> |
| 751 |
|
| 752 |
<para>Multiple drop-ins may be "edited" in this mode with <option>--drop-in=</option>, and |
| 753 |
the same contents will be written to all of them. Otherwise, exactly one main configuration file |
| 754 |
is expected.</para> |
| 755 |
|
| 756 |
<xi:include href="version-info.xml" xpointer="v257"/> |
| 757 |
</listitem> |
| 758 |
</varlistentry> |
| 759 |
|
| 760 |
<xi:include href="standard-options.xml" xpointer="no-ask-password" /> |
| 761 |
<xi:include href="standard-options.xml" xpointer="json" /> |
| 762 |
<xi:include href="standard-options.xml" xpointer="help" /> |
| 763 |
<xi:include href="standard-options.xml" xpointer="version" /> |
| 764 |
<xi:include href="standard-options.xml" xpointer="no-legend" /> |
| 765 |
<xi:include href="standard-options.xml" xpointer="no-pager" /> |
| 766 |
</variablelist> |
| 767 |
</refsect1> |
| 768 |
|
| 769 |
<refsect1> |
| 770 |
<title>Exit status</title> |
| 771 |
|
| 772 |
<para>On success, 0 is returned, a non-zero failure code otherwise.</para> |
| 773 |
</refsect1> |
| 774 |
|
| 775 |
<refsect1> |
| 776 |
<title>See Also</title> |
| 777 |
<para><simplelist type="inline"> |
| 778 |
<member><citerefentry><refentrytitle>systemd-networkd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 779 |
<member><citerefentry><refentrytitle>systemd.network</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> |
| 780 |
<member><citerefentry><refentrytitle>systemd.netdev</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> |
| 781 |
<member><citerefentry project='die-net'><refentrytitle>ip</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 782 |
</simplelist></para> |
| 783 |
</refsect1> |
| 784 |
</refentry> |