Systemd/networkd: Difference between revisions
imported>Mweinelt m →Static |
imported>Mweinelt →DHCP: Add router advertisements info |
||
Line 87: | Line 87: | ||
Examples should be concise and give proper hints on how to achieve a reliably working <code>network-online.target</code>. | Examples should be concise and give proper hints on how to achieve a reliably working <code>network-online.target</code>. | ||
=== DHCP === | === DHCP/RA === | ||
Common scenario for dynamic configuration, DHCP for IPv4 and router advertisements for IPv6 connectivity. Make <code>network-online.target</code> wait until addresses and routes are configured. | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
systemd.network.networks."10-dhcp-wan" = { | systemd.network.networks."10-dhcp-wan" = { | ||
matchConfig.Name = "enp1s0"; | matchConfig.Name = "enp1s0"; | ||
networkConfig | networkConfig = { | ||
# | DHCP = "ipv4"; | ||
linkConfig.RequiredForOnline = | IPv6AcceptRA = true; | ||
}; | |||
# making routing on this interface a dependency for network-online.target | |||
linkConfig.RequiredForOnline = "routable"; | |||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> |