diff --git a/hosts/storage-2/configuration.nix b/hosts/storage-2/configuration.nix index b664f44..403171f 100644 --- a/hosts/storage-2/configuration.nix +++ b/hosts/storage-2/configuration.nix @@ -16,10 +16,28 @@ boot.loader.grub.device = "/dev/vda"; networking.useDHCP = false; - networking.interfaces.ens19.ipv4.addresses = [ { address = "192.168.10.35"; prefixLength = 24; } ]; - networking.interfaces.ens18.ipv6.addresses = [ { address = "2001:638:904:ffc0::4"; prefixLength = 64; } ]; - networking.defaultGateway = { address = "192.168.10.1"; interface = "ens19"; }; - networking.defaultGateway6 = { address = "2001:638:904:ffc0::1"; interface = "ens18"; }; + systemd.network.enable = true; + + systemd.network.networks."10-wan" = { + matchConfig.Name = "ens18"; + address = [ + "2001:638:904:ffc0::4/64" + ]; + routes = [ + { Gateway = "2001:638:904:ffc0::1"; } + ]; + linkConfig.RequiredForOnline = "routable"; + }; + systemd.network.networks."10-nat-netz-mercury" = { + matchConfig.Name = "ens19"; + address = [ + "192.168.10.35/24" + ]; + routes = [ + { Gateway = "192.168.10.1"; } + ]; + linkConfig.RequiredForOnline = "routable"; + }; services.nginx.enable = true;