defiant: allow wireguard routing

This commit is contained in:
Felix Albrigtsen 2024-01-25 13:25:05 +01:00
parent 09c0fdb08c
commit 60a68859f3
1 changed files with 9 additions and 1 deletions

View File

@ -15,12 +15,20 @@ in {
listenPort = 51820;
privateKeyFile = "/etc/wireguard/defiant.private";
postSetup = ''
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -d 192.168.10.0/24 -o eth0 -j MASQUERADE
'';
postShutdown = ''
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -d 192.168.10.0/24 -o eth0 -j MASQUERADE
'';
peers = [
{ # Burnham
publicKey = "JcfyrMoZmnbibVLaIKuGSARAX2alFv4kwLbJaLBNbzo=";
persistentKeepalive = 60;
allowedIPs = [
"10.100.0.2/32"
# "192.168.11.0/24"
"192.168.11.0/24"
];
}
{ # Sulu