infrastructure/machines/vault01/networking.nix

70 lines
1.4 KiB
Nix

let
vlanName = "vlan-uplink-cri";
vlanAdmin = "vlan-admin";
linkIp = "10.120.33.250";
linkPrefix = "30";
upstreamRouterIp = "10.120.33.249";
publicIp = "129.199.195.129"; # sync with meta
linkPrefixedIp = "${linkIp}/${linkPrefix}";
in
{
systemd.network = {
networks = {
"10-enp67s0f0np0" = {
name = "enp67s0f0np0";
networkConfig = {
VLAN = [
vlanName
vlanAdmin
];
LinkLocalAddressing = false;
LLDP = false;
EmitLLDP = false;
IPv6AcceptRA = false;
IPv6SendRA = false;
};
};
"10-${vlanName}" = {
name = vlanName;
address = [ linkPrefixedIp ];
routes = [
{
routeConfig = {
PreferredSource = publicIp;
Gateway = upstreamRouterIp;
};
}
];
};
"10-${vlanAdmin}" = {
name = vlanAdmin;
address = [ "10.0.0.1/16" ];
};
};
netdevs = {
"10-${vlanName}" = {
netdevConfig = {
Name = vlanName;
Kind = "vlan";
};
vlanConfig = {
Id = 223;
};
};
"10-${vlanAdmin}" = {
netdevConfig = {
Name = vlanAdmin;
Kind = "vlan";
};
vlanConfig = {
Id = 3000;
};
};
};
};
}