From f8fb80f47727bbe510fa663ccc0151c2e5baa889 Mon Sep 17 00:00:00 2001 From: Maciej Jur Date: Tue, 11 Jul 2023 19:29:29 +0200 Subject: [PATCH] Configure wireguard --- hosts/kamoshi/configuration.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hosts/kamoshi/configuration.nix b/hosts/kamoshi/configuration.nix index d93cc14..be6764b 100644 --- a/hosts/kamoshi/configuration.nix +++ b/hosts/kamoshi/configuration.nix @@ -29,23 +29,24 @@ 2222 # ssh ]; allowedUDPPorts = [ - 51820 # wireguard + 42069 # wireguard ]; }; wireguard.interfaces = { wg0 = { ips = [ "10.100.0.1/24" ]; - listenPort = 51820; + listenPort = 42069; postSetup = '' ${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE ''; postShutdown = '' ${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE ''; + privateKeyFile = "/root/secrets/wireguard/kamoshi"; peers = [ { - publicKey = "TODO"; + publicKey = "26lQ3qCZrZ3hAqLIDfQNrmFQSQv983TeyXpJUY59QkI="; allowedIPs = [ "10.100.0.2/32" ]; } ];