{ config, lib, pkgs, ... }: { imports = [ ./dsl.nix ]; config = { networking = { hostName = "vidhar"; domain = "yggdrasil"; search = [ "yggdrasil" ]; useDHCP = false; useNetworkd = true; interfaces."lan" = { ipv4.addresses = [ { address = "10.141.0.1"; prefixLength = 24; } ]; }; interfaces."mgmt" = { ipv4.addresses = [ { address = "10.141.1.1"; prefixLength = 24; } ]; }; interfaces."wifibh" = { ipv4.addresses = [ { address = "10.141.2.1"; prefixLength = 24; } ]; }; vlans = { mgmt = { id = 2; interface = "eno2"; }; "eno2.lan" = { id = 3; interface = "eno2"; }; wifibh = { id = 4; interface = "eno2"; }; }; firewall.enable = false; nftables = { enable = true; rulesetFile = ./ruleset.nft; }; }; services.resolved = { llmnr = "false"; }; services.dhcpd4 = { enable = true; interfaces = [ "lan" "mgmt" ]; extraConfig = '' subnet 10.141.0.0 netmask 255.255.255.0 { range 10.141.0.128 10.141.0.254; option domain-name-servers 10.141.0.1; option broadcast-address 10.141.0.255; option routers 10.141.0.1; option domain-name "yggdrasil"; } subnet 10.141.1.0 netmask 255.255.255.0 { range 10.141.1.128 10.141.1.254; option domain-name-servers 10.141.1.1; option broadcast-address 10.141.1.255; } ''; machines = [ { ethernetAddress = "50:d4:f7:f3:0f:7e"; hostName = "gauss-ap01"; ipAddress = "10.141.0.64"; } { ethernetAddress = "60:a4:b7:53:94:b5"; hostName = "switch01"; ipAddress = "10.141.1.2"; } { ethernetAddress = "74:ac:b9:29:ad:9a"; hostName = "ap01"; ipAddress = "10.141.1.4"; } ]; }; systemd.network = { netdevs = { "wifibh01" = { netdevConfig = { Name = "wifibh01"; Kind = "gretap"; }; tunnelConfig = { Local = "10.141.2.1"; Remote = "10.141.2.2"; }; }; "wifibh01.lan" = { netdevConfig = { Name = "wifibh01.lan"; Kind = "vlan"; }; vlanConfig = { Id = 2; }; }; lan = { netdevConfig = { Name = "lan"; Kind = "bridge"; }; }; }; networks = { "eno1" = { matchConfig.Name = "eno1"; linkConfig = { ActivationPolicy = "down"; }; }; "eno2" = { matchConfig.Name = "eno2"; networkConfig.LinkLocalAddressing = "no"; }; "wifibh01.lan" = { matchConfig.Name = "wifibh01.lan"; networkConfig.Bridge = "lan"; extraConfig = '' [Bridge] HairPin = true Cost = 10 ''; }; "40-eno2.lan" = { matchConfig.Name = "eno2.lan"; networkConfig.Bridge = "lan"; extraConfig = '' [Bridge] HairPin = false Cost = 1 ''; }; }; }; }; }