System Gen162 @ 2025-04-23-23:20:41

This commit is contained in:
2025-04-23 23:20:42 +02:00
parent 3cb4093f45
commit 002308415d
2 changed files with 10 additions and 8 deletions

View File

@@ -1,6 +1,5 @@
{
config,
pkgs,
lib,
...
}: let
@@ -27,16 +26,10 @@ in {
networking.nat.externalInterface = "eth0";
networking.nat.internalInterfaces = ["wg0"];
# Interface with NAT for internet routing
# Interface without internet routing
networking.wireguard.interfaces."wg0" = {
ips = ["10.10.10.1/24"];
listenPort = cfg.port;
postSetup = ''
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o eth0 -j MASQUERADE
'';
postShutdown = ''
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.10.10.0/24 -o eth0 -j MASQUERADE
'';
inherit (cfg) privateKeyFile;