table of contents
- bookworm 252.33-1~deb12u1
- bookworm-backports 254.22-1~bpo12+1
- testing 257.2-3
- unstable 257.2-3
NETWORKCTL(1) | networkctl | NETWORKCTL(1) |
NAME¶
networkctl - Query or modify the status of network links
SYNOPSIS¶
networkctl [OPTIONS...] COMMAND [LINK...]
DESCRIPTION¶
networkctl may be used to query or modify the state of the network links as seen by systemd-networkd. Please refer to systemd-networkd.service(8) for an introduction to the basic concepts, functionality, and configuration syntax.
COMMANDS¶
The following commands are understood:
list [PATTERN...]
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 eth0 ether routable configured
3 virbr0 ether no-carrier unmanaged
4 virbr0-nic ether off unmanaged 4 links listed.
The operational status is one of the following:
missing
Added in version 245.
off
Added in version 240.
no-carrier
Added in version 240.
dormant
Added in version 240.
degraded-carrier
Added in version 242.
carrier
Added in version 240.
degraded
Added in version 240.
enslaved
Added in version 242.
routable
Added in version 240.
The setup status is one of the following:
pending
Added in version 240.
initialized
Added in version 251.
configuring
Added in version 240.
configured
Added in version 240.
unmanaged
Added in version 240.
failed
Added in version 240.
linger
Added in version 240.
Added in version 219.
status [PATTERN...]
When no links are specified, an overall network status is shown. Also see the option --all.
Produces output similar to:
● State: routable
Online state: online
Address: 10.193.76.5 on eth0
192.168.122.1 on virbr0
169.254.190.105 on eth0
fe80::5054:aa:bbbb:cccc on eth0
Gateway: 10.193.11.1 (CISCO SYSTEMS, INC.) on eth0
DNS: 8.8.8.8
8.8.4.4
In the overall network status, the online state depends on the individual online state of all required links. Managed links are required for online by default. In this case, the online state is one of the following:
unknown
Added in version 249.
offline
Added in version 249.
partial
Added in version 249.
online
Added in version 249.
Added in version 219.
lldp [PATTERN...]
Produces output similar to:
LINK SYSTEM-NAME SYSTEM-DESCRIPTION CHASSIS-ID PORT-ID PORT-DESCRIPTION CAPS enp0s25 GS1900 - 00:e0:4c:00:00:00 2 Port #2 ..b........ Capability Flags: o - Other; p - Repeater; b - Bridge; w - WLAN Access Point; r - Router; t - Telephone; d - DOCSIS cable device; a - Station; c - Customer VLAN; s - Service VLAN, m - Two-port MAC Relay (TPMR) 1 neighbor(s) listed.
Added in version 219.
label
Produces output similar to:
Prefix/Prefixlen Label
::/0 1
fc00::/7 5
fec0::/10 11
2002::/16 2
3ffe::/16 12
2001:10::/28 7
2001::/32 6 ::ffff:0.0.0.0/96 4
::/96 3
::1/128 0
Added in version 234.
delete DEVICE...
Added in version 243.
up DEVICE...
Added in version 246.
down DEVICE...
Added in version 246.
renew DEVICE...
Added in version 244.
forcerenew DEVICE...
Added in version 246.
reconfigure DEVICE...
Added in version 244.
reload
If a new or modified .netdev file is found, then the corresponding netdev is created or updated, respectively. Note, if the corresponding interface already exists, then some of new settings may not be applied. E.g., VLAN ID cannot be changed after the interface was created, so changing [VLAN] Id= will not take effect if the matching VLAN interface already exists. To apply such settings, the interfaces need to be removed manually before reload. Also note that even if a .netdev file is removed, systemd-networkd does not remove the existing netdev corresponding to the file.
If a new, modified, or removed .network file is found, then all interfaces that matched the file are reconfigured.
Added in version 244.
edit FILE|@DEVICE...
If --drop-in= is specified, edit the drop-in file instead of the main configuration file. Unless --no-reload is specified, systemd-networkd will be reloaded after the edit of the .network or .netdev files finishes. The same applies for .link files and systemd-udevd(8). Note that the changed link settings are not automatically applied after reloading. To achieve that, trigger uevents for the corresponding interface. Refer to systemd.link(5) for more information.
If --stdin is specified, the new content will be read from standard input. In this mode, the old content of the file is discarded.
Added in version 254.
cat [FILE|@DEVICE...]
Added in version 254.
mask FILE...
This command honors --no-reload in the same way as edit.
Added in version 256.
unmask FILE...
This command honors --no-reload in the same way as edit and mask.
Added in version 256.
persistent-storage BOOL
Added in version 256.
OPTIONS¶
The following options are understood:
-a --all
Added in version 219.
-s --stats
Added in version 243.
-l, --full
Added in version 245.
-n, --lines=
Added in version 245.
--drop-in=NAME
Added in version 254.
--no-reload
Added in version 254.
--runtime
Added in version 256.
--stdin
Multiple drop-ins may be "edited" in this mode with --drop-in=, and the same contents will be written to all of them. Otherwise exactly one main configuration file is expected.
Added in version 257.
--no-ask-password
--json=MODE
-h, --help
--version
--no-legend
--no-pager
EXIT STATUS¶
On success, 0 is returned, a non-zero failure code otherwise.
SEE ALSO¶
systemd-networkd.service(8), systemd.network(5), systemd.netdev(5), ip(8)
NOTES¶
- 1.
- RFC 3484
systemd 257.2 |