networkctl
(1)Query or modify the status of network links
Options
14-a--allShow all links with status. Added in version 219.
-s--statsShow link statistics with status. Added in version 243.
-l--fullDo not ellipsize the output. Added in version 245.
-n--linesWhen used with status, controls the number of journal lines to show, counting from the most recent ones. Takes a positive integer argument. Defaults to 10. Added in version 245.
--drop-inNAMEWhen used with edit, edit the drop-in file NAME instead of the main configuration file. Added in version 254.
--no-reloadWhen used with edit, mask, or unmask, systemd-networkd.service(8) or systemd-udevd.service(8) will not be reloaded after the operation finishes. Added in version 254.
--runtimeWhen used with edit or mask, operate on the file under /run/ instead of /etc/. Added in version 256.
--stdinWhen used with edit, the contents of the file will be read from standard input and the editor will not be launched. In this mode, the old contents of the file are automatically replaced. This is useful to "edit" configuration from scripts, especially so that drop-in directories are created and populated in one go. 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-passwordDo not query the user for authentication for privileged operations.
--jsonMODEShows output formatted as JSON. Expects one of "short" (for the shortest possible output without any redundant whitespace or line breaks), "pretty" (for a pretty version of the same, with indentation and line breaks) or "off" (to turn off JSON output, the default).
-h--helpPrint a short help text and exit.
--versionPrint a short version string and exit.
--no-legendDo not print the legend, i.e. column headers and the footer with hints.
--no-pagerDo not pipe output into a pager.
DESCRIPTION
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(8) 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(8) 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.