NAT
NAT
Network Address Translation (NAT) is a way to map multiple private IP addresses inside a local network to a public IP address before transferring the information onto the internet.
- Static NAT
- Permanent one-to-one mapping between a public and private IP address
- Usually used for servers
- Dynamic NAT
- Uses a pool of available public IP addresses which are given out as-needed, first-come-first-served
- Requests are dropped once the pool runs out
- PAT
- Port Address Translation, also called Dynamic NAT with Overload, is a type of dynamic NAT that bands several local IP addresses to a singular public one using Layer 4 ports
- It can use one or more public IP addresses
- The first public IP address is assigned like normal in Dynamic NAT
- The last public IP address is translated using port numbers
Configuring NAT
- Configure NAT translate from one interface to another
Config# int (external interface)Config-if# ip nat outside
Config# int (internal interface)Config-if# ip nat inside
- You can have multiple inside and outside interfaces
- Static NAT configuration
Config# ip nat inside source (static/dynamic) (internal IP) (outbound, external IP)
- Dynamic NAT configuration
- Configure the pool of global addresses
Config# ip nat pool (pool name) (IP range start) (IP range end) netmask (subnet mask)
- Create an access list which references the internal IP addresses we want to translate
Config# access-list (list number, e.g. 1) permit (internal IP network address) (wildcard mask)
- Associate the ACL with the NAT pool to complete the config
Config# ip nat inside source list (list number) pool (pool name) (OPT:overload)overloadenables PAT
- Configure the pool of global addresses
- PAT with DHCP
- Set the outside interface to DHCP
- Clearing NAT tables
# clear ip nat translation- Can also target specific inside and outside configs
# clear ip nat translation *- Clears all dynamic NAT translations
- Verification
# sho ip nat translation- The NAT table will expire entries fairly quickly
- KEY DEFINITION
- INSIDE = internal device address
- OUTSIDE = external device address
- LOCAL = local perspective (local router, local network admin, etc.)
- GLOBAL = external perspective (internet, external network admin, etc.)
- Inside local address
- The IP address actually configured on the inside host's OS
- Inside global address
- The NAT'd address of the inside host as it will be reached by the outside network
- Outside local address
- The IP address of the outside host as it appears to the inside network
- Outside global address
- The IP address of the outside host assigned by the host's owner
# sho ip nat statistics# debug ip nat- Translated addresses appear as
(address 1)->(address 2), and the inside local/global addresses will flip depending the direction of the packets- Outbound
- Translated source will be listed first as
s=(inside local)->(inside global)
- Translated source will be listed first as
- Return Traffic
- Translated destination will appear as
d=(inside global)->(inside local)
- Translated destination will appear as
- Outbound

- Source: Cisco Learning Network
- The router is translating outbound traffic to the external host at 170.1.1.1 from the inside local address of 10.1.1.1 to the inside global address of 200.1.1.2
- The router is translating inbound traffic from the external host at 170.1.1.1 from the inside global address of 200.1.1.2 to the inside local address of 10.1.1.1
- Translated addresses appear as