diff --git a/hosts/FredOS-Mediaserver.nix b/hosts/FredOS-Mediaserver.nix index 3f98e1d..f9f3c95 100644 --- a/hosts/FredOS-Mediaserver.nix +++ b/hosts/FredOS-Mediaserver.nix @@ -29,7 +29,7 @@ ]; # Basic networking - networking.useDHCP = lib.mkDefault true; + networking.useDHCP = lib.mkForce false; # Allow fred to act as a remote Nix builder (trusted users can import # unsigned store paths sent by the build client). diff --git a/services/router.nix b/services/router.nix index fde6002..63df5ea 100644 --- a/services/router.nix +++ b/services/router.nix @@ -72,24 +72,18 @@ in "net.ipv6.conf.all.disable_ipv6" = 1; }; + # Pin interface names to MAC addresses so they never swap across boots. + # Without this, "eth0" is an unpredictable kernel name that depends on + # device probe order — if the NICs swap, the entire LAN/WAN config breaks. + services.udev.extraRules = '' + SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="6c:0b:84:0c:4c:58", NAME="eth0" + SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="6c:0b:84:0c:4c:59", NAME="eno1" + ''; + # --- Interface configuration --- systemd.network = { enable = true; - # Pin interface names to MAC addresses so they never swap across boots. - # Without this, "eth0" is an unpredictable kernel name that depends on - # device probe order — if the NICs swap, the entire LAN/WAN config breaks. - links = { - "10-wan" = { - matchConfig.MACAddress = "6c:0b:84:0c:4c:59"; - linkConfig.Name = "eno1"; - }; - "20-lan" = { - matchConfig.MACAddress = "6c:0b:84:0c:4c:58"; - linkConfig.Name = "eth0"; - }; - }; - networks = { "10-wan" = { matchConfig.Name = "eno1";