Network Address Translation (NAT) enables hosts on private networks to access resources on the Internet or other public networks. NAT is an IETF standard that enables a LAN to use one set of IP addresses for internal traffic, typically private address space as defined in RFC 1918, and another set of addresses for external traffic, typically publicly registered IP address space. NAT converts the packet headers for incoming and outgoing traffic and keeps track of each session. NAT offers the dual functions of security and address conservation, and is typically implemented in remote-access environments. The key to understanding, and ultimately troubleshooting NAT problems, is having a solid understanding of the NAT terminology. The following section describes NAT terms you should be familiar with. These include:
- The NAT Inside Interface
- Inside Local Address
- Inside Global Address
- The NAT Outside Interface
- Outside Local Address
- Outside Global Address
NOTE: NAT is a core CCNA requirement. You can find additional detailed information on NAT in the current CCNA study guide which is available online at www.howtonetwork.net.
In NAT terminology, the inside interface is the border interface of the administrative domain controlled by the organization. This does not necessarily have to the default gateway used by hosts that reside within the internal network.
The inside local address is the IP address of a host residing on the inside network. In most cases, the inside local address is an RFC 1918 address. This address is translated to the outside global address, which is typically an IP address from a publically assigned or registered pool. It is important to remember, however, that the inside local address could also be a public address.
The inside global address is the IP address of an internal host as it appears to the outside world. Once the inside IP address has been translated, it will appear as an inside global address to the Internet public or any other external network or host.
The outside interface is the boundary for the administrative domain that is not controlled by the organization. In other words, the outside interface is connected to the external network, which may be the Internet or any other external network, such as a partner network, for example. Any hosts residing beyond the outside interface fall outside the local organizations administration.
The outside local address is the IP address of an outside, or external host as it appears to inside hosts. And finally, the outside global address is an address that is legal and can be used on the Internet. Both outside local addresses and outside global addresses are typically allocated from a globally routable address or network space.
To further clarify these concepts, Figure 9-3 shows the use of the addresses in a session between two hosts. NAT is enabled on the intermediate gateway:
Fig. 9-3. Understanding NAT Inside and Outside Addresses
Configuring and Verifying NAT in Cisco IOS Software
As you already know, the configuration and verification of Network Address Translation in Cisco IOS software is a straightforward task. When configuring NAT, perform the following:
- Designate one or more interfaces as the internal (inside) interface(s) using the ip nat inside interface configuration command
- Designate an as the external (outside) interface using the ip nat outside interface configuration command
- Configure an Access Control List that will match all traffic that is to be NAT’d. This can be a standard or extended named or numbered ACL
- Optionally configure a pool of globally addresses using the ip nat pool <name> <start-ip> <end-ip> [netmask <mask> | prefix-length <length>] global configuration command. This defines a pool of inside global addresses which inside local addresses will be translated to
- Configure NAT globally using the ip nat inside source list <ACL> [interface|pool] <name> [overload] global configuration command
The following example shows how to configure basic NAT translation in Cisco IOS software:
| R1(config)#interface fastethernet 0/0 R1(config-if)#description ‘Connected To The Internal LAN’ R1(config-if)#ip address 10.5.5.1 255.255.255.248 R1(config-if)#ip nat inside R1(config-if)#exit R1(config)#interface serial 0/0 R1(config-if)#description ‘Connected To The ISP’ R1(config-if)#ip address 150.1.1.1 255.255.255.248 R1(config-if)#ip nat outside R1(config-if)#exit R1(config)#access-list 100 remark ‘Translate Internal Addresses Only’ R1(config)#access-list 100 permit ip 10.5.5.0 0.0.0.7 any R1(config)#ip nat pool INSIDE-POOL 150.1.1.3 150.1.1.6 prefix-length 24 R1(config)#ip nat inside source list 100 pool INSIDE-POOL R1(config)#exit |
Following this configuration, the show ip nat translations command can be used to verify that translations are actually taking place on the router:
| R1#show ip nat translations Pro Inside global Inside local Outside local Outside global icmp 150.1.1.4:4 10.5.5.1:4 200.1.1.1:4 200.1.1.1:4 icmp 150.1.1.3:1 10.5.5.2:1 200.1.1.1:1 200.1.1.1:1 tcp 150.1.1.5:15594 10.5.5.3:15594 200.1.1.1:23 200.1.1.1:23 |
