feat: dedicated ip portmap nftables table · n0-computer/patchbay@00a3c88 · GitHub
Skip to content

Commit 00a3c88

Browse files
committed
feat: dedicated ip portmap nftables table
Port mapping DNAT rules land in their own table at priority -110, one step before dstnat. The separation means Router::set_nat_mode can flush the ip nat table as it does today without wiping active port mappings. Rules match on ip daddr <wan_ip> so hairpin traffic follows the same path as inbound WAN. Rendering is a pure function; unit tests cover empty, UDP, TCP, and multi-rule cases. The apply helper deletes the table before reinstalling so each call is an atomic swap.
1 parent ef04ba8 commit 00a3c88

2 files changed

Lines changed: 152 additions & 3 deletions

File tree

patchbay/src/portmap/mod.rs

Lines changed: 6 additions & 3 deletions

patchbay/src/portmap/nft.rs

Lines changed: 146 additions & 0 deletions

0 commit comments

Comments
 (0)