+ AZ-PLT-1
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.az.plt1.vswitch;
|
||||
in {
|
||||
options.az.plt1.vswitch = {
|
||||
enable = mkEnableOption "netcup vSwitch-Interface (10.10.0.2/24, MTU 1400) auf dem Public-Link";
|
||||
|
||||
vlanId = mkOption {
|
||||
type = types.int;
|
||||
default = 0;
|
||||
description = "VLAN-ID des netcup vSwitch (aus dem netcup-Ticket/CCP).";
|
||||
};
|
||||
|
||||
address = mkOption {
|
||||
type = types.str;
|
||||
default = "10.10.0.2/24";
|
||||
description = "Statische vSwitch-Adresse von AZ-PLT-1 (Gesamtplan: 10.10.0.0/24).";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.network.netdevs."20-vswitch" = {
|
||||
netdevConfig = {
|
||||
Kind = "vlan";
|
||||
Name = "vswitch";
|
||||
};
|
||||
vlanConfig.Id = cfg.vlanId;
|
||||
};
|
||||
|
||||
systemd.network.networks."20-vswitch" = {
|
||||
matchConfig.Name = "vswitch";
|
||||
linkConfig.MTUBytes = "1400";
|
||||
address = [cfg.address];
|
||||
};
|
||||
|
||||
systemd.network.networks."10-public".vlan = ["vswitch"];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user