NETWORKCTL(1)
๐ NAME ๐
networkctl โ query or modify the status of network links ๐ฆ
okay so this is the networkctl(1) manual page, and we are getting through it together, bestie. no cap.
โจ SYNOPSIS โจ
networkctl [OPTIONS...] COMMAND [LINK...]
๐ DESCRIPTION ๐
networkctl is the girl you call when you wanna query or modify the state of the network links as seen by systemd-networkd. that's the whole vibe. ๐
and if you need the actual intro โ the basic concepts, the functionality, the configuration syntax โ go read systemd-networkd.service(8). it's giving prerequisite reading, iykyk. ๐
๐ COMMANDS ๐
the following commands are understood. all of them. every single one. we're not skipping, periodt. ๐
๐ list [PATTERN...]
shows you a list of the existing links and their status, like a little roster. ๐ซถ if one or more *PATTERN*s get specified, only links matching one of them are shown. if no further arguments are specified it shows all links, otherwise just the specified links.
produces output similar to:
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โ the device is missing. just... not there. gone. ๐ Added in version 245.offโ the device is powered down. Added in version 240.no-carrierโ the device is powered up, but it does not yet have a carrier. Added in version 240.dormantโ the device has a carrier, but it is not yet ready for normal traffic. Added in version 240.degraded-carrierโ one of the bonding or bridge slave network interfaces is inoff,no-carrier, ordormantstate, and the master interface has no address. Added in version 242.carrierโ the link has carrier, or, for a bond or bridge master, all bonding or bridge slave network interfaces are enslaved to the master. Added in version 240.degradedโ the link has carrier and addresses valid on the local link configured. for a bond or bridge master this means that not all slave network interfaces have carrier but at least one does. Added in version 240.enslavedโ the link has carrier and is enslaved to a bond or bridge master network interface. Added in version 242.routableโ the link has carrier and a routable address configured. for a bond or bridge master it is not necessary for all slave network interfaces to have carrier, but at least one must. Added in version 240.
and the setup status is one of the following:
pendingโsystemd-udevd(8)is still processing the link, we do not yet know if we will manage it. Added in version 240.initializedโsystemd-udevd(8)has processed the link, but we do not yet know if we will manage it. Added in version 251.configuringโ configuration for the link is being retrieved, or the link is being configured. Added in version 240.configuredโ link has been configured successfully. slay. Added in version 240.unmanagedโsystemd-networkdis not handling the link. not her problem, not her business. Added in version 240.failedโsystemd-networkdfailed to configure the link. ๐ญ Added in version 240.lingerโ the link is gone, but it has not yet been dropped bysystemd-networkd. it's lingering, bestie. Added in version 240.
Added in version 219.
๐ status [PATTERN...]
shows you info about the specified links: type, state, kernel module driver, hardware and IP address, configured DNS servers, etc. etc. if one or more *PATTERN*s are specified, only links matching one of them are shown. โจ
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 that 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 that case, the online state is one of the following:
unknownโ all links have unknown online status (i.e. there are no required links). Added in version 249.offlineโ all required links are offline. Added in version 249.partialโ some, but not all, required links are online. it's giving half-there. Added in version 249.onlineโ all required links are online. ๐ Added in version 249.
Added in version 219.
๐งพ dhcp-lease INTERFACE [CODE[:FORMAT]] ...
shows the DHCP message of the acquired lease (i.e. the received DHCPACK message). takes an interface name and optional DHCP option codes. if no option code is specified, both the DHCP message header and all options are shown. if one or more option codes are specified, only the specified options are shown. ๐
when called with the --json= option, the entire DHCP message is shown in JSON format. in that case, any specified option codes are ignored. ok noted.
by default, each option is displayed in a human-readable format, depending on the option. for example, DNS server addresses are shown as a list of IP addresses (e.g. "192.0.2.1"), and the lease time is shown as a human-readable duration (e.g. "8h").
each option code may optionally be followed by a formatter, separated by a colon (e.g. "42:address"). this can be useful if the default formatting is not appropriate. ๐
the following formatters are supported:
autoโ use the default formatting.hexโ show the raw bytes in hexadecimal, separated by colons.flagโ treat the option as having zero-length data and display"yes".boolโ treat the option as a 1-byte boolean and display"yes"or"no".uint8โ treat the option as a 1-byte unsigned integer.uint16โ treat the option as a 2-byte unsigned integer.timeโ treat the option as a 4-byte time value in seconds and display it as a human-readable duration.stringโ treat the option as a string.addressโ treat the option as one or more IPv4 addresses and display them in human-readable form.
produces output similar to:
$ networkctl dhcp-lease eth0
Header:
KEY VALUE
Hardware Type: ETHER
Hardware Address: 41:42:43:31:32:33
Client Address: 192.0.2.123
Server Address: 192.0.2.1
Options:
CODE NAME DATA
1 subnet mask 255.255.255.0
3 router 192.0.2.1
6 domain name server 192.0.2.1
12 hostname test-node
15 domain name lan
28 broadcast address 192.0.2.255
42 NTP server 192.0.2.11
192.0.2.12
51 lease time 1d
53 message type 5
54 server identifier 192.0.2.1
58 renewal time 11h 5min 38s
59 rebinding time 20h 5min 38s
119 domain search hoge.example.com
foo.example.com
Added in version 261.
๐ฐ๏ธ lldp [PATTERN...]
shows discovered LLDP (Link Layer Discovery Protocol) neighbors โ like, who's around you on the network. ๐ if one or more *PATTERN*s are specified, only neighbors on those interfaces are shown. otherwise, it shows discovered neighbors on all interfaces. note that for this feature to work, LLDP= must be turned on for the specific interface, see systemd.network(5) for details. fr fr, it won't just happen on its own.
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
shows numerical address labels that can be used for address selection. this is the same information that ip-addrlabel(8) shows. see RFC 3484[1] for a discussion of address labels. iykyk. ๐
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...
deletes virtual netdevs. takes an interface name or index number. bye bestie ๐
Added in version 243.
โฌ๏ธ up DEVICE...
brings devices up. takes an interface name or index number. wake up queen. ๐
Added in version 246.
โฌ๏ธ down DEVICE...
brings devices down. takes an interface name or index number.
Added in version 246.
๐ renew DEVICE...
renews dynamic configurations, e.g. addresses received from a DHCP server. takes an interface name or index number. glow-up time. โจ
Added in version 244.
๐ฅ forcerenew DEVICE...
sends a FORCERENEW message to all connected clients, triggering DHCP reconfiguration. takes an interface name or index number. it's giving aggressive but polite. ๐
Added in version 246.
reconfigure DEVICE...
Reconfigure network interfaces ๐ซ โ hand it an interface name or an index number, either one works, bestie.
But the tea โ: this does not reload the .netdev or .network files for the interface you named. So if you've been editing config files, you have to call networkctl reload first to actually apply the new settings. No skipping that step, fr fr.
Added in version 244.
reload
Reloads .netdev and .network files. Iconic behavior.
If a new or modified .netdev file is found, the corresponding netdev is created or updated, respectively โจ. But lowkey important โ if the corresponding interface already exists, then some of the new settings may not be applied. E.g., a 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 settings like that, the interfaces need to be removed manually before reload. Also note: even if a .netdev file is removed, systemd-networkd(8) does not remove the existing netdev corresponding to the file. Not me warning you twice ๐.
If a new, modified, or removed .network file is found, then all interfaces that matched the file are reconfigured. You can skip this reconfiguration step by passing --no-reconfigure, in which case only config files are reloaded from disk without reconfiguring any network interfaces. Use networkctl reconfigure afterwards to selectively apply config changes per interface ๐ซถ.
Added in version 244.
edit FILE|@DEVICE...
Edit network configuration files โ that means .network, .netdev, and .link files ๐.
If no network config file matching the given name is found, a new one will be created under /etc/ or /run/, depending on whether --runtime is specified. And here's the cute part: if the name is prefixed by "@", it gets treated as a network interface, and the editing happens on the network config files associated with it. You can also suffix the interface name with :network (the default), :link, or :netdev to pick which type of network config you're operating on ๐
.
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. Same deal for .link files and systemd-udevd(8) ๐ธ. Note that the changed link settings are not automatically applied after reloading โ to make that happen, trigger uevents for the corresponding interface. Refer to systemd.link(5) for more info.
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...]
Show network configuration files ๐ฆ. This command honors the "@" prefix in a similar way as edit, with support for an additional suffix :all for showing all types of configuration files associated with the interface at once. And when no argument is specified, networkd.conf(5) and its drop-in files will be shown. Sneaky useful, ngl.
Added in version 254.
mask FILE...
Mask network configuration files โ the .network, .netdev, and .link ones ๐. A symlink of the given name will be created under /etc/ or /run/, depending on whether --runtime is specified, that points to /dev/null.
Careful bestie ๐จ: if a non-empty config file with the specified name exists under the target directory or a directory with higher priority (e.g.--runtimeis used while an existing config resides in/etc/), the operation is aborted. No masking over real content, periodt.
This command honors --no-reload in the same way as edit.
Added in version 256.
unmask FILE...
Unmask network configuration files โ i.e. reverting the effect of mask ๐. Note that this command operates regardless of the scope of the directory, i.e. --runtime is of no effect. She does not care about your directory vibes.
This command honors --no-reload in the same way as edit and mask.
Added in version 256.
persistent-storage BOOL
Notify systemd-networkd.service(8) that the persistent storage for the service is ready ๐ซก. This is called by systemd-networkd-persistent-storage.service. Usually, this command should not be called manually by users or administrators โ it's giving backstage pass only, iykyk.
Added in version 256.
โจ OPTIONS โจ
The following options are understood ๐:
-a,--allโ Show all links with status. Everybody, on stage now.
Added in version 219.
-s,--statsโ Show link statistics with status. Numbers, we love her ๐.
Added in version 243.
-l,--fullโ Do not ellipsize the output. Noโฆerasure around here, we show the whole thing.
Added in version 245.
-n,--lines=โ When used withstatus, controls the number of journal lines to show, counting from the most recent ones. Takes a positive integer argument. Defaults to10.
Added in version 245.
- *
--drop-in=NAME* โ When used withedit, edit the drop-in file NAME instead of the main configuration file.
Added in version 254.
--no-reloadโ When used withedit,mask, orunmask,systemd-networkd.service(8)orsystemd-udevd.service(8)will not be reloaded after the operation finishes. Chill mode activated ๐.
Added in version 254.
--no-reconfigureโ When used withreload, only reload config files from disk without reconfiguring any network interfaces. This may be useful to avoid reconfiguring multiple interfaces simultaneously when multiple.networkfiles are updated, or when an updated.networkfile is applied to multiple interfaces. Usenetworkctl reconfigureafterwards to apply changes selectively per interface ๐ฏ.
Added in version 262.
--runtimeโ When used witheditormask, operate on the file under/run/instead of/etc/. Temporary queen behavior โจ.
Added in version 256.
--stdinโ When used withedit, 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-passwordโ Do not query the user for authentication for privileged operations. No pop quiz for you ๐ .- *
--json=MODE* โ Shows 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). Pick your aesthetic ๐. -h,--helpโ Print a short help text and exit. Bye bestie ๐.--versionโ Print a short version string and exit.--no-legendโ Do not print the legend, i.e. column headers and the footer with hints. Minimalism core.--no-pagerโ Do not pipe output into a pager. Straight to the terminal, no middleman.
๐ฆ EXIT STATUS
On success, 0 is returned, a non-zero failure code otherwise. Simple as that ๐
.
๐ SEE ALSO
systemd-networkd.service(8), systemd.network(5), systemd.netdev(5), ip(8)
๐ NOTES
and that's the whole page, bestie ๐ this one was served up by systemd 262.1, filed under NETWORKCTL(1) โ go forth and network responsibly, you absolute icon ๐๐
๐ฆ where this page comes from
- arch rolling: systemd 262.1-1 ยท LGPL-2.1-or-later AND CC0-1.0 AND GPL-2.0-or-later AND MIT-0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms