Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Conditional NAT !

Hi all. I have a static port redirection example like below

ip nat inside source static

But i want to use this translation only when a packet comes from a specific IP only. This translation shall only work when a packet lets say comes from destined to should be translated to All other packets sourced from other IPs shall not get translated !!

Pls guide me in this

Cisco Employee

Re: Conditional NAT !


This requires using a NAT pool and a properly formatted ACL. Assume that you have a host and you want it to be translated to when it talks to, say, All other flows from that or any other hosts shall be left untranslated.

The configuration would be as follows:

ip nat pool MyPool netmask

access-list 100 permit ip host host

ip nat inside source list 100 pool MyPool

As a terminology note, what you have configured now is not strictly a port redirection - it is only a simple 1:1 static NAT between two addresses. It would be a port redirection (or better - a port forwarding) if you had defined a particular port and transport protocol that should be NATted.

Best regards,