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 10.10.0.15 (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

Advertisements

One thought on “IPTABLES: mapping ports with DNAT”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s