Configuring Network Address Translation Configuring Static Translation of Inside Source Addresses Command or Action Purpose Step 2 configure terminal Example: Switch# configure terminal Enters global configuration mode. Step 3 Use any of the following commands depending on the requirement:
• ip nat inside source static local-ip global-ip Switch(config)# ip nat inside source static 10.10.10.1 172.16.131.1 • ip nat inside source static protocol local-ip port global-ip port Switch(config)# ip nat inside source static tcp 10.10.10.1 1234 172.16.131.1 5467 • ip nat inside source static network local-ip global-ip {prefix len len | _ subnet subnet-mask} Switch(config)# ip nat inside source static network 10.10.10.1 172.16.131.1 prefix len 24 _ • ip nat inside source static local-ip global-ip vrf vrf-name Switch(config)# ip nat inside source static 10.10.10.1 172.16.131.1 vrf vrf1 • Establishes static translation between an inside local address and an inside global address.
• Establishes a static port translation between an inside local address and an inside global address. • Allows a static translation mapping for an entire subnet without the need for specifying multiple individual translation rules. You can specify the translation mapping for the desired subnet. The actual translation is performed by translating the network portion of the address with the host the portion remaining unchanged. • Makes the static translation VRF aware and associates the given rule with the specified VRF. Step 4 interface type number Example: Switch(config)# interface ethernet 1 Specifies an interface and enters interface configuration mode.
Step 5 ip address ip-address mask [secondary] Example: Switch(config-if)# ip address 10.114.11.39 255.255.255.0 Sets a primary IP address for an interface. Step 6 ip nat inside Example: Switch(config-if)# ip nat inside Connects the interface to the inside network, which is subject to NAT. Step 7 exit Example: Switch(config-if)# exit Exits interface configuration mode and returns to global configuration mode. Configuring Network Address Translation 14