Systemd/networkd: Difference between revisions

User configurations: Add additional user configuration example that is significantly more recent
Debugging: note runtime log level changing
 
(2 intermediate revisions by 2 users not shown)
Line 78: Line 78:
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
systemd.services."systemd-networkd".environment.SYSTEMD_LOG_LEVEL = "debug";
systemd.services."systemd-networkd".environment.SYSTEMD_LOG_LEVEL = "debug";
</syntaxhighlight>Log level can also be changed at runtime with<syntaxhighlight lang="bash">
$ systemctl service-log-level systemd-networkd.service debug
# or
$ systemctl service-log-level systemd-networkd.service info
</syntaxhighlight>
</syntaxhighlight>


Line 89: Line 93:
** Does not modify properties (e.g., MTU, VLAN ID, VXLAN ID, Wireguard Peers) of existing netdevs
** Does not modify properties (e.g., MTU, VLAN ID, VXLAN ID, Wireguard Peers) of existing netdevs
*** https://github.com/systemd/systemd/issues/9627
*** https://github.com/systemd/systemd/issues/9627
*** This should be fixed as of systemd v257 (https://github.com/systemd/systemd/pull/34909)


=== network-online.target ===
=== network-online.target ===
Line 147: Line 152:


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 ===