diff --git a/hosts/containers/deployer/configuration.nix b/hosts/containers/deployer/configuration.nix index b42e54f3..602b52a4 100644 --- a/hosts/containers/deployer/configuration.nix +++ b/hosts/containers/deployer/configuration.nix @@ -25,6 +25,9 @@ htop ]; + networking.interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.16"; prefixLength = 26; } ]; + networking.defaultGateway = "172.20.73.1"; + networking = { hostName = "deployer"; # usePredictableInterfacenames = false; diff --git a/hosts/containers/dnscache/configuration.nix b/hosts/containers/dnscache/configuration.nix index 81530821..1eb399bf 100644 --- a/hosts/containers/dnscache/configuration.nix +++ b/hosts/containers/dnscache/configuration.nix @@ -22,6 +22,7 @@ networking.interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.8"; prefixLength = 26; } ]; networking.defaultGateway = "172.20.73.1"; services.resolved.enable = false; + networking.nameservers = [ "172.20.73.8" "172.20.72.6" "172.20.72.10" "9.9.9.9" ]; # Set your time zone. time.timeZone = "Europe/Berlin"; diff --git a/hosts/containers/elastic/configuration.nix b/hosts/containers/elastic/configuration.nix index a7a2fa31..16f9f8b0 100644 --- a/hosts/containers/elastic/configuration.nix +++ b/hosts/containers/elastic/configuration.nix @@ -17,6 +17,8 @@ networking = { hostName = "elastic1"; + interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.15"; prefixLength = 26; } ]; + defaultGateway = "172.20.73.1"; firewall = { allowedTCPPorts = [ 22 diff --git a/hosts/containers/logging/configuration.nix b/hosts/containers/logging/configuration.nix index 6b2cc8bc..aff727e8 100644 --- a/hosts/containers/logging/configuration.nix +++ b/hosts/containers/logging/configuration.nix @@ -17,6 +17,8 @@ networking = { hostName = "logging"; + interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.13"; prefixLength = 26; } ]; + defaultGateway = "172.20.73.1"; firewall = { allowedTCPPorts = [ 22 diff --git a/hosts/containers/mongo/configuration.nix b/hosts/containers/mongo/configuration.nix index e64e4dbc..8a0e334e 100644 --- a/hosts/containers/mongo/configuration.nix +++ b/hosts/containers/mongo/configuration.nix @@ -18,6 +18,8 @@ networking = { hostName = "mongo"; + interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.21"; prefixLength = 26; } ]; + defaultGateway = "172.20.73.1"; firewall = { allowedTCPPorts = [ 22 diff --git a/hosts/containers/mucbot/configuration.nix b/hosts/containers/mucbot/configuration.nix index 4ff67308..32b073e0 100644 --- a/hosts/containers/mucbot/configuration.nix +++ b/hosts/containers/mucbot/configuration.nix @@ -12,11 +12,9 @@ in ]; networking.hostName = "mucbot"; - networking.useNetworkd = true; - networking.useDHCP = false; - networking.interfaces.eth0.useDHCP = true; + networking.interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.27"; prefixLength = 26; } ]; + networking.defaultGateway = "172.20.73.1"; networking.nameservers = [ "172.20.73.8" "172.20.72.6" "172.20.72.10" "9.9.9.9" ]; - services.resolved.enable = false; users.users.tigger = { createHome = true; diff --git a/hosts/containers/scrape/configuration.nix b/hosts/containers/scrape/configuration.nix index bd174df0..d9e0c187 100644 --- a/hosts/containers/scrape/configuration.nix +++ b/hosts/containers/scrape/configuration.nix @@ -16,7 +16,8 @@ networking.hostName = "scrape"; - networking.useNetworkd = true; + networking.interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.32"; prefixLength = 26; } ]; + networking.defaultGateway = "172.20.73.1"; # Required for krops services.openssh.enable = true; diff --git a/hosts/containers/spaceapi/configuration.nix b/hosts/containers/spaceapi/configuration.nix index ceb6f4fa..95630a64 100644 --- a/hosts/containers/spaceapi/configuration.nix +++ b/hosts/containers/spaceapi/configuration.nix @@ -13,9 +13,8 @@ in ]; networking.hostName = "spaceapi"; - networking.useNetworkd = true; - networking.useDHCP = lib.mkForce true; - networking.firewall.allowedTCPPorts = [ 3000 3001 ]; + networking.interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.25"; prefixLength = 26; } ]; + networking.defaultGateway = "172.20.73.1"; services.spaceapi = { enable = true; diff --git a/lib/lxc-container.nix b/lib/lxc-container.nix index cad10c70..9b0e9ae8 100644 --- a/lib/lxc-container.nix +++ b/lib/lxc-container.nix @@ -12,7 +12,10 @@ nix.useSandbox = false; nix.maxJobs = lib.mkDefault 1; nix.buildCores = lib.mkDefault 4; + networking.useNetworkd = true; networking.useDHCP = false; + services.resolved.enable = false; + networking.nameservers = [ "172.20.73.8" "172.20.72.6" "172.20.72.10" "9.9.9.9" ]; networking.interfaces.eth0 = { useDHCP = true;