2023-01-16 03:44:21 +00:00
|
|
|
# It just contains a set of network-related variables mainly used for
|
|
|
|
# network-related services. Make sure to change this every time you migrate to
|
|
|
|
# a new server.
|
2023-01-20 06:50:27 +00:00
|
|
|
let
|
|
|
|
inherit (builtins) toString;
|
|
|
|
in
|
2023-01-19 12:12:14 +00:00
|
|
|
rec {
|
2023-02-22 03:29:43 +00:00
|
|
|
# This is expected to be /48 block (i.e., `fc00:b0de:5685::/48`).
|
|
|
|
# The thing is generated using a ULA generator.
|
|
|
|
privateIPv6Prefix = "fd89:c181:8016";
|
2023-02-08 10:00:35 +00:00
|
|
|
|
2023-02-09 06:17:59 +00:00
|
|
|
# These blocks should be used sparingly with how wide these blocks cover.
|
|
|
|
# Plus, they shouldn't be treated as subnets.
|
2023-02-08 10:00:35 +00:00
|
|
|
clientNetworks = [
|
|
|
|
"172.24.0.0/13"
|
|
|
|
"10.128.0.0/9"
|
2023-02-09 06:17:59 +00:00
|
|
|
"fd00::/8"
|
2023-02-08 10:00:35 +00:00
|
|
|
];
|
|
|
|
serverNetworks = [
|
|
|
|
"172.16.0.0/13"
|
|
|
|
"10.0.0.0/9"
|
2023-02-09 06:17:59 +00:00
|
|
|
"fc00::/8"
|
2023-02-08 10:00:35 +00:00
|
|
|
];
|
|
|
|
|
2023-02-09 06:17:59 +00:00
|
|
|
interfaces =
|
|
|
|
let
|
|
|
|
ploverInternalNetworkGateway = "172.16.0.1";
|
|
|
|
ipv6Gateway = "fe80::1";
|
|
|
|
in
|
2023-01-25 03:38:45 +00:00
|
|
|
{
|
2023-02-09 06:51:22 +00:00
|
|
|
# This is the public-facing interface. Any interface name with a prime
|
|
|
|
# symbol means it's a public-facing interface.
|
2023-06-22 10:01:19 +00:00
|
|
|
wan = {
|
2023-06-11 04:26:02 +00:00
|
|
|
ifname = "ens3";
|
2023-02-09 06:51:22 +00:00
|
|
|
# The gateways for the public addresses are retrieved from the following
|
|
|
|
# pages:
|
|
|
|
#
|
|
|
|
# * https://docs.hetzner.com/cloud/networks/faq/#are-any-ip-addresses-reserved
|
|
|
|
# * https://docs.hetzner.com/robot/dedicated-server/ip/additional-ip-adresses/#gateway
|
|
|
|
IPv4 = {
|
|
|
|
address = "65.109.224.213";
|
|
|
|
gateway = "172.31.1.1";
|
|
|
|
};
|
|
|
|
IPv6 = {
|
|
|
|
address = "2a01:4f9:c012:607a::1";
|
|
|
|
gateway = ipv6Gateway;
|
|
|
|
};
|
2023-01-25 03:38:45 +00:00
|
|
|
};
|
2023-01-19 12:12:14 +00:00
|
|
|
|
2023-06-22 10:01:19 +00:00
|
|
|
lan = {
|
2023-06-11 04:26:02 +00:00
|
|
|
ifname = "ens10";
|
2023-02-09 06:17:59 +00:00
|
|
|
IPv4 = {
|
|
|
|
address = "172.27.0.1";
|
|
|
|
gateway = ploverInternalNetworkGateway;
|
|
|
|
};
|
|
|
|
IPv6 = {
|
2023-02-14 03:00:57 +00:00
|
|
|
address = "${privateIPv6Prefix}::1";
|
2023-02-09 06:17:59 +00:00
|
|
|
gateway = ipv6Gateway;
|
|
|
|
};
|
2023-01-25 03:38:45 +00:00
|
|
|
};
|
2023-01-16 03:44:21 +00:00
|
|
|
|
2023-02-09 06:17:59 +00:00
|
|
|
wireguard0 = {
|
2023-06-11 04:26:02 +00:00
|
|
|
ifname = "wireguard0";
|
2023-02-09 06:17:59 +00:00
|
|
|
IPv4 = {
|
|
|
|
address = "172.28.0.1";
|
|
|
|
gateway = ploverInternalNetworkGateway;
|
|
|
|
};
|
|
|
|
IPv6 = {
|
2023-02-14 03:00:57 +00:00
|
|
|
address = "${wireguardIPv6Prefix}::1";
|
2023-02-09 06:17:59 +00:00
|
|
|
gateway = ipv6Gateway;
|
|
|
|
};
|
2023-01-29 04:48:56 +00:00
|
|
|
};
|
2023-01-23 09:46:32 +00:00
|
|
|
};
|
2023-01-21 10:57:37 +00:00
|
|
|
|
|
|
|
# Wireguard-related things.
|
2023-01-17 08:05:11 +00:00
|
|
|
wireguardPort = 51820;
|
2023-01-23 05:29:42 +00:00
|
|
|
|
2023-02-09 06:17:59 +00:00
|
|
|
# This IPv4 network block should have /13 for the Wireguard network.
|
|
|
|
wireguardIPv4Prefix = "172.28.0";
|
|
|
|
|
|
|
|
# This IPv6 network prefix should have /64 for the entire Wireguard network.
|
2023-02-14 03:00:57 +00:00
|
|
|
wireguardIPv6Prefix = "${privateIPv6Prefix}:ffff";
|
2023-02-09 06:17:59 +00:00
|
|
|
|
|
|
|
# These are all fixed IP addresses. However, they should be assigned in /16
|
|
|
|
# and /64 for IPv4 and IPv6 block respectively.
|
2023-01-23 05:29:42 +00:00
|
|
|
wireguardPeers = {
|
2023-01-25 03:38:45 +00:00
|
|
|
server = with interfaces.wireguard0; {
|
|
|
|
IPv4 = IPv4.address;
|
|
|
|
IPv6 = IPv6.address;
|
|
|
|
};
|
2023-01-23 05:29:42 +00:00
|
|
|
desktop = {
|
2023-02-09 06:17:59 +00:00
|
|
|
IPv4 = "${wireguardIPv4Prefix}.2";
|
2023-02-14 03:00:57 +00:00
|
|
|
IPv6 = "${wireguardIPv6Prefix}::2";
|
2023-01-23 05:29:42 +00:00
|
|
|
};
|
|
|
|
phone = {
|
2023-02-09 06:17:59 +00:00
|
|
|
IPv4 = "${wireguardIPv4Prefix}.3";
|
2023-02-14 03:00:57 +00:00
|
|
|
IPv6 = "${wireguardIPv6Prefix}::3";
|
2023-01-23 05:29:42 +00:00
|
|
|
};
|
|
|
|
};
|
2023-02-08 10:00:35 +00:00
|
|
|
|
|
|
|
secondaryNameServers = {
|
|
|
|
"ns1.first-ns.de." = {
|
|
|
|
IPv4 = [ "213.239.242.238" ];
|
|
|
|
IPv6 = [ "2a01:4f8:0:a101::a:1" ];
|
|
|
|
};
|
|
|
|
"robotns2.second-ns.de." = {
|
|
|
|
IPv4 = [ "213.133.105.6" ];
|
|
|
|
IPv6 = [ "2a01:4f8:d0a:2004::2" ];
|
|
|
|
};
|
|
|
|
"robotns3.second-ns.com." = {
|
|
|
|
IPv4 = [ "193.47.99.3" ];
|
|
|
|
IPv6 = [ "2001:67c:192c::add:a3" ];
|
|
|
|
};
|
|
|
|
};
|
2023-01-16 03:44:21 +00:00
|
|
|
}
|