How to configure Dynamic NAT on Cisco IOS Router

Hello Sumit

There are two types of translation entries: Simple and Extended. A simple translation entry maps one IP address to another. The keyword extendable which indicates an extended translation entry indicates that the translation entry will map an IP address and port pair to another. The extended translation includes the port. An example of such a configuration is the following:

ip nat inside source static tcp 192.168.1.4 25 199.198.5.1 25 extendable
ip nat inside source static tcp 192.168.1.3 21 199.198.5.1 21 extendable
ip nat inside source static tcp 192.168.1.3 20 199.198.5.1 20 extendable
ip nat inside source static tcp 192.168.1.2 80 199.198.5.1 8080 extendable

Note in the final example that the inside and outside ports do not necessarily have to be the same.

The reversible keyword according to Cisco “enables outside-to-inside initiated sessions to use route maps for destination-based NAT.” This essentially means that a NAT translation entry will be created as soon as the router detects traffic flow from outside to inside using the specific NAT translation. Without this keyword, a NAT entry would only be created when the traffic is sourced from the inside network.

An example would be the following command:
Router(config)# ip nat inside source route-map MAP-A pool POOL-A reversible

This enables outside-to-inside initiated sessions to use route maps for destination-based NAT. Note the reversible keyword is used in conjunction with route maps only.

I hope this has been helpful!

Laz

2 Likes