Static NAT Configuration
OK, let’s start looking at some actual commands (see Table 8.3) used with NAT:
Let’s take a look at a simple basic static NAT configuration:
ip nat inside source static 10.1.1.1 170.46.2.2
!
interface Ethernet0
ip address 10.1.1.10 255.255.255.0
ip nat inside
!
interface Serial0
ip address 170.46.2.1 255.255.255.0
ip nat outside
!
In the preceding router output, the
ip nat inside source
command identifies which IP
addresses will be translated. In this configuration example, the ip nat inside source
command
configures a static
translation between the inside local IP address 10.1.1.1 to the outside global
IP address 170.46.2.2.
If you look further down in the configuration, you can see an
ip nat
command under each
interface. The
ip nat inside
command identifies that interface as the inside interface. The
ip nat outside
command identifies that interface as the outside interface. When you look
back at the ip nat inside source command, you see that the command is referencing the inside
interface as the source or starting point of the translation. The command could also be used
like this—ip nat outside source—which is referencing the interface you designated as the outside
interface to be the source or starting point for the translation.
TABLE 8 . 3
Basic NAT Commands
Command Meaning
ip nat inside source static
inside_local inside_global
Statically maps a host with a private IP address to a
global Internet address
ip nat inside
Sets the interface as an inside interface
ip nat outside
Sets the interface as an outside interface