1
0

modules/wg-clerie: add module for public IPv6 vpn

This commit is contained in:
2023-04-23 15:31:54 +02:00
parent 93f1fa77e0
commit c8acc39d8d
3 changed files with 71 additions and 32 deletions

View File

@@ -26,39 +26,10 @@
networking.firewall.enable = false;
networking.iproute2.enable = true;
networking.iproute2.rttablesExtraConfig = ''
200 wg-clerie
'';
petabyte.policyrouting = {
services.wg-clerie = {
enable = true;
rules6 = [
{ rule = "from 2a01:4f8:c0c:15f1::8108/128 lookup wg-clerie"; prio = 20000; }
{ rule = "from 2a01:4f8:c0c:15f1::8108/128 unreachable"; prio = 20001; }
];
rules4 = [
{ rule = "from 10.20.30.108/32 lookup wg-clerie"; prio = 20000; }
{ rule = "from 10.20.30.108/32 unreachable"; prio = 20001; }
];
};
networking.wireguard.enable = true;
networking.wireguard.interfaces = {
wg-clerie = {
ips = [ "2a01:4f8:c0c:15f1::8108/128" "10.20.30.108/32" ];
table = "wg-clerie";
peers = [
{
endpoint = "vpn.clerie.de:51820";
persistentKeepalive = 25;
allowedIPs = [ "0.0.0.0/0" "::/0" "10.20.30.0/24" "2a01:4f8:c0c:15f1::/113" ];
publicKey = "2p1Jqs3bkXbXHFWE6vp1yxHIFoUaZQEARS2nJzbkuBA=";
}
];
privateKeyFile = "/var/src/secrets/wireguard/wg-clerie";
};
ipv6s = [ "2a01:4f8:c0c:15f1::8108/128" ];
ipv4s = [ "10.20.30.108/32" ];
};
clerie.monitoring = {