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 = {
disko.osDiskDevice = "/dev/sda";
backups.enable = true;
networking.allowDMZConnectivity = true;
dataDisk = {
enable = true;

View file

@ -6,5 +6,6 @@
./k3s
./disko.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 = {
domain = "hyp";
firewall.enable = true;
@ -54,6 +65,8 @@
networkConfig = {
IPv6AcceptRA = false;
LinkLocalAddressing = "no";
DHCP = lib.mkIf cfg.allowDMZConnectivity "yes";
};
};
};
};