Systemd/networkd: Difference between revisions

Axka (talk | contribs)
mNo edit summary
Hexa (talk | contribs)
Interface renaming
(One intermediate revision by one other user not shown)
Line 147: Line 147:


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>.
=== Interface Naming ===
The name of an interface can be changed based on different matches. This is useful for pretty names (e.g. wan, lan), but also if you want to make sure that your interface name never changes. This might be useful because even with predictable interface naming your interface name can change, for example when you add a new PCIe card and indexing changes, or due to kernel changes the way your mainboard gets interpreted changes.<syntaxhighlight lang="nix">
  systemd.network.links."10-wan" = {
    # Check systemd.link(5) for other matchers
    matchConfig.Path = "pci-0000:09:00.0";
    linkConfig.Name = "wan";
  };
</syntaxhighlight>


=== DHCP/RA ===
=== DHCP/RA ===
Line 380: Line 389:


* [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]
* [https://github.com/philipwilk/nixos/blob/4fec9d73bfa7b1ecb490186522de38d25ee81e69/homelab/router/systemd.nix NixOS Unstable (25.04) Router (ipv4/ipv6 dual stack, dnssec+dnsovertls, NTP-rs)] by [https://github.com/philipwilk philipwilk]


[[Category:systemd]]
[[Category:systemd]]
[[Category:Networking]]
[[Category:Networking]]