Systemd/networkd: Difference between revisions

Klinger (talk | contribs)
imported from old wiki
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Systemd/breadcrumb}}
{{Systemd/breadcrumb}}
{{DISPLAYTITLE:systemd-networkd}}
{{DISPLAYTITLE:systemd-networkd}}
[https://www.freedesktop.org/software/systemd/man/systemd-networkd.html systemd-networkd] is the network[[Category: Networking]] configuration component of the [[systemd]][[Category: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.
[https://www.freedesktop.org/software/systemd/man/systemd-networkd.html systemd-networkd] is the network configuration component of the [[systemd]][[Category: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.
Line 29: Line 29:
These use cases are better served by [[NetworkManager]] and its various frontends, that provides a better integrated user experience for various desktop systems.
These use cases are better served by [[NetworkManager]] and its various frontends, that provides a better integrated user experience for various desktop systems.


{{Note|Both systemd-networkd and NetworkManager can exist in parallel on the same machine,
{{Note|Both systemd-networkd and NetworkManager can exist in parallel on the same machine, when they manage a distinct set of interfaces. If upstream connectivity is managed by NetworkManager (for example, NM handles wifi and networkd does VM networking), set {{Nixos:option|systemd.network.wait-online.enable}} to false so that boot isn't blocked on connectivity that networkd will never provide.}}
when they manage a distinct set of interfaces.}}


=== Enabling ===
=== Enabling ===
Line 184: Line 183:
     routes = [
     routes = [
       # create default routes for both IPv6 and IPv4
       # create default routes for both IPv6 and IPv4
       { routeConfig.Gateway = "fe80::1"; }
       { Gateway = "fe80::1"; }
       { routeConfig.Gateway = "192.0.2.1"; }
       { Gateway = "192.0.2.1"; }
       # or when the gateway is not on the same network
       # or when the gateway is not on the same network
       {
       {
         routeConfig = {
         Gateway = "172.31.1.1";
          Gateway = "172.31.1.1";
        GatewayOnLink = true;
          GatewayOnLink = true;
        };
       }
       }
     ];
     ];
Line 380: Line 377:


* [https://gist.github.com/mweinelt/b78f7046145dbaeab4e42bf55663ef44 NixOS 22.11 VDSL Router (VLANs on top of Bonding, IPv6 Prefix-Delegation, pppd Integration)] by [https://github.com/mweinelt mweinelt]
* [https://gist.github.com/mweinelt/b78f7046145dbaeab4e42bf55663ef44 NixOS 22.11 VDSL Router (VLANs on top of Bonding, IPv6 Prefix-Delegation, pppd Integration)] by [https://github.com/mweinelt mweinelt]
[[Category:systemd]]
[[Category:systemd]]
[[Category:Networking]]