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 {
|
config = mkIf cfg.enable {
|
||||||
networking =
|
networking = {
|
||||||
{
|
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
firewall.enable = lib.mkDefault false;
|
firewall.enable = lib.mkDefault false;
|
||||||
nameservers = [ "172.16.10.128" ];
|
nameservers = [ "172.16.10.128" ];
|
||||||
}
|
|
||||||
//
|
interfaces =
|
||||||
# Configuration du VLAN adm
|
lib.attrsets.mapAttrs'
|
||||||
|
(interface: conf: {
|
||||||
|
name = cfg."${interface}".interface;
|
||||||
|
value = conf;
|
||||||
|
})
|
||||||
(
|
(
|
||||||
if cfg.adm.enable then
|
lib.attrsets.filterAttrs (interface: _: cfg."${interface}".enable) {
|
||||||
{
|
# Configuration du VLAN adm
|
||||||
interfaces."${cfg.adm.interface}" = {
|
adm = {
|
||||||
ipv4.addresses = [
|
ipv4.addresses = [
|
||||||
{
|
{
|
||||||
address = "172.16.10.1${cfg.id}";
|
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 = {
|
ipv4 = {
|
||||||
addresses = [
|
addresses = [
|
||||||
{
|
{
|
||||||
|
@ -141,17 +135,9 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
|
||||||
else
|
|
||||||
{ }
|
|
||||||
)
|
|
||||||
|
|
||||||
//
|
|
||||||
# Configuration du VLAN srv-nat
|
# Configuration du VLAN srv-nat
|
||||||
(
|
srvNat = {
|
||||||
if cfg.srvNat.enable then
|
|
||||||
{
|
|
||||||
interfaces."${cfg.srvNat.interface}" = {
|
|
||||||
ipv4 = {
|
ipv4 = {
|
||||||
addresses = [
|
addresses = [
|
||||||
{
|
{
|
||||||
|
@ -184,16 +170,9 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
|
||||||
else
|
|
||||||
{ }
|
|
||||||
)
|
|
||||||
//
|
|
||||||
# Configuration du VLAN san
|
# Configuration du VLAN san
|
||||||
(
|
san = {
|
||||||
if cfg.san.enable then
|
|
||||||
{
|
|
||||||
interfaces."${cfg.san.interface}" = {
|
|
||||||
ipv4.addresses = [
|
ipv4.addresses = [
|
||||||
{
|
{
|
||||||
address = "172.16.4.1${cfg.id}";
|
address = "172.16.4.1${cfg.id}";
|
||||||
|
@ -209,8 +188,7 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{ }
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue