From e96b80ccef9e4b0d775a78c77e79b559294d82c2 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sat, 7 Dec 2024 19:18:06 +0530 Subject: [PATCH] cleanup systemd-networkd configs --- hosts/layne/network/default.nix | 36 ++++++++++++++++++++++++++++--- hosts/rico0/network/default.nix | 36 ++++++++++++++++++++++++++++--- hosts/rico1/network/default.nix | 36 ++++++++++++++++++++++++++++--- hosts/rico2/network/default.nix | 36 ++++++++++++++++++++++++++++--- hosts/skipper/network/default.nix | 9 ++++++++ hosts/wynne/network/default.nix | 36 ++++++++++++++++++++++++++++--- 6 files changed, 174 insertions(+), 15 deletions(-) diff --git a/hosts/layne/network/default.nix b/hosts/layne/network/default.nix index ea481ec..36f484b 100644 --- a/hosts/layne/network/default.nix +++ b/hosts/layne/network/default.nix @@ -6,11 +6,37 @@ enable = true; wait-online.enable = false; networks = { - "41-ether" = { + "20-virbr" = { + matchConfig = { + Name = "virbr*"; + Type = "bridge"; + }; + linkConfig = { + Unmanaged = true; + }; + }; + "21-docker" = { + matchConfig = { + Name = "docker*"; + Type = "bridge"; + }; + linkConfig = { + Unmanaged = true; + }; + }; + "22-veth" = { + matchConfig = { + Name = "veth*"; + Type = "ether"; + }; + linkConfig = { + Unmanaged = true; + }; + }; + "40-ether" = { enable = true; matchConfig = { Type = "ether"; - Name = "e*"; }; networkConfig = { DHCP = "yes"; @@ -18,9 +44,13 @@ }; dhcpV4Config = { UseDomains = true; + RouteMetric = 100; + }; + ipv6AcceptRAConfig = { + RouteMetric = 100; }; linkConfig = { - RequiredForOnline = "yes"; + RequiredForOnline = "routable"; }; }; }; diff --git a/hosts/rico0/network/default.nix b/hosts/rico0/network/default.nix index 801395c..77b21f7 100644 --- a/hosts/rico0/network/default.nix +++ b/hosts/rico0/network/default.nix @@ -6,11 +6,37 @@ enable = true; wait-online.enable = false; networks = { - "41-ether" = { + "20-virbr" = { + matchConfig = { + Name = "virbr*"; + Type = "bridge"; + }; + linkConfig = { + Unmanaged = true; + }; + }; + "21-docker" = { + matchConfig = { + Name = "docker*"; + Type = "bridge"; + }; + linkConfig = { + Unmanaged = true; + }; + }; + "22-veth" = { + matchConfig = { + Name = "veth*"; + Type = "ether"; + }; + linkConfig = { + Unmanaged = true; + }; + }; + "40-ether" = { enable = true; matchConfig = { Type = "ether"; - Name = "e*"; }; networkConfig = { DHCP = "yes"; @@ -18,9 +44,13 @@ }; dhcpV4Config = { UseDomains = true; + RouteMetric = 100; + }; + ipv6AcceptRAConfig = { + RouteMetric = 100; }; linkConfig = { - RequiredForOnline = "yes"; + RequiredForOnline = "routable"; }; }; }; diff --git a/hosts/rico1/network/default.nix b/hosts/rico1/network/default.nix index a6394e7..d56b657 100644 --- a/hosts/rico1/network/default.nix +++ b/hosts/rico1/network/default.nix @@ -6,11 +6,37 @@ enable = true; wait-online.enable = false; networks = { - "41-ether" = { + "20-virbr" = { + matchConfig = { + Name = "virbr*"; + Type = "bridge"; + }; + linkConfig = { + Unmanaged = true; + }; + }; + "21-docker" = { + matchConfig = { + Name = "docker*"; + Type = "bridge"; + }; + linkConfig = { + Unmanaged = true; + }; + }; + "22-veth" = { + matchConfig = { + Name = "veth*"; + Type = "ether"; + }; + linkConfig = { + Unmanaged = true; + }; + }; + "40-ether" = { enable = true; matchConfig = { Type = "ether"; - Name = "e*"; }; networkConfig = { DHCP = "yes"; @@ -18,9 +44,13 @@ }; dhcpV4Config = { UseDomains = true; + RouteMetric = 100; + }; + ipv6AcceptRAConfig = { + RouteMetric = 100; }; linkConfig = { - RequiredForOnline = "yes"; + RequiredForOnline = "routable"; }; }; }; diff --git a/hosts/rico2/network/default.nix b/hosts/rico2/network/default.nix index a6394e7..d56b657 100644 --- a/hosts/rico2/network/default.nix +++ b/hosts/rico2/network/default.nix @@ -6,11 +6,37 @@ enable = true; wait-online.enable = false; networks = { - "41-ether" = { + "20-virbr" = { + matchConfig = { + Name = "virbr*"; + Type = "bridge"; + }; + linkConfig = { + Unmanaged = true; + }; + }; + "21-docker" = { + matchConfig = { + Name = "docker*"; + Type = "bridge"; + }; + linkConfig = { + Unmanaged = true; + }; + }; + "22-veth" = { + matchConfig = { + Name = "veth*"; + Type = "ether"; + }; + linkConfig = { + Unmanaged = true; + }; + }; + "40-ether" = { enable = true; matchConfig = { Type = "ether"; - Name = "e*"; }; networkConfig = { DHCP = "yes"; @@ -18,9 +44,13 @@ }; dhcpV4Config = { UseDomains = true; + RouteMetric = 100; + }; + ipv6AcceptRAConfig = { + RouteMetric = 100; }; linkConfig = { - RequiredForOnline = "yes"; + RequiredForOnline = "routable"; }; }; }; diff --git a/hosts/skipper/network/default.nix b/hosts/skipper/network/default.nix index a526494..5925efd 100644 --- a/hosts/skipper/network/default.nix +++ b/hosts/skipper/network/default.nix @@ -42,6 +42,15 @@ Unmanaged = true; }; }; + "23-veth" = { + matchConfig = { + Name = "vnet*"; + Type = "ether"; + }; + linkConfig = { + Unmanaged = true; + }; + }; "40-ether" = { enable = true; matchConfig = { diff --git a/hosts/wynne/network/default.nix b/hosts/wynne/network/default.nix index a6394e7..d56b657 100644 --- a/hosts/wynne/network/default.nix +++ b/hosts/wynne/network/default.nix @@ -6,11 +6,37 @@ enable = true; wait-online.enable = false; networks = { - "41-ether" = { + "20-virbr" = { + matchConfig = { + Name = "virbr*"; + Type = "bridge"; + }; + linkConfig = { + Unmanaged = true; + }; + }; + "21-docker" = { + matchConfig = { + Name = "docker*"; + Type = "bridge"; + }; + linkConfig = { + Unmanaged = true; + }; + }; + "22-veth" = { + matchConfig = { + Name = "veth*"; + Type = "ether"; + }; + linkConfig = { + Unmanaged = true; + }; + }; + "40-ether" = { enable = true; matchConfig = { Type = "ether"; - Name = "e*"; }; networkConfig = { DHCP = "yes"; @@ -18,9 +44,13 @@ }; dhcpV4Config = { UseDomains = true; + RouteMetric = 100; + }; + ipv6AcceptRAConfig = { + RouteMetric = 100; }; linkConfig = { - RequiredForOnline = "yes"; + RequiredForOnline = "routable"; }; }; };