Systemd/networkd: Difference between revisions

imported>Mweinelt
mNo edit summary
imported>RaitoBezarius
add DHCP example
Line 29: Line 29:


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 ===
Assuming your *wired* interface that should run DHCP is called <code>enp1s0</code>, this configuration will enable DHCP.
<syntaxhighlight lang="nix">
  systemd.network.networks."10-dhcp-wan" = {
    matchConfig.Name = "enp1s0";
    linkConfig.RequiredForOnline = true; # Necessary if you want to make network-online.target dependent on this interface being online.
    DHCP = "yes";
  };
</syntaxhighlight>


=== Bonding ===
=== Bonding ===