User Tools

Site Tools


docu:csheet:net:iptables:port_redirection

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous 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:8080 iptables -t nat -A OUTPUT -d 127.0.0.1 -p tcp --dport 80 -j DNAT --to-destination 127.0.0.1:8080
 +
 +# 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
 </code> </code>
docu/csheet/net/iptables/port_redirection.1585582678.txt.gz · Last modified: 2020/03/30 15:37 by admin