Nftables dnat config

From AcrodusWiki
Revision as of 21:17, 18 January 2025 by Alex (talk | contribs) (Created page with "Example nftables dnat config. This took a while to set up at first, make sure there is config for packets going in the reverse direction ie. masquerade. table ip nat { chain prerouting { type nat hook prerouting priority dstnat; policy accept; tcp dport 2202 dnat to 10.0.3.2 } chain postrouting { type nat hook postrouting priority srcnat; policy accept; } }")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Example nftables dnat config. This took a while to set up at first, make sure there is config for packets going in the reverse direction ie. masquerade.

table ip nat {

       chain prerouting {
               type nat hook prerouting priority dstnat; policy accept;
               tcp dport 2202 dnat to 10.0.3.2
       }
       chain postrouting {
               type nat hook postrouting priority srcnat; policy accept;
       }

}