1
0
Fork 0

Change wireguard to v6

This commit is contained in:
Malte Brandy 2020-09-25 12:24:57 +02:00
parent 9c0bca2f93
commit 7cae0dcd13
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
3 changed files with 6 additions and 2 deletions

View file

@ -41,6 +41,7 @@ with lib;
v4-p = "10.0.0"; v4-p = "10.0.0";
in rec { in rec {
hera = "${p}::1"; hera = "${p}::1";
hera-wg-host = "${p}::100:0:1";
hera-v4 = "213.136.94.190"; hera-v4 = "213.136.94.190";

View file

@ -33,12 +33,12 @@ in {
peers = [{ peers = [{
publicKey = wireguard.pub.hera; publicKey = wireguard.pub.hera;
allowedIPs = [ "::/0" ]; allowedIPs = [ "::/0" ];
endpoint = "${hosts.hera-v4}:${builtins.toString wireguard.port}"; endpoint = "[${hosts.hera-wg-host}]:${builtins.toString wireguard.port}";
presharedKeyFile = "/etc/nixos/common/secret/wireguard-psk"; presharedKeyFile = "/etc/nixos/common/secret/wireguard-psk";
persistentKeepalive = 25; persistentKeepalive = 25;
}]; }];
postSetup = postSetup =
[ "${pkgs.iproute}/bin/ip route add ${prefix}::/64 dev m0wire" ]; [ "${pkgs.iproute}/bin/ip route add ${prefix}::/96 dev m0wire" ];
}; };
}; };
}; };

View file

@ -14,6 +14,9 @@ in {
ipv6.addresses = [{ ipv6.addresses = [{
address = hosts.hera; address = hosts.hera;
prefixLength = 128; prefixLength = 128;
} {
address = hosts.hera-wg-host;
prefixLength = 128;
}]; }];
}; };
defaultGateway = "213.136.94.1"; defaultGateway = "213.136.94.1";