implement local nat for truenas

This commit is contained in:
RootHost-Stormwind
2025-01-13 23:43:39 +01:00
parent b753ca4aec
commit f3ca122b0d

View File

@@ -4,6 +4,41 @@
networking = { networking = {
hostName = "Stormwind"; hostName = "Stormwind";
networkmanager.enable = true; networkmanager.enable = true;
nftables = {
enable = true;
ruleset = ''
table ip nat {
chain PREROUTING {
type nat hook prerouting priority dstnat; policy accept;
iifname "enp3s0" tcp dport 80 dnat to 10.94.157.229:80
iifname "enp3s0" tcp dport 443 dnat to 10.94.157.229:443
}
}
'';
};
firewall = {
allowedTCPPorts = [ 80 443 ];
};
nat = {
enable = true;
internalInterfaces = [ "incusbr0" ];
externalInterface = "enp3s0";
forwardPorts = [
{
sourcePort = 80;
proto = "tcp";
destination = "10.94.157.229:80";
}
{
sourcePort = 443;
proto = "tcp";
destination = "10.94.157.229:443";
}
];
};
}; };
} }