2022-01-25 18:12:54 +01:00
|
|
|
{ lib, ... }:
|
|
|
|
let mkAddress = addr: let
|
|
|
|
splitted = lib.splitString "/" addr;
|
|
|
|
elemAt = builtins.elemAt splitted;
|
|
|
|
in
|
|
|
|
{ address = (elemAt 0); prefixLength = lib.toInt (elemAt 1); };
|
|
|
|
in {
|
2021-11-13 00:59:59 +01:00
|
|
|
networking = {
|
|
|
|
hostName = "public-cof";
|
|
|
|
|
2022-01-25 18:12:54 +01:00
|
|
|
# Default IPv4 exit route
|
|
|
|
defaultGateway = {
|
|
|
|
address = "";
|
|
|
|
interface = "ens20";
|
|
|
|
};
|
|
|
|
localCommands = "ip route add default dev ens20 metric 10";
|
|
|
|
|
2021-11-13 00:59:59 +01:00
|
|
|
useDHCP = false;
|
|
|
|
interfaces.ens18 = {
|
|
|
|
useDHCP = true;
|
|
|
|
ipv6.addresses = [{
|
|
|
|
address = "2001:470:1f13:187:c08e:feff:fe4d:f5f5";
|
|
|
|
prefixLength = 64;
|
|
|
|
}];
|
|
|
|
};
|
2022-01-24 22:04:43 +01:00
|
|
|
interfaces.ens19 = {
|
2022-03-05 23:16:54 +01:00
|
|
|
useDHCP = false;
|
|
|
|
ipv4.addresses = [{
|
|
|
|
address = "10.1.1.21";
|
|
|
|
prefixLength = 22;
|
|
|
|
}];
|
2022-01-24 22:04:43 +01:00
|
|
|
};
|
2021-11-13 00:59:59 +01:00
|
|
|
|
2022-01-25 18:12:54 +01:00
|
|
|
interfaces.ens20 = {
|
|
|
|
ipv4.addresses = map mkAddress [ "45.13.104.27/32" ];
|
|
|
|
};
|
|
|
|
|
2021-11-13 00:59:59 +01:00
|
|
|
firewall.allowedTCPPorts = [ 22 ];
|
|
|
|
firewall.enable = true;
|
|
|
|
};
|
|
|
|
}
|