iptables, nft: add masquerade example (#6979)

This commit is contained in:
Richard Mörbitz
2021-11-05 00:36:44 +01:00
committed by GitHub
parent a51f7f6ce1
commit 15c9047cb8
2 changed files with 8 additions and 0 deletions

View File

@@ -19,6 +19,10 @@
`sudo iptables -A {{chain}} -s {{ip}} -p {{protocol}} --dport {{port}} -j {{rule}}`
- Add a NAT rule to translate all traffic from the `192.168.0.0/24` subnet to the host's public IP:
`sudo iptables -t {{nat}} -A {{POSTROUTING}} -s {{192.168.0.0/24}} -j {{MASQUERADE}}`
- Delete chain rule:
`sudo iptables -D {{chain}} {{rule_line_number}}`