Rework OVH networking with systemd-networkd

This commit is contained in:
Charlotte Van Petegem 2022-11-18 20:36:32 +01:00
parent 591c61c978
commit 66e515a419
No known key found for this signature in database
GPG key ID: 019E764B7184435A

View file

@ -24,39 +24,42 @@
}; };
config = lib.mkIf config.chvp.base.network.ovh.enable { config = lib.mkIf config.chvp.base.network.ovh.enable {
networking = with config.chvp.base.network.ovh; { networking.useDHCP = false;
useDHCP = false; systemd.network = {
interfaces = { enable = true;
eno1.useDHCP = false; networks = with config.chvp.base.network.ovh; {
eno2.useDHCP = false;
eno3 = { eno3 = {
useDHCP = false; enable = true;
ipv4.addresses = [{ matchConfig = { Name = "eno3"; };
address = publicIPV4.ip; address = [
prefixLength = 24; "${publicIPV4.ip}/24"
}]; "${publicIPV6.ip}/64"
ipv6 = { ];
addresses = [{ gateway = [ publicIPV4.gateway ];
address = publicIPV6.ip; routes = [
prefixLength = 64; {
}]; routeConfig = {
routes = [{ Gateway = publicIPV6.gateway;
address = publicIPV6.gateway; GatewayOnLink = true;
prefixLength = 128; };
}]; }
}; ];
dns = [
"1.1.1.1"
"1.0.0.1"
"2606:4700:4700::1111"
"2606:4700:4700::1001"
];
}; };
eno4 = { eno4 = {
useDHCP = false; enable = true;
ipv4.addresses = [{ matchConfig = { Name = "eno4"; };
address = internalIPV4; address = [ "${internalIPV4}/16" ];
prefixLength = 16; routes = [
}]; { routeConfig = { Destination = "${internalIPV4}/16"; }; }
];
}; };
}; };
defaultGateway = publicIPV4.gateway;
defaultGateway6 = publicIPV6.gateway;
nameservers = [ "1.1.1.1" "1.0.0.1" "2606:4700:4700::1111" "2606:4700:4700::1001" ];
}; };
}; };
} }