Browse Source

static ipv4 configuration for containers in the serv subnet

master
Astro 5 months ago
parent
commit
95b8272413

+ 3
- 0
hosts/containers/deployer/configuration.nix View File

@@ -25,6 +25,9 @@
25 25
     htop
26 26
   ];
27 27
 
28
+  networking.interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.16"; prefixLength = 26; } ];
29
+  networking.defaultGateway = "172.20.73.1";
30
+
28 31
   networking = {
29 32
     hostName = "deployer";
30 33
     # usePredictableInterfacenames = false;

+ 1
- 0
hosts/containers/dnscache/configuration.nix View File

@@ -22,6 +22,7 @@
22 22
   networking.interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.8"; prefixLength = 26; } ];
23 23
   networking.defaultGateway = "172.20.73.1";
24 24
   services.resolved.enable = false;
25
+  networking.nameservers = [ "172.20.73.8" "172.20.72.6" "172.20.72.10" "9.9.9.9" ];
25 26
 
26 27
   # Set your time zone.
27 28
   time.timeZone = "Europe/Berlin";

+ 2
- 0
hosts/containers/elastic/configuration.nix View File

@@ -17,6 +17,8 @@
17 17
 
18 18
   networking = {
19 19
     hostName = "elastic1";
20
+    interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.15"; prefixLength = 26; } ];
21
+    defaultGateway = "172.20.73.1";
20 22
     firewall = {
21 23
       allowedTCPPorts = [ 
22 24
         22

+ 2
- 0
hosts/containers/logging/configuration.nix View File

@@ -17,6 +17,8 @@
17 17
 
18 18
   networking = {
19 19
     hostName = "logging";
20
+    interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.13"; prefixLength = 26; } ];
21
+    defaultGateway = "172.20.73.1";
20 22
     firewall = {
21 23
       allowedTCPPorts = [ 
22 24
         22

+ 2
- 0
hosts/containers/mongo/configuration.nix View File

@@ -18,6 +18,8 @@
18 18
 
19 19
   networking = {
20 20
     hostName = "mongo";
21
+    interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.21"; prefixLength = 26; } ];
22
+    defaultGateway = "172.20.73.1";
21 23
     firewall = {
22 24
       allowedTCPPorts = [ 
23 25
         22

+ 2
- 4
hosts/containers/mucbot/configuration.nix View File

@@ -12,11 +12,9 @@ in
12 12
     ];
13 13
 
14 14
   networking.hostName = "mucbot";
15
-  networking.useNetworkd = true;
16
-  networking.useDHCP = false;
17
-  networking.interfaces.eth0.useDHCP = true;
15
+  networking.interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.27"; prefixLength = 26; } ];
16
+  networking.defaultGateway = "172.20.73.1";
18 17
   networking.nameservers = [ "172.20.73.8" "172.20.72.6" "172.20.72.10" "9.9.9.9" ];
19
-  services.resolved.enable = false;
20 18
 
21 19
   users.users.tigger = {
22 20
     createHome = true;

+ 2
- 1
hosts/containers/scrape/configuration.nix View File

@@ -16,7 +16,8 @@
16 16
 
17 17
 
18 18
   networking.hostName = "scrape";
19
-  networking.useNetworkd = true;
19
+  networking.interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.32"; prefixLength = 26; } ];
20
+  networking.defaultGateway = "172.20.73.1";
20 21
 
21 22
   # Required for krops
22 23
   services.openssh.enable = true;

+ 2
- 3
hosts/containers/spaceapi/configuration.nix View File

@@ -13,9 +13,8 @@ in
13 13
     ];
14 14
 
15 15
   networking.hostName = "spaceapi";
16
-  networking.useNetworkd = true;
17
-  networking.useDHCP = lib.mkForce true;
18
-  networking.firewall.allowedTCPPorts = [ 3000 3001 ];
16
+  networking.interfaces.eth0.ipv4.addresses = [ { address = "172.20.73.25"; prefixLength = 26; } ];
17
+  networking.defaultGateway = "172.20.73.1";
19 18
 
20 19
   services.spaceapi = {
21 20
     enable = true;

+ 3
- 0
lib/lxc-container.nix View File

@@ -12,7 +12,10 @@
12 12
   nix.useSandbox = false;
13 13
   nix.maxJobs = lib.mkDefault 1;
14 14
   nix.buildCores = lib.mkDefault 4;
15
+  networking.useNetworkd = true;
15 16
   networking.useDHCP = false;
17
+  services.resolved.enable = false;
18
+  networking.nameservers = [ "172.20.73.8" "172.20.72.6" "172.20.72.10" "9.9.9.9" ];
16 19
 
17 20
   networking.interfaces.eth0 = {
18 21
     useDHCP = true;

Loading…
Cancel
Save