Static Network Address Translation translates a local IP address to a global IP address. It is based on a static mapping configured on the router.
There are two types of static NAT, Inside Static NAT and Outside Static NAT
Inside Static NAT
Inside static NAT maps an inside local address, a private IP address, to a inside global public IP address.
As a result, the private IP addresses are hidden from the outside hosts.
To configure inside static NAT: On the public outside interface, enter the command
ip nat outside. On the inside interface, enter the command
ip nat inside. Finally with the physical interfaces set up, in global configuration mode configure the translation with
ip nat inside source static <inside-local-address> <inside-global-address>
The inside-global-address does not need to exist as a physically configured outside address on an interface on the router, but packets destined for that address on the outside must be forwarded towards the router.
When traffic enters a routers inside interface, the router will perform a route lookup for the destination interface on its outside interface. The router will be aware if the interface that the traffic entered is an inside interface, and check the network address table for any relevant configuration.
If the inside NAT entry configured on the router matches, the router will create a dynamic inside NAT entry with the packets destination set as the outside local and outside global addresses.
The source IP address of the packet will be changed from the inside interface to the outside interface.
On the return of traffic into the outside interface, the router will once again check the NAT table for an entry. It will discover and match the settings to the existing entry that was created earlier.
Outside Static NAT
Outside static NAT changes the mapping of an outside global IP address to an outside local private IP address. It allows external outside IP addresses to be hidden from inside hosts.
To configure outside static NAT, configure the outside interface with
ip nat outside. Next configure the inside interface with
ip nat inside. Finally configure the translation with the command
ip nat outside source static <outside-ip-address> <outside-private-address>. There is an optional additional configuration keyword called
add-route, add-route will insert a static address into the routing table.