Add a generic NAT table: port forward, source NAT, masquerade
router.firewall.nat replaces the dnat/toPort/hairpin fields of the filter rules. Filter rules gain natOnly, and may use wan with log and rate limit in the web UI. The Firewall page edits the NAT table and can add the matching allow rule. Settings schema 1 (migrations/1.jq) converts old forwards. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeFqV9dZrK6nipHkPfyM4F
This commit is contained in:
+22
-10
@@ -200,16 +200,28 @@ pkgs.testers.runNixOSTest {
|
||||
};
|
||||
# Only the PPP device is an uplink, so this must work from the ISP
|
||||
# and must not fire for traffic arriving from the LAN.
|
||||
firewall.rules = [
|
||||
{
|
||||
from = "wan";
|
||||
to = "main";
|
||||
destination = "192.168.10.51";
|
||||
protocol = "tcp";
|
||||
ports = [ 8080 ];
|
||||
dnat = true;
|
||||
}
|
||||
];
|
||||
firewall = {
|
||||
nat = [
|
||||
{
|
||||
type = "dnat";
|
||||
from = "wan";
|
||||
to = "main";
|
||||
toAddress = "192.168.10.51";
|
||||
protocol = "tcp";
|
||||
ports = [ 8080 ];
|
||||
}
|
||||
];
|
||||
rules = [
|
||||
{
|
||||
from = "wan";
|
||||
to = "main";
|
||||
destination = "192.168.10.51";
|
||||
protocol = "tcp";
|
||||
ports = [ 8080 ];
|
||||
natOnly = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
dns = {
|
||||
forwarders = [ ispV4 ];
|
||||
domain = "lan.test";
|
||||
|
||||
Reference in New Issue
Block a user