Skip to content

⚙ darkone.system.network

Fleet-wide network configuration of DNF hosts.

Sets up, on every host:

  • the hostname;
  • the nftables firewall (darkone.system.core.enableFirewall);
  • SSH opened per role (below).

Software switch (darkone.system.network.switch)

Section titled “Software switch (darkone.system.network.switch)”

Bridges spare NICs with the uplink: a host plugged into a downlink sits in the zone as behind an unmanaged hardware switch (DHCP and DNS of the zone gateway, nothing to configure on its side).

darkone.system.network.switch = {
enable = true;
uplink = "enp1s0f1";
downlinks = [
"enp1s0f0" # 10 GbE
"enp2s0"
];
};
  • bridge br0 holds the host address (DHCP) with the uplink MAC;
  • pure L2: no STP, no br_netfilter, so bridged frames skip nftables;
  • same bridge in the initrd: downlinks keep the network while the host waits for its LUKS unlock, and the address never changes interface at switch-root;
  • systemd-networkd is forced; a zone gateway or a NetworkManager host is refused.
  • enable bool the software switch: spare NICs bridged with the uplink into the host’s zone
  • uplink str Interface linked to the zone. Its MAC must be the only mac of the host in config.yaml.
  • downlinks listOf str Interfaces bridged with the uplink.
darkone.system.network.switch = {
enable = false;
uplink = "enp1s0f1";
downlinks = [ ];
};

Source: modules/system/network.nix 🡕