Configuration Examples for Network Address Translation Example: Configuring Static Translation of Inside Source Addresses The following example shows how inside hosts addressed from the 10.114.11.0 network are translated to the globally unique 172.31.233.208/28 network. Further, packets from outside hosts that are addressed from the 10.114.11.0 network (the true 10.114.11.0 network) are translated to appear from the 10.0.1.0/24 network. ip nat pool net-208 172.31.233.208 172.31.233.223 prefix-length 28 ip nat pool net-10 10.0.1.0 10.0.1.255 prefix-length 24 ip nat inside source list 1 pool net-208 ip nat outside source list 1 pool net-10 !
interface gigabitethernet 0/0/0 ip address 172.31.232.182 255.255.255.240 ip nat outside ! interface gigabitethernet 1/1/1 ip address 10.114.11.39 255.255.255.0 ip nat inside ! access-list 1 permit 10.114.11.0 0.0.0.255 The following example shows a static VRF aware NAT configuration to translate overlapping local addresses: ip nat inside source static 192.168.121.33 10.2.2.1 vrf vrf1 ip nat inside source static 192.168.121.33.10.2.2.2 vrf vrf2 Example: Configuring Dynamic Translation of Inside Source Addresses The following example shows how inside hosts addressed from either the 192.168.1.0 or the 192.168.2.0 network are translated to the globally unique 172.31.233.208/28 network:
ip nat pool net-208 172.31.233.208 172.31.233.223 prefix-length 9 ip nat inside source list 1 pool net-208 ! interface gigabitethernet 0/0/0 ip address 172.31.232.182 255.255.255.240 ip nat outside ! interface gigabitethernet 1/1/1 ip address 192.168.1.94 255.255.255.0 ip nat inside ! access-list 1 permit 192.168.1.0 0.0.0.255 access-list 1 permit 192.168.2.0 0.0.0.255 ! Configuring Network Address Translation Configuration Examples for Network Address Translation Command or Action Purpose Step 9 end Example: Switch(config-if)# end Exits interface configuration mode and returns to privileged EXEC mode. Configuring Network Address Translation 31