diff --git a/hosts/nonat/configuration.nix b/hosts/nonat/configuration.nix index 2f2483d..741055c 100644 --- a/hosts/nonat/configuration.nix +++ b/hosts/nonat/configuration.nix @@ -13,19 +13,27 @@ boot.loader.grub.device = "/dev/vda"; networking.useDHCP = false; - # Network - networking.interfaces.ens18.ipv4.addresses = [ - { address = "141.24.46.169"; prefixLength = 24; } - ]; - networking.interfaces.ens18.ipv6.addresses = [ - { address = "2001:638:904:ffca::6"; prefixLength = 64; } - ]; - networking.defaultGateway = { address = "141.24.46.1"; interface = "ens18"; }; - networking.defaultGateway6 = { address = "2001:638:904:ffca::1"; interface = "ens18"; }; + systemd.network.enable = true; - networking.interfaces.ens19.ipv4.addresses = [ - { address = "192.168.10.1"; prefixLength = 24; } - ]; + systemd.network.networks."10-wan" = { + matchConfig.Name = "ens18"; + address = [ + "2001:638:904:ffca::6/64" + "141.24.46.169/24" + ]; + routes = [ + { Gateway = "141.24.46.1"; } + { Gateway = "2001:638:904:ffca::1"; } + ]; + linkConfig.RequiredForOnline = "routable"; + }; + systemd.network.networks."10-nat-netz-mercury" = { + matchConfig.Name = "ens19"; + address = [ + "192.168.10.1/24" + ]; + linkConfig.RequiredForOnline = "no"; + }; networking.nat = { enableIPv6 = true;