From ac71bc3f6216a247615ce36c6eddf25365b00a76 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 13 Jan 2022 23:16:21 +0100 Subject: vidhar: ... --- hosts/vidhar/network/default.nix | 67 +++++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 14 deletions(-) (limited to 'hosts/vidhar/network/default.nix') diff --git a/hosts/vidhar/network/default.nix b/hosts/vidhar/network/default.nix index 81dac652..e3d7dd14 100644 --- a/hosts/vidhar/network/default.nix +++ b/hosts/vidhar/network/default.nix @@ -21,7 +21,7 @@ { address = "10.141.1.1"; prefixLength = 24; } ]; }; - interfaces."dmz01" = { + interfaces."wifibh" = { ipv4.addresses = [ { address = "10.141.2.1"; prefixLength = 24; } ]; @@ -32,11 +32,11 @@ id = 2; interface = "eno2"; }; - lan = { + "eno2.lan" = { id = 3; interface = "eno2"; }; - dmz01 = { + wifibh = { id = 4; interface = "eno2"; }; @@ -70,13 +70,6 @@ option domain-name-servers 10.141.1.1; option broadcast-address 10.141.1.255; } - - subnet 10.141.2.0 netmask 255.255.255.0 { - range 10.141.2.128 10.141.2.254; - option domain-name-servers 10.141.2.1; - option broadcast-address 10.141.2.255; - option routers 10.141.2.1; - } ''; machines = [ { @@ -96,10 +89,56 @@ } ]; }; - systemd.network.networks = { - "eno2" = { - matchConfig.Name = "eno2"; - networkConfig.LinkLocalAddressing = "no"; + 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 = { + VLAN = "2"; + }; + }; + lan = { + netdevConfig = { + Name = "lan"; + Kind = "bridge"; + }; + }; + }; + + networks = { + "eno2" = { + matchConfig.Name = "eno2"; + networkConfig.LinkLocalAddressing = "no"; + }; + "wifibh01.lan" = { + matchConfig.Name = "wifibh01.lan"; + networkConfig.Bridge = "lan"; + bridgeConfig = { + HairPin = true; + Cost = "10"; + }; + }; + "40-eno2.lan" = { + matchConfig.Name = "eno2.lan"; + networkConfig.Bridge = "lan"; + bridgeConfig = { + HairPin = false; + Cost = "1"; + }; + }; }; }; }; -- cgit v1.2.3