This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| docu:csheet:net:iptables:port_redirection [2020/03/30 15:37] – admin | docu:csheet:net:iptables:port_redirection [2020/07/19 22:32] (current) – admin | ||
|---|---|---|---|
| Line 17: | Line 17: | ||
| # example: | # example: | ||
| iptables -t nat -A OUTPUT -d 127.0.0.1 -p tcp --dport 80 -j DNAT --to-destination 127.0.0.1: | iptables -t nat -A OUTPUT -d 127.0.0.1 -p tcp --dport 80 -j DNAT --to-destination 127.0.0.1: | ||
| + | |||
| + | # nat 1:1 port from public to private IP space | ||
| + | iptables -t nat -A POSTROUTING -j MASQUERADE | ||
| + | iptables -t nat -A PREROUTING -d [A_PUBLIC_IP] -p tcp --dport 222 -j DNAT --to-destination [LAN_IP]:22 | ||
| </ | </ | ||