Jump to content

Systemd/networkd: Difference between revisions

Use nixos options template to link to s.n.o
imported>Mweinelt
imported>Mweinelt
(Use nixos options template to link to s.n.o)
Line 1: Line 1:
Networkd is the network configuration component of the systemd software suite. It is well integrated into NixOS below <code>systemd.network</code> and should be preferred over <code>networking.interfaces</code> options for most use cases, since it receives far superior maintenance.
Networkd is the network configuration component of the systemd software suite. It is well integrated into NixOS below {{Nixos:option|systemd.network}} and should be preferred over {{Nixos:option|networking.interfaces}} options for most use cases, since it receives far superior maintenance.


Configuration for networkd is split into three sections.
Configuration for networkd is split into three sections.


* <code>systemd.network.links</code> reconfigures existing network devices
* {{Nixos:option|systemd.network.links}} reconfigures existing network devices
** https://www.freedesktop.org/software/systemd/man/systemd.link.html
** https://www.freedesktop.org/software/systemd/man/systemd.link.html
** actually implemented by udev, not networkd
** actually implemented by udev, not networkd
* <code>systemd.network.netdevs</code> creates virtual network devices
* {{Nixos:option|systemd.network.netdevs}} creates virtual network devices
** https://www.freedesktop.org/software/systemd/man/systemd.netdev.html
** https://www.freedesktop.org/software/systemd/man/systemd.netdev.html
* <code>systemd.network.networks</code> configures network devices
* {{Nixos:option|systemd.network.networks}} configures network devices
** https://www.freedesktop.org/software/systemd/man/systemd.network.html
** https://www.freedesktop.org/software/systemd/man/systemd.network.html


Line 22: Line 22:
</syntaxhighlight>
</syntaxhighlight>


Some guides will mention the <code>networking.useNetworkd</code> option, which
Some guides will mention the {{Nixos:option|networking.useNetworkd}} option, which
offers translation of some <code>networking.*</code> options into networkd. If you
offers translation of some {{Nixos:option|networking.interfaces}} and
can write your complete network setup in native networkd configuration, you should
{{Nixos:option|networking.useDHCP}} options into networkd. If you can write your complete
stay away from that option.
network setup in native networkd configuration, you should stay away from that option.


=== Configuring ===
=== Configuring ===
Anonymous user