diff --git a/ops/nixos/kerrigan/default.nix b/ops/nixos/kerrigan/default.nix index 8a7751482a..e6868bfa13 100644 --- a/ops/nixos/kerrigan/default.nix +++ b/ops/nixos/kerrigan/default.nix @@ -34,6 +34,8 @@ in "net.ipv4.ip_forward" = "1"; "net.ipv6.conf.default.forwarding" = "1"; "net.ipv6.conf.all.forwarding" = "1"; + "net.ipv6.conf.default.accept_ra_from_local" = "1"; + "net.ipv6.conf.all.accept_ra_from_local" = "1"; }; networking = { @@ -44,7 +46,7 @@ in networkmanager = { enable = true; dns = "systemd-resolved"; - unmanaged = [ "eth1" "eth2" ]; + unmanaged = [ "*,except:type:gsm" ]; extraConfig = '' [main] no-auto-default=* @@ -65,6 +67,36 @@ in users.users.lukegb.extraGroups = lib.mkAfter [ "networkmanager" ]; my.systemType = "aarch64-linux"; + systemd.network.netdevs.br0 = { + netdevConfig = { + Name = "br0"; + Kind = "bridge"; + }; + }; + systemd.network.networks.br0 = { + matchConfig.Name = "br0"; + networkConfig = { + LinkLocalAddressing = "ipv6"; + Address = "10.42.0.1/24"; + IPForward = true; + IPMasquerade = "ipv4"; + IPv6AcceptRA = true; + DHCPServer = true; + }; + ipv6AcceptRAConfig = { + UseGateway = false; + RouteMetric = 100; + }; + dhcpServerConfig = { + PoolOffset = 100; + PoolSize = 100; + }; + }; + systemd.network.networks.links-to-bridge = { + matchConfig.Name = "lan*"; + networkConfig.Bridge = "br0"; + }; + systemd.services.ModemManager = { wantedBy = [ "network.target" ]; }; @@ -85,6 +117,7 @@ in enable = true; config = '' interface br0 { + IgnoreIfMissing on; AdvSendAdvert on; AdvLinkMTU 1280; @@ -92,10 +125,12 @@ in Base6Interface wwan0; AdvValidLifetime 600; AdvPreferredLifetime 300; - } - } + }; + }; ''; }; + systemd.services."systemd-networkd-wait-online".wantedBy = lib.mkForce []; + system.stateVersion = "23.05"; } diff --git a/ops/nixos/kerrigan/networkmanager/bridge-br0.nmconnection b/ops/nixos/kerrigan/networkmanager/bridge-br0.nmconnection deleted file mode 100644 index 9de486bf17..0000000000 --- a/ops/nixos/kerrigan/networkmanager/bridge-br0.nmconnection +++ /dev/null @@ -1,19 +0,0 @@ -[connection] -id=bridge-br0 -uuid=bb1df01a-67f4-44f6-99b7-a94a8d91c00e -type=bridge -interface-name=br0 - -[ethernet] - -[bridge] -forward-delay=3 - -[ipv4] -method=shared - -[ipv6] -addr-gen-mode=default -method=shared - -[proxy] diff --git a/ops/nixos/kerrigan/networkmanager/bridge-slave-lan0.nmconnection b/ops/nixos/kerrigan/networkmanager/bridge-slave-lan0.nmconnection deleted file mode 100644 index af85522b10..0000000000 --- a/ops/nixos/kerrigan/networkmanager/bridge-slave-lan0.nmconnection +++ /dev/null @@ -1,11 +0,0 @@ -[connection] -id=bridge-slave-lan0 -uuid=a9bee559-325f-4ac4-9c02-b129d08b0c03 -type=ethernet -interface-name=lan0 -master=br0 -slave-type=bridge - -[ethernet] - -[bridge-port] diff --git a/ops/nixos/kerrigan/networkmanager/bridge-slave-lan1.nmconnection b/ops/nixos/kerrigan/networkmanager/bridge-slave-lan1.nmconnection deleted file mode 100644 index d5f8287ee5..0000000000 --- a/ops/nixos/kerrigan/networkmanager/bridge-slave-lan1.nmconnection +++ /dev/null @@ -1,11 +0,0 @@ -[connection] -id=bridge-slave-lan1 -uuid=a1d80f6a-a7c8-4888-911f-82041324ab84 -type=ethernet -interface-name=lan1 -master=br0 -slave-type=bridge - -[ethernet] - -[bridge-port] diff --git a/ops/nixos/kerrigan/networkmanager/bridge-slave-lan2.nmconnection b/ops/nixos/kerrigan/networkmanager/bridge-slave-lan2.nmconnection deleted file mode 100644 index 31c8120a42..0000000000 --- a/ops/nixos/kerrigan/networkmanager/bridge-slave-lan2.nmconnection +++ /dev/null @@ -1,11 +0,0 @@ -[connection] -id=bridge-slave-lan2 -uuid=99e29121-71a4-40d1-886f-fa10410a4897 -type=ethernet -interface-name=lan2 -master=br0 -slave-type=bridge - -[ethernet] - -[bridge-port] diff --git a/ops/nixos/kerrigan/networkmanager/bridge-slave-lan3.nmconnection b/ops/nixos/kerrigan/networkmanager/bridge-slave-lan3.nmconnection deleted file mode 100644 index 7e92858778..0000000000 --- a/ops/nixos/kerrigan/networkmanager/bridge-slave-lan3.nmconnection +++ /dev/null @@ -1,11 +0,0 @@ -[connection] -id=bridge-slave-lan3 -uuid=8943379a-dc7a-453d-a16a-6be42e842f2c -type=ethernet -interface-name=lan3 -master=br0 -slave-type=bridge - -[ethernet] - -[bridge-port]