Tag Archives: ports

IPTABLES: mapping ports with DNAT

If you want to redirect the web service for example, from the public IP address to a Private ones (located in your lan with private IP range) you use:

# iptables -t nat -A PREROUTING -p TCP --dport 80 -j DNAT --to-destination (replace with yours)

In this case I’m mapping the Web service from my Public Server to a Private ones.

Note: The Public server can have the port 80 closed in its firewall rules