forked from malobeo/infrastructure
[hosts] use hostId in offsite net
This commit is contained in:
@@ -3,16 +3,18 @@
|
||||
let
|
||||
createMaloNet = hostId: mac: {
|
||||
local = true;
|
||||
hostId = hostId;
|
||||
address = "192.168.1.${hostId}";
|
||||
gateway = "192.168.1.1";
|
||||
nameservers = [ "192.168.1.17" "1.1.1.1" ]; #setting ns1 as nameserver
|
||||
mac = mac;
|
||||
};
|
||||
|
||||
createOffsiteNet = address: mac: {
|
||||
createOffsiteNet = hostId: mac: {
|
||||
local = false;
|
||||
address = address;
|
||||
gateway = "10.0.10.1";
|
||||
hostId = hostId;
|
||||
address = "10.0.0.${hostId}";
|
||||
gateway = "10.0.0.1";
|
||||
nameservers = [ "1.1.1.1" ];
|
||||
mac = mac;
|
||||
};
|
||||
@@ -25,6 +27,7 @@ in
|
||||
type = "host";
|
||||
network = {
|
||||
local = true;
|
||||
hostId = "11";
|
||||
address = "192.168.1.11";
|
||||
};
|
||||
};
|
||||
@@ -33,6 +36,7 @@ in
|
||||
type = "host";
|
||||
network = {
|
||||
local = true;
|
||||
hostId = "12";
|
||||
address = "192.168.1.12";
|
||||
};
|
||||
};
|
||||
@@ -41,6 +45,7 @@ in
|
||||
type = "host";
|
||||
network = {
|
||||
local = true;
|
||||
hostId = "13";
|
||||
address = "192.168.1.13";
|
||||
};
|
||||
};
|
||||
@@ -49,6 +54,7 @@ in
|
||||
type = "rpi";
|
||||
network = {
|
||||
local = true;
|
||||
hostId = "15";
|
||||
address = "192.168.1.15";
|
||||
};
|
||||
};
|
||||
@@ -60,7 +66,7 @@ in
|
||||
|
||||
vpn = {
|
||||
type = "microvm";
|
||||
network = createOffsiteNet "10.0.0.10" "52:DA:0D:F9:EF:E6";
|
||||
network = createOffsiteNet "10" "52:DA:0D:F9:EF:E6";
|
||||
};
|
||||
|
||||
infradocs = {
|
||||
@@ -70,7 +76,7 @@ in
|
||||
|
||||
uptimekuma = {
|
||||
type = "microvm";
|
||||
network = createOffsiteNet "10.0.0.12" "52:DA:0D:F9:EF:E8";
|
||||
network = createOffsiteNet "12" "52:DA:0D:F9:EF:E8";
|
||||
};
|
||||
|
||||
nextcloud = {
|
||||
|
||||
Reference in New Issue
Block a user