System Gen162 @ 2025-04-23-23:20:41
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user