From 7cae0dcd13290c68eb1c39a5c027dbbc3ad99ca1 Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Fri, 25 Sep 2020 12:24:57 +0200 Subject: [PATCH] Change wireguard to v6 --- common/default.nix | 1 + nixos/machines/apollo/configuration.nix | 4 ++-- nixos/machines/hera/network.nix | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common/default.nix b/common/default.nix index eab0ef6e..4afbd3c5 100644 --- a/common/default.nix +++ b/common/default.nix @@ -41,6 +41,7 @@ with lib; v4-p = "10.0.0"; in rec { hera = "${p}::1"; + hera-wg-host = "${p}::100:0:1"; hera-v4 = "213.136.94.190"; diff --git a/nixos/machines/apollo/configuration.nix b/nixos/machines/apollo/configuration.nix index a1669541..622fbb6f 100644 --- a/nixos/machines/apollo/configuration.nix +++ b/nixos/machines/apollo/configuration.nix @@ -33,12 +33,12 @@ in { peers = [{ publicKey = wireguard.pub.hera; 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"; persistentKeepalive = 25; }]; postSetup = - [ "${pkgs.iproute}/bin/ip route add ${prefix}::/64 dev m0wire" ]; + [ "${pkgs.iproute}/bin/ip route add ${prefix}::/96 dev m0wire" ]; }; }; }; diff --git a/nixos/machines/hera/network.nix b/nixos/machines/hera/network.nix index aa08d69f..7798ce38 100644 --- a/nixos/machines/hera/network.nix +++ b/nixos/machines/hera/network.nix @@ -14,6 +14,9 @@ in { ipv6.addresses = [{ address = hosts.hera; prefixLength = 128; + } { + address = hosts.hera-wg-host; + prefixLength = 128; }]; }; defaultGateway = "213.136.94.1";