From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a stub. Please help out by expanding it - how to get started.
Not to be confused with systemd.
Not to be confused with systemd/systemd-resolved.

systemd-networkd provides simple configuration of wired network interfaces. It is disabled by default on Gentoo systems, but can be quickly enabled as necessary enable connectivity.


To configure systemd-networkd, create a .network file under the /etc/systemd/network directory. Files are written in INI style syntax. See the man page for reference.


A simple DHCP configuration is given below:

FILE /etc/systemd/network/

Static IP address

Wired connection with static IP address (uses CIDR notation for subnetting):

FILE /etc/systemd/network/

Wireless card

A simple DHCP configuration for the wireless card wlan0 is given below:

FILE /etc/systemd/network/

Connecting to a wireless access point can be achieved using Iwd or Wpa supplicant.

DNS (systemd-resolved)

Note that systemd-networkd does not update the resolv.conf file or provide DNS service by default. See the systemd/systemd-resolved article for details on how to setup address name resolution (DNS) on systemd systems.



To enable and start the service now:

root #systemctl enable --now systemd-networkd.service


A networkctl user space utility exists to query and control the networking subsystem for systems running systemd-networkd.

user $networkctl --help
networkctl [OPTIONS...] COMMAND

Query and control the networking subsystem.

  list [PATTERN...]      List links
  status [PATTERN...]    Show link status
  lldp [PATTERN...]      Show LLDP neighbors
  label                  Show current address label entries in the kernel
  delete DEVICES...      Delete virtual netdevs
  up DEVICES...          Bring devices up
  down DEVICES...        Bring devices down
  renew DEVICES...       Renew dynamic configurations
  forcerenew DEVICES...  Trigger DHCP reconfiguration of all connected clients
  reconfigure DEVICES... Reconfigure interfaces
  reload                 Reload .network and .netdev files

  -h --help              Show this help
     --version           Show package version
     --no-pager          Do not pipe output into a pager
     --no-legend         Do not show the headers and footers
  -a --all               Show status for all links
  -s --stats             Show detailed link statistics
  -l --full              Do not ellipsize output
  -n --lines=INTEGER     Number of journal entries to show
                         Generate JSON output

See the networkctl(1) man page for details.



If a cifs filesystem is placed in fstab to automount a samba share with the option, and multiple network interfaces are present but only one is connected, systemd-networkd-wait-online.service may try to confirm network connectivity on all interfaces, resulting in the default two-minute timeout causing a file manager like Dolphin to not open initially after boot until two minutes have elapsed. To fix this, run

root #systemctl edit systemd-networkd-wait-online.service

and add the lines

FILE /etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --interface=eth0

where the first ExecStart= clears any existing entries, and eth0 should be replaced with name of the interface that is primary/relevant for the behavior that is desired. One could also write

FILE /etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --interface=any

to accept connectivity with any interface, or

FILE /etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --ignore=eth0

to ignore a particular one.[1]

See also

  • systemd/systemd-resolved — a address name resolution (DNS) daemon which can be used in conjunction with systemd-networkd.
  • systemd — a modern SysV-style init and rc replacement for Linux systems.
  • Network management — describes possibilities for managing the network stack.

External resources