add possibility of DMZ connectivity on hypervisor

This commit is contained in:
Pim Kunis 2023-12-30 16:11:28 +01:00
parent 0518fb5949
commit d9f697d171
3 changed files with 59 additions and 44 deletions

View file

@ -39,6 +39,7 @@
nixosModule.lab = { nixosModule.lab = {
disko.osDiskDevice = "/dev/sda"; disko.osDiskDevice = "/dev/sda";
backups.enable = true; backups.enable = true;
networking.allowDMZConnectivity = true;
dataDisk = { dataDisk = {
enable = true; enable = true;

View file

@ -6,5 +6,6 @@
./k3s ./k3s
./disko.nix ./disko.nix
./backups.nix ./backups.nix
./networking.nix
]; ];
} }

View file

@ -1,4 +1,15 @@
{ { lib, config, ... }:
let cfg = config.lab.networking;
in {
options.lab.networking.allowDMZConnectivity = lib.mkOption {
default = false;
type = lib.types.bool;
description = ''
Whether to create a networking interface on the DMZ bridge.
'';
};
config = {
networking = { networking = {
domain = "hyp"; domain = "hyp";
firewall.enable = true; firewall.enable = true;
@ -54,6 +65,8 @@
networkConfig = { networkConfig = {
IPv6AcceptRA = false; IPv6AcceptRA = false;
LinkLocalAddressing = "no"; LinkLocalAddressing = "no";
DHCP = lib.mkIf cfg.allowDMZConnectivity "yes";
};
}; };
}; };
}; };