Jump to content

Systemd/networkd: Difference between revisions

no edit summary
imported>M-bdf
m (Mention `systemd.network.wait-online.anyInterface`)
imported>Mweinelt
No edit summary
Line 316: Line 316:
   };
   };
</syntaxhighlight>
</syntaxhighlight>
=== Router Advertisement ===
Router advertisements are way to allow clients to achieve stateless autoconfiguration (SLAAC). The most prominent setup is where the router announces a prefix onto a LAN segment, which the receiving client can use to set up an address on that prefix, and configure the sender as its default gateway.
In this example the router will announce a static IPv6 prefix on the <code>lan</code> interface from it's automatically configured link local address on that link. The router does not generally require a unique local or globally reachable address on the link, unless you also want to host services like DNS and NTP on that LAN segment.
Recommended documentation:
* [https://www.freedesktop.org/software/systemd/man/systemd.network.html#%5BIPv6SendRA%5D%20Section%20Options <nowiki>[IPv6SendRa]</nowiki> configuration reference]
<syntaxhighlight lang="nix">
  systemd.network = {
    networks = {
      "30-lan" = {
        matchConfig.Name = "lan";
        address = [
          "2001:db8:1122:3344::1/64"
        ];
        networkConfig = {
          IPv6SendRA = true;
        };
        ipv6Prefixes = [ {
          # Announce a static prefix
          ipv6PrefixConfig.Prefix = "2001:db8:1122:3344::/64";
        } ];
        ipv6SendRaConfig = {
          # Provide a DNS resolver
          EmitDNS = true;
          DNS = "2001:db8:1122:3344::1";
        };
      };
  };
</syntaxhighlight>
An extended form of this setup uses DHCPv6 prefix delegation to acquire a dynamic prefix over a WAN link, which then gets distributed onto designated LAN segments.


=== WireGuard ===
=== WireGuard ===
Anonymous user