mirror of https://gitlab.crans.org/nounous/nixos
Corrections problèmes réseaux
parent
89ae1f5475
commit
644216378f
|
@ -72,18 +72,21 @@ in
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
networking =
|
||||
{
|
||||
useDHCP = false;
|
||||
firewall.enable = lib.mkDefault false;
|
||||
nameservers = [ "172.16.10.128" ];
|
||||
}
|
||||
//
|
||||
# Configuration du VLAN adm
|
||||
(
|
||||
if cfg.adm.enable then
|
||||
{
|
||||
interfaces."${cfg.adm.interface}" = {
|
||||
networking = {
|
||||
useDHCP = false;
|
||||
firewall.enable = lib.mkDefault false;
|
||||
nameservers = [ "172.16.10.128" ];
|
||||
|
||||
interfaces =
|
||||
lib.attrsets.mapAttrs'
|
||||
(interface: conf: {
|
||||
name = cfg."${interface}".interface;
|
||||
value = conf;
|
||||
})
|
||||
(
|
||||
lib.attrsets.filterAttrs (interface: _: cfg."${interface}".enable) {
|
||||
# Configuration du VLAN adm
|
||||
adm = {
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "172.16.10.1${cfg.id}";
|
||||
|
@ -98,18 +101,9 @@ in
|
|||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
else
|
||||
{ }
|
||||
)
|
||||
//
|
||||
# Configuration du VLAN srv
|
||||
(
|
||||
if cfg.srv.enable then
|
||||
{
|
||||
firewall.enable = true;
|
||||
|
||||
interfaces."${cfg.srv.interface}" = {
|
||||
# Configuration du VLAN srv
|
||||
srv = {
|
||||
ipv4 = {
|
||||
addresses = [
|
||||
{
|
||||
|
@ -141,17 +135,9 @@ in
|
|||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{ }
|
||||
)
|
||||
|
||||
//
|
||||
# Configuration du VLAN srv-nat
|
||||
(
|
||||
if cfg.srvNat.enable then
|
||||
{
|
||||
interfaces."${cfg.srvNat.interface}" = {
|
||||
# Configuration du VLAN srv-nat
|
||||
srvNat = {
|
||||
ipv4 = {
|
||||
addresses = [
|
||||
{
|
||||
|
@ -184,16 +170,9 @@ in
|
|||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{ }
|
||||
)
|
||||
//
|
||||
# Configuration du VLAN san
|
||||
(
|
||||
if cfg.san.enable then
|
||||
{
|
||||
interfaces."${cfg.san.interface}" = {
|
||||
|
||||
# Configuration du VLAN san
|
||||
san = {
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "172.16.4.1${cfg.id}";
|
||||
|
@ -209,8 +188,7 @@ in
|
|||
];
|
||||
};
|
||||
}
|
||||
else
|
||||
{ }
|
||||
);
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue