2023-04-14 20:47:57 +00:00
|
|
|
{ ... }: {
|
|
|
|
networking = {
|
|
|
|
firewall = {
|
|
|
|
allowedUDPPorts = [
|
2023-04-23 18:20:12 +00:00
|
|
|
5553 # wireguard
|
2023-04-14 20:47:57 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-04-26 19:05:19 +00:00
|
|
|
nat = {
|
|
|
|
enable = true;
|
|
|
|
enableIPv6 = true;
|
|
|
|
externalInterface = "ens3";
|
|
|
|
internalInterfaces = [ "wg0" ];
|
|
|
|
};
|
2023-04-14 20:47:57 +00:00
|
|
|
|
|
|
|
wireguard.interfaces = {
|
|
|
|
wg0 = {
|
2023-04-26 18:49:54 +00:00
|
|
|
ips = [ "10.0.0.1/24" "fd02:002:002::1/64" ];
|
2023-04-14 20:47:57 +00:00
|
|
|
listenPort = 5553;
|
|
|
|
privateKeyFile = "/root/wg-private";
|
|
|
|
peers = [
|
|
|
|
{ # pixel
|
|
|
|
publicKey = "HS2q+PpPPwxqT1jCD7D4puqr4ZyaXV5TostavlYWBx0=";
|
2023-04-26 18:49:54 +00:00
|
|
|
allowedIPs = [ "10.0.0.2/32" "fd02:002:002::2/64" ];
|
2023-04-14 20:47:57 +00:00
|
|
|
}
|
|
|
|
{ # neodymium
|
|
|
|
publicKey = "IFeRvelEilNRLkhWgFKL9HrJ9XYsm+r4yvv23CigETk=";
|
2023-04-26 18:49:54 +00:00
|
|
|
allowedIPs = [ "10.0.0.3/32" "fd02:002:002::3/64" ];
|
2023-04-14 20:47:57 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|