NAT Types
NAT Types
NAT Types
This module describes how to configure Network Address Translation (NAT) for IP address conservation
and how to configure inside and outside source addresses. This module also provides information about the
benefits of configuring NAT for IP address conservation.
NAT enables private IP internetworks that use nonregistered IP addresses to connect to the Internet. NAT
operates on a device, usually connecting two networks, and translates the private (not globally unique)
addresses in the internal network into legal addresses before packets are forwarded onto another network.
NAT can be configured to advertise to the outside world only one address for the entire network. This ability
provides additional security by effectively hiding the entire internal network behind that one address.
NAT is also used at the enterprise edge to allow internal users access to the Internet and to allow Internet
access to internal devices such as mail servers.
Access Lists
All access lists that are required for use with the configuration tasks described in this module should be
configured before beginning a configuration task. For information about how to configure an access list, see
the IP Access List EntrySequence Numbering document.
Note If you specify an access list with a NAT command, NAT will not support the permit ip any any command
that is commonly used in an access list.
NAT Requirements
Before configuring NAT in your network, you should know the interfaces on which NAT will be configured
and for what purposes. The following requirements will help you decide how to configure and use NAT:
Define the NAT inside and outside interfaces if:
Users exist off multiple interfaces.
Multiple interfaces connect to the Internet.
From Cisco IOS XE Denali 16.3 release, NAT support is introduced on Bridge Domain Interface (BDI) for
enabling NAT configuration on BDI interface.
latency of all packet flows through the NAT interface. We highly recommend that a NAT interface must
be used only for NAT-only traffic. Any non-NAT packets must be separated and these packets should
go through an interface that does not have NAT configured on it. You can use Policy-Based Routing
(PBR) for separating non-NAT traffic.
NAT Virtual Interfaces (NVIs) are not supported in the Cisco IOS XE software.
NAT is not practical if large numbers of hosts in the stub domain communicate outside of the domain.
Some applications use embedded IP addresses in such a way that translation by a NAT device is
impractical. These applications may not work transparently or at all through a NAT device.
In a NAT configuration, addresses configured for any inside mapping should not be configured for any
outside mapping.
Do not configure the interface IP address as part of the IP address NAT pool.
By default, support for the Session Initiation Protocol (SIP) is enabled on port 5060. Therefore,
NAT-enabled devices interpret all packets on this port as SIP call messages. If other applications in the
system use port 5060 to send packets, the NAT service may corrupt the packet as it attempts to interpret
the packet as a SIP call message.
NAT hides the identity of hosts, which may be an advantage or a disadvantage depending on the desired
result.
A device configured with NAT must not advertise the local networks to outside the network. However,
routing information that NAT receives from the outside can be advertised in the stub domain as usual.
If you specify an access list to use with a NAT command, NAT does not support the permit ip any any
command that is commonly used in the access list.
An access list with a port range is not supported on the Cisco ASR 1000 Series Aggregation Services
Routers.
NAT configuration is not supported on the access side of the Intelligent Services Gateway (ISG).
Using any IP address configured of a device as an address pool or in a NAT static rule is not supported.
NAT can share the physical interface address (not any other IP address) of a device only by using the
NAT interface overload configuration. A device uses the ports of its physical interface and NAT must
receive communication about the ports that it can safely use for translation. This communication happens
only when the NAT interface overload is configured.
The output of the show ip nat statistics command displays information about all IP address pools and
NAT mappings that you have configured. If your NAT configuration has a high number of IP address
pools and NAT mappings (for example 1000 to 4000), the update rate of the pool and mapping statistics
in the show ip nat statistics is very slow.
Static and dynamic NAT with generic generic routing encapsulation (generic GRE) and dynamic NAT
with Layer 2 do not work when used along with hardware-based Cisco AppNav appliances (for example,
Wide Area Application Services [WAAS]). In the context of WAAS, generic GRE is an out-of-path
deployment mechanism that helps to return packets from the WAAS Wide-Area Application Engine
(WAE) through the GRE tunnel to the same device from which they were originally redirected, after
completing optimization.
Port Address Translation (also called NAT overload) only supports protocols whose port numbers are
known; these protocols are Internet Control Message Protocol (ICMP), TCP, and UDP. Other protocols
do not work with PAT because they consume the entire address in an address pool. Configure your
access control list to only permit ICMP, TCP, and UDP protocols, so that all other protocol traffic is
prevented from entering the network.
NAT, Zone-Based Policy Firewall, and Web Cache Communication Protocol (WCCP) cannot coexist
in a network.
Uses of NAT
NAT can be used for the following scenarios:
To connect to the Internet, but not all of your hosts have globally unique IP addresses. Network Address
Translation (NAT) enables private IP internetworks that use nonregistered IP addresses to connect to
the Internet. NAT is configured on a device at the border of a stub domain (referred to as the inside
network) and a public network such as the Internet (referred to as the outside network). NAT translates
internal local addresses to globally unique IP addresses before sending packets to the outside network.
As a solution to the connectivity problem, NAT is practical only when relatively few hosts in a stub
domain communicate outside of the domain at the same time. When this is the case, only a small subset
of the IP addresses in the domain must be translated into globally unique IP addresses when outside
communication is necessary, and these addresses can be reused when they are no longer in use.
Change your internal addresses. Instead of changing the internal addresses, which can be a considerable
amount of work, you can translate them by using NAT.
For basic load-sharing of TCP traffic. You can map a single global IP address to many local IP addresses
by using the TCP Load Distribution feature.
Types of NAT
NAT operates on a routergenerally connecting only two networksand translates the private (inside local)
addresses within the internal network into public (inside global) addresses before any packets are forwarded
to another network. This functionality gives you the option to configure NAT so that it will advertise only a
single address for your entire network to the outside world. Doing this effectively hides the internal network
from the world, giving you some additional security.
The types of NAT include:
Static address translation (static NAT)Allows one-to-one mapping between local and global addresses.
Dynamic address translation (dynamic NAT)Maps unregistered IP addresses to registered IP addresses
from a pool of registered IP addresses.
OverloadingMaps multiple unregistered IP addresses to a single registered IP address (many to one)
using different ports. This method is also known as Port Address Translation (PAT). By using overloading,
thousands of users can be connected to the Internet by using only one real global IP address.
Inside local addressAn IP address that is assigned to a host on the inside network. The address is
probably not a legitimate IP address assigned by the Network Information Center (NIC) or service
provider.
Inside global addressA legitimate IP address (assigned by the NIC or service provider) that represents
one or more inside local IP addresses to the outside world.
Outside local addressThe IP address of an outside host as it appears to the inside network. Not
necessarily a legitimate address, it is allocated from the address space that is routable on the inside.
Outside global addressThe IP address assigned to a host on the outside network by the owner of the
host. The address is allocated from a globally routable address or network space.
The figure below illustrates a device that is translating a source address inside a network to a source address
outside the network.
The following process describes the inside source address translation, as shown in the figure above:
1 The user at host 10.1.1.1 opens a connection to Host B in the outside network.
2 The first packet that the device receives from host 10.1.1.1 causes the device to check its Network Address
Translation (NAT) table. Based on the NAT configuration, the following scenarios are possible:
If a static translation entry is configured, the device goes to Step 3.
If no translation entry exists, the device determines that the source address (SA) 10.1.1.1 must be
translated dynamically, selects a legal, global address from the dynamic address pool, and creates a
translation entry in the NAT table. This type of translation entry is called a simple entry.
3 The device replaces the inside local source address of host 10.1.1.1 with the global address of the translation
entry and forwards the packet.
4 Host B receives the packet and responds to host 10.1.1.1 by using the inside global IP destination address
(DA) 203.0.113.2.
5 When the device receives the packet with the inside global IP address, it performs a NAT table lookup by
using the inside global address as a key. It then translates the address to the inside local address of host
10.1.1.1 and forwards the packet to host 10.1.1.1.
Host 10.1.1.1 receives the packet and continues the conversation. The device performs Steps 2 to 5 for each
packet that it receives.
The figure below illustrates a NAT operation when an inside global address represents multiple inside local
addresses. The TCP port numbers act as differentiators.
The device performs the following process in the overloading of inside global addresses, as shown in the
figure above. Both Host B and Host C believe that they are communicating with a single host at address
203.0.113.2. Where as, they are actually communicating with different hosts; the port number is the
differentiator. In fact, many inside hosts can share the inside global IP address by using many port numbers.
1 The user at host 10.1.1.1 opens a connection to Host B.
2 The first packet that the device receives from host 10.1.1.1 causes the device to check its NAT table. Based
on your NAT configuration the following scenarios are possible:
If no translation entry exists, the device determines that IP address 10.1.1.1 must be translated, and
translates inside local address 10.1.1.1 to a legal global address.
If overloading is enabled and another translation is active, the device reuses the global address from
that translation and saves enough information that can be used to translate the global address back,
as an entry in the NAT table. This type of translation entry is called an extended entry.
3 The device replaces inside local source address 10.1.1.1 with the selected global address and forwards the
packet.
4 Host B receives the packet and responds to host 10.1.1.1 by using the inside global IP address 203.0.113.2.
5 When the device receives the packet with the inside global IP address, it performs a NAT table lookup by
using a protocol, the inside global address and port, and the outside address and port as keys; translates
the address to the inside local address 10.1.1.1 and forwards the packet to host 10.1.1.1.
Host 10.1.1.1 receives the packet and continues the conversation. The device performs Steps 2 to 5 for each
packet it receives.
The device examines every DNS reply to ensure that the IP address is not in a stub network. If it is, the device
translates the address as described below:
1 Host 10.1.1.1 opens a connection to 172.16.0.3.
2 The device sets up the translation mapping of the inside local and global addresses to each other and the
outside global and local addresses to each other.
3 The device replaces the SA with the inside global address and replaces the DA with the outside global
address.
4 Host C receives the packet and continues the conversation.
5 The device does a lookup, replaces the DA with the inside local address, and replaces the SA with the
outside local address.
6 Host 10.1.1.1 receives the packet and the conversation continues using this translation process.
2 The device receives the connection request and creates a new translation, allocating the next real host
(10.1.1.1) for the inside local IP address.
3 The device replaces the destination address with the selected real host address and forwards the packet.
4 Host 10.1.1.1 receives the packet and responds.
5 The device receives the packet and performs a NAT table lookup by using the inside local address and
port number, and the outside address and port number as keys. The device then translates the source address
to the address of the virtual host and forwards the packet.
6 The device will allocate IP address 10.1.1.2 as the inside local address for the next connection request.
RADIUS
RADIUS is a distributed client/server system that secures networks against unauthorized access. Communication
between a network access server (NAS) and a RADIUS server is based on UDP. Generally, the RADIUS
protocol is considered a connectionless service. Issues related to server availability, retransmission, and
timeouts are handled by RADIUS-enabled devices rather than the transmission protocol.
The RADIUS client is typically a NAS, and the RADIUS server is usually a daemon process running on a
UNIX or Windows NT machine. The client passes user information to designated RADIUS servers and acts
on the response that is returned. RADIUS servers receive user connection requests, authenticate the user, and
then return the configuration information necessary for the client to deliver the service to the user. A RADIUS
server can act as a proxy client to other RADIUS servers or other kinds of authentication servers.
Denial-of-Service Attacks
A denial-of-service (DoS) attack typically involves the misuse of standard protocols or connection processes
with the intent to overload and disable a target, such as a device or web server. DoS attacks can come from a
malicious user or from a computer infected with a virus or worm. An attack that comes from many different
sources at once, such as when a virus or worm has infected many computers, is known as a distributed DoS
attack. Such distributed DoS attacks can spread rapidly and involve thousands of systems.
Note You must configure different IP addresses for an interface on which NAT is configured and for inside
addresses that are configured by using the ip nat inside source static command.
SUMMARY STEPS
1. enable
2. configure terminal
3. ip nat inside source static local-ip global-ip
4. interface type number
5. ip address ip-address mask [secondary]
6. ip nat inside
7. exit
8. interface type number
9. ip address ip-address mask [secondary]
10. ip nat outside
11. end
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip nat inside source static local-ip global-ip Establishes static translation between an inside local
address and an inside global address.
Example:
Device(config)# ip nat inside source static
10.10.10.1 172.16.131.1
Step 4 interface type number Specifies an interface and enters interface configuration
mode.
Example:
Device(config)# interface ethernet 1
Step 5 ip address ip-address mask [secondary] Sets a primary IP address for an interface.
Example:
Device(config-if)# ip address 10.114.11.39
255.255.255.0
Step 6 ip nat inside Connects the interface to the inside network, which is
subject to NAT.
Example:
Device(config-if)# ip nat inside
Step 8 interface type number Specifies a different interface and enters interface
configuration mode.
Example:
Device(config)# interface gigabitethernet 0/0/0
Step 9 ip address ip-address mask [secondary] Sets a primary IP address for an interface.
Example:
Device(config-if)# ip address 172.31.232.182
255.255.255.240
Example:
Device(config-if)# ip nat outside
Note When inside global or outside local addresses belong to a directly connected subnet on a Network Address
Translation (NAT) device, the device adds IP aliases for them so that it can answer Address Resolution
Protocol (ARP) requests. However, a situation can arise where the device answers packets that are not
destined for it, possibly causing a security issue. This can happen when an incoming Internet Control
Message Protocol (ICMP) packet or an UDP packet that is destined for one of the aliased addresses does
not have a corresponding NAT translation in the NAT table, and the device itself runs a corresponding
service, for example, Network Time Protocol (NTP). Such a situation might cause minor security risks.
SUMMARY STEPS
1. enable
2. configure terminal
3. ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length}
4. access-list access-list-number permit source [source-wildcard]
5. ip nat inside source list access-list-number pool name
6. interface type number
7. ip address ip-address mask
8. ip nat inside
9. exit
10. interface type number
11. ip address ip-address mask
12. ip nat outside
13. end
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip nat pool name start-ip end-ip {netmask netmask | Defines a pool of global addresses to be allocated as
prefix-length prefix-length} needed.
Example:
Device(config)# ip nat pool net-208 172.16.233.208
172.16.233.223 prefix-length 28
Step 4 access-list access-list-number permit source Defines a standard access list permitting those
[source-wildcard] addresses that are to be translated.
Example:
Device(config)# access-list 1 permit 192.168.34.0
0.0.0.255
Step 5 ip nat inside source list access-list-number pool name Establishes dynamic source translation, specifying the
access list defined in Step 4.
Example:
Device(config)# ip nat inside source list 1 pool
net-208
Step 6 interface type number Specifies an interface and enters interface configuration
mode.
Example:
Device(config)# interface ethernet 1
Step 7 ip address ip-address mask Sets a primary IP address for the interface.
Example:
Device(config-if)# ip address 10.114.11.39
255.255.255.0
Step 8 ip nat inside Connects the interface to the inside network, which is
subject to NAT.
Example:
Device(config-if)# ip nat inside
Step 10 interface type number Specifies an interface and enters interface configuration
mode.
Example:
Device(config)# interface ethernet 0
Step 11 ip address ip-address mask Sets a primary IP address for the interface.
Example:
Device(config-if)# ip address 172.16.232.182
255.255.255.240
Example:
Device(config-if)# ip nat outside
SUMMARY STEPS
1. enable
2. configure terminal
3. ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length}
4. access-list access-list-number permit source [source-wildcard]
5. ip nat inside source list access-list-number pool name overload
6. interface type number
7. ip address ip-address mask
8. ip nat inside
9. exit
10. interface type number
11. ip address ip-address mask
12. ip nat outside
13. end
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip nat pool name start-ip end-ip {netmask netmask | Defines a pool of global addresses to be allocated as
prefix-length prefix-length} needed.
Example:
Device(config)# ip nat pool net-208
192.168.202.129 192.168.202.158 netmask
255.255.255.224
Step 4 access-list access-list-number permit source Defines a standard access list permitting those addresses
[source-wildcard] that are to be translated.
The access list must permit only those addresses that
Example: are to be translated. (Remember that there is an
Device(config)# access-list 1 permit
192.168.201.30 0.0.0.255 implicit deny all at the end of each access list.) Use
of an access list that is too permissive can lead to
unpredictable results.
Example:
Device(config)# ip nat inside source list 1 pool
net-208 overload
Step 6 interface type number Specifies an interface and enters interface configuration
mode.
Example:
Device(config)# interface ethernet 1
Step 7 ip address ip-address mask Sets a primary IP address for the interface.
Example:
Device(config-if)# ip address 192.168.201.1
255.255.255.240
Step 8 ip nat inside Connects the interface to the inside network, which is
subject to NAT.
Example:
Device(config-if)# ip nat inside
Step 10 interface type number Specifies an interface and enters interface configuration
mode.
Example:
Device(config)# interface ethernet 0
Step 11 ip address ip-address mask Sets a primary IP address for the interface.
Example:
Device(config-if)# ip address 192.168.201.29
255.255.255.240
Example:
Device(config-if)# ip nat outside
SUMMARY STEPS
1. enable
2. configure terminal
3. ip nat translation seconds
4. ip nat translation udp-timeout seconds
5. ip nat translation dns-timeout seconds
6. ip nat translation tcp-timeout seconds
7. ip nat translation finrst-timeout seconds
8. ip nat translation icmp-timeout seconds
9. ip nat translation syn-timeout seconds
10. end
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip nat translation seconds (Optional) Changes the amount of time after which NAT
translations time out.
Example: The default timeout is 24 hours, and it applies to the aging
Device(config)# ip nat translation 300
time for half-entries.
Step 4 ip nat translation udp-timeout seconds (Optional) Changes the UDP timeout value.
Example:
Device(config)# ip nat translation
udp-timeout 300
Step 5 ip nat translation dns-timeout seconds (Optional) Changes the Domain Name System (DNS) timeout
value.
Example:
Device(config)# ip nat translation
dns-timeout 45
Step 6 ip nat translation tcp-timeout seconds (Optional) Changes the TCP timeout value.
The default is 24 hours.
Example:
Device(config)# ip nat translation
tcp-timeout 2500
Step 7 ip nat translation finrst-timeout seconds (Optional) Changes the finish and reset timeout value.
finrst-timeoutThe aging time after a TCP session
Example: receives both finish-in (FIN-IN) and finish-out (FIN-OUT)
Device(config)# ip nat translation
finrst-timeout 45 requests or after the reset of a TCP session.
Step 8 ip nat translation icmp-timeout seconds (Optional) Changes the ICMP timeout value.
Example:
Device(config)# ip nat translation
icmp-timeout 45
SUMMARY STEPS
1. enable
2. configure terminal
3. ip nat inside source static local-ip global-ip
4. interface type number
5. ip address ip-address mask
6. ip nat inside
7. exit
8. interface type number
9. ip address ip-address mask
10. ip nat outside
11. end
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip nat inside source static local-ip global-ip Establishes static translation between an inside local
address and an inside global address.
Example:
Device(config)# ip nat inside source static
192.168.121.33 10.2.2.1
Step 4 interface type number Specifies an interface and enters interface configuration
mode.
Example:
Device(config)# interface ethernet 1
Step 5 ip address ip-address mask Sets a primary IP address for the interface.
Example:
Device(config-if)# ip address 10.114.11.39
255.255.255.0
Example:
Device(config-if)# ip nat inside
Step 8 interface type number Specifies an interface and enters interface configuration
mode.
Example:
Device(config)# interface ethernet 0
Step 9 ip address ip-address mask Sets a primary IP address for the interface.
Example:
Device(config-if)# ip address 172.16.232.182
255.255.255.240
Example:
Device(config-if)# ip nat outside
SUMMARY STEPS
1. enable
2. configure terminal
3. ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length}
4. access-list access-list-number permit source [source-wildcard]
5. ip nat outside source list access-list-number pool name
6. interface type number
7. ip address ip-address mask
8. ip nat inside
9. exit
10. interface type number
11. ip address ip-address mask
12. ip nat outside
13. end
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip nat pool name start-ip end-ip {netmask netmask | Defines a pool of global addresses to be allocated as
prefix-length prefix-length} needed.
Example:
Device(config)# ip nat pool net-10 10.0.1.0
10.0.1.255 prefix-length 24
Step 4 access-list access-list-number permit source Defines a standard access list permitting those addresses
[source-wildcard] that are to be translated.
The access list must permit only those addresses that
Example: are to be translated. (Remember that there is an
Device(config)# access-list 1 permit 10.114.11.0
0.0.0.255 implicit deny all at the end of each access list.) Use
of an access list that is too permissive can lead to
unpredictable results.
Step 6 interface type number Specifies an interface and enters interface configuration
mode.
Example:
Device(config)# interface ethernet 1
Step 7 ip address ip-address mask Sets a primary IP address for the interface.
Example:
Device(config-if)# ip address 10.114.11.39
255.255.255.0
Example:
Device(config-if)# ip nat inside
Step 10 interface type number Specifies an interface and enters interface configuration
mode.
Example:
Device(config)# interface ethernet 0
Step 11 ip address ip-address mask Sets a primary IP address for the interface.
Example:
Device(config-if)# ip address 172.16.232.182
255.255.255.240
Example:
Device(config-if)# ip nat outside
What to Do Next
When you have completed the required configuration, go to the Monitoring and Maintaining NAT module.
SUMMARY STEPS
1. enable
2. configure terminal
3. ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length} type rotary
4. access-list access-list-number permit source [source-wildcard]
5. ip nat inside destination-list access-list-number pool name
6. interface type number
7. ip address ip-address mask
8. ip nat inside
9. exit
10. interface type number
11. ip address ip-address mask
12. ip nat outside
13. end
DETAILED STEPS
Example:
Device# configure terminal
Example:
Device(config)# ip nat pool real-hosts
192.168.201.2 192.168.201.5 prefix-length 28 type
rotary
Step 4 access-list access-list-number permit source Defines an access list permitting the address of the
[source-wildcard] virtual host.
Example:
Device(config)# access-list 1 permit 192.168.201.30
0.0.0.255
Step 5 ip nat inside destination-list access-list-number pool name Establishes dynamic inside destination translation,
specifying the access list defined in the prior step.
Example:
Device(config)# ip nat inside destination-list 2
pool real-hosts
Step 6 interface type number Specifies an interface and enters interface configuration
mode.
Example:
Device(config)# interface ethernet 0
Step 7 ip address ip-address mask Sets a primary IP address for the interface.
Example:
Device(config-if)# ip address 192.168.201.1
255.255.255.240
Example:
Device(config-if)# ip nat inside
Step 10 interface type number Specifies a different interface and enters interface
configuration mode.
Example:
Device(config)# interface serial 0
Step 11 ip address ip-address mask Sets a primary IP address for the interface.
Example:
Device(config-if)# ip address 192.168.15.129
255.255.255.240
Example:
Device(config-if)# ip nat outside
SUMMARY STEPS
1. enable
2. configure terminal
3. ip nat inside source {list {access-list-number | access-list-name} pool pool-name [overload]| static
local-ip global-ip [route-map map-name]}
4. exit
5. show ip nat translations [verbose]
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip nat inside source {list {access-list-number | Enables route mapping with static NAT configured
access-list-name} pool pool-name [overload]| static local-ip on the NAT inside interface.
global-ip [route-map map-name]}
Example:
Device(config)# ip nat inside source static
192.168.201.6 192.168.201.21 route-map isp2
Example:
Device# show ip nat translations
SUMMARY STEPS
1. enable
2. configure terminal
3. ip nat pool name start-ip end-ip netmask netmask
4. ip nat pool name start-ip end-ip netmask netmask
5. ip nat inside source route-map name pool name [reversible]
6. ip nat inside source route-map name pool name [reversible]
7. end
DETAILED STEPS
Example:
Device(config)# configure terminal
Step 3 ip nat pool name start-ip end-ip netmask netmask Defines a pool of network addresses for NAT.
Example:
Device(config)# ip nat pool POOL-A 192.168.201.4
192.168.201.6 netmask 255.255.255.128
Step 4 ip nat pool name start-ip end-ip netmask netmask Defines a pool of network addresses for NAT.
Example:
Device(config)# ip nat pool POOL-B 192.168.201.7
192.168.201.9 netmask 255.255.255.128
Step 5 ip nat inside source route-map name pool name [reversible] Enables outside-to-inside initiated sessions to use
route maps for destination-based NAT.
Example:
Device(config)# ip nat inside source route-map MAP-A
pool POOL-A reversible
Step 6 ip nat inside source route-map name pool name [reversible] Enables outside-to-inside initiated sessions to use
route maps for destination-based NAT.
Example:
Device(config)# ip nat inside source route-map MAP-B
pool POOL-B reversible
Note When you configure the ip nat outside source static command to add static routes for outside local
addresses, there is a delay in the translation of packets and packets are dropped. Packets are dropped
because a shortcut is not created for the initial synchronization (SYN) packet when NAT is configured
for static translation. To avoid dropped packets, configure either the ip nat outside source static add-route
command or the ip route command.
SUMMARY STEPS
1. enable
2. configure terminal
3. ip nat inside source {list {access-list-number | access-list-name} pool pool-name [overload] | static
network local-ip global-ip [no-payload]}
4. ip nat inside source {list {access-list-number | access-list-name} pool pool-name [overload] | static {tcp
| udp} local-ip local-port global-ip global-port [no-payload]}
5. ip nat inside source {list {access-list-number | access-list-name} pool pool-name [overload] | static
[network] local-network-mask global-network-mask [no-payload]}
6. ip nat outside source {list {access-list-number | access-list-name} pool pool-name | static local-ip
global-ip [no-payload]}
7. ip nat outside source {list {access-list-number | access-list-name} pool pool-name | static {tcp | udp}
local-ip local-port global-ip global-port [no-payload]}
8. ip nat outside source {list {access-list-number | access-list-name} pool pool-name | static [network]
local-network-mask global-network-mask [no-payload]}
9. exit
10. show ip nat translations [verbose]
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip nat inside source {list {access-list-number | access-list-name} pool Disables the network packet translation on
pool-name [overload] | static network local-ip global-ip [no-payload]} the inside host device.
Example:
Device(config)# ip nat inside source static network 10.1.1.1
192.168.251.0/24 no-payload
Step 4 ip nat inside source {list {access-list-number | access-list-name} pool Disables port packet translation on the
pool-name [overload] | static {tcp | udp} local-ip local-port global-ip inside host device.
global-port [no-payload]}
Example:
Device(config)# ip nat inside source static tcp 10.1.1.1 2000
192.168.1.1 2000 no-payload
Step 5 ip nat inside source {list {access-list-number | access-list-name} pool Disables packet translation on the inside
pool-name [overload] | static [network] local-network-mask host device.
global-network-mask [no-payload]}
Example:
Device(config)# ip nat inside source static 10.1.1.1
192.168.1.1 no-payload
Step 6 ip nat outside source {list {access-list-number | access-list-name} pool Disables packet translation on the outside
pool-name | static local-ip global-ip [no-payload]} host device.
Example:
Device(config)# ip nat outside source static 10.1.1.1
192.168.1.1 no-payload
Step 7 ip nat outside source {list {access-list-number | access-list-name} pool Disables port packet translation on the
pool-name | static {tcp | udp} local-ip local-port global-ip global-port outside host device.
[no-payload]}
Example:
Device(config)# ip nat outside source static tcp 10.1.1.1
20000 192.168.1.1 20000 no-payload
Step 8 ip nat outside source {list {access-list-number | access-list-name} pool Disables network packet translation on the
pool-name | static [network] local-network-mask global-network-mask outside host device.
[no-payload]}
Example:
Device(config)# ip nat outside source static network 10.1.1.1
192.168.251.0/24 no-payload
Example:
Device# show ip nat translations
Note You can use this feature to configure gaming devices with an IP address that is different from that
of the PC. To avoid unwanted traffic or DoS attacks, use access lists.
For traffic going from the PC to the outside, it is better to use a route map so that extended entries
are created.
SUMMARY STEPS
1. enable
2. configure terminal
3. ip nat inside source static local-ip interface type number
4. ip nat inside source static tcp local-ip local-port interface global-port
5. exit
6. show ip nat translations [verbose]
DETAILED STEPS
Example:
Device# configure terminal
Step 3 ip nat inside source static local-ip interface type number Enables static NAT on the interface.
Example:
Device(config)# ip nat inside source static 10.1.1.1
interface Ethernet 1/1
Step 4 ip nat inside source static tcp local-ip local-port interface (Optional) Enables the use of telnet to the device
global-port from the outside.
Example:
Device(config)# ip nat inside source static tcp
10.1.1.1 23 interface 23
Example:
Device# show ip nat translations
SUMMARY STEPS
1. enable
2. configure terminal
3. interface type number
4. ip nat inside
5. exit
6. ip nat allow-static-host
7. ip nat pool name start-ip end-ip netmask netmask accounting list-name
8. ip nat inside source list access-list-number pool name
9. access-list access-list-number deny ip source
10. end
11. show ip nat translations verbose
DETAILED STEPS
Example:
Device# configure terminal
Step 3 interface type number Configures an interface and enters interface configuration
mode.
Example:
Device(config)# interface ethernet 1
Example:
Device(config-if)# ip nat inside
Step 7 ip nat pool name start-ip end-ip netmask netmask Specifies an existing RADIUS profile name to be used for
accounting list-name authentication of the static IP host.
Example:
Device(config)# ip nat pool pool1 172.16.0.0
172.16.0.254 netmask 255.255.255.0
accounting WLAN-ACCT
Step 8 ip nat inside source list access-list-number pool Specifies the access list and pool to be used for static IP
name support.
The specified access list must permit all traffic.
Example:
Device(config)# ip nat inside source list 1
pool net-208
Step 9 access-list access-list-number deny ip source Removes the traffic of the device from NAT.
The source argument is the IP address of the device that
Example: supports the NAT Static IP Support feature.
Device(config)# access-list 1 deny ip
192.168.196.51
Step 11 show ip nat translations verbose (Optional) Displays active NAT translations and additional
information for each translation table entry, including how
Example: long ago the entry was created and used.
Device# show ip nat translations verbose
Examples
The following is sample output from the show ip nat translations verbose command:
Device# show ip nat translations verbose
create 00:05:59, use 00:03:39, left 23:56:20, Map-Id(In): 1, flags: none wlan-flags: Secure
ARP added, Accounting Start sent Mac-Address:0010.7bc2.9ff6 Input-IDB:Ethernet1/2, use_count:
0, entry-id:7, lc_entries: 0
1. enable
2. show ip nat translations
3. configure terminal
4. ip nat translation max-entries {number | all-vrf number | host ip-address number | list listname number
| vrf name number}
5. end
6. show ip nat statistics
DETAILED STEPS
Example:
Device# configure terminal
Step 4 ip nat translation max-entries {number | Configures the maximum number of NAT entries allowed from the
all-vrf number | host ip-address number | specified source.
list listname number | vrf name number}
The maximum number of allowed NAT entries is 2147483647,
although a typical range for a NAT rate limit is 100 to 300 entries.
Example:
Device(config)# ip nat translation When you configure a NAT rate limit for all VRF instances, each
max-entries 300
VRF instance is limited to the maximum number of NAT entries
that you specify.
When you configure a NAT rate limit for a specific VRF instance,
you can specify a maximum number of NAT entries for the named
VRF instance that is greater than or less than that allowed for all
VRF instances.
Example:
Device(config)# end
Step 6 show ip nat statistics (Optional) Displays current NAT usage information, including NAT rate
limit settings.
Example: After setting a NAT rate limit, use the show ip nat statistics
Device# show ip nat statistics
command to verify the current NAT rate limit settings.
The following example shows NAT configured on the provider edge (PE) device with a static route to the
shared service for the vrf1 and vrf2 VPNs. NAT is configured as inside source static one-to-one translation.
The following example shows how only traffic local to the provider edge (PE) device running NAT is translated:
ip nat inside source list 1 interface gigabitethernet 0/0/0 vrf vrf1 overload
ip nat inside source list 1 interface gigabitethernet 0/0/0 vrf vrf2 overload
!
ip route vrf vrf1 0.0.0.0 0.0.0.0 192.168.1.1
ip route vrf vrf2 0.0.0.0 0.0.0.0 192.168.1.1
!
access-list 1 permit 10.1.1.1.0 0.0.0.255
!
ip nat inside source list 1 interface gigabitethernet 1/1/1 vrf vrf1 overload
ip nat inside source list 1 interface gigabitethernet 1/1/1 vrf vrf2 overload
!
ip route vrf vrf1 0.0.0.0 0.0.0.0 172.16.1.1 global
ip route vrf vrf2 0.0.0.0 0.0.0.0 172.16.1.1 global
access-list 1 permit 10.1.1.0 0.0.0.255
!
local IP addresses. The ip nat outside source list 1 pool net-10 command translates the addresses of hosts
from the outside overlapping network to addresses in that pool.
ip nat pool net-208 172.31.233.208 172.31.233.223 prefix-length 28
ip nat pool net-10 10.0.1.0 10.0.1.255 prefix-length 24
access-list 1 permit 10.114.11.0 0.0.0.255
ip nat inside source list 1 pool net-208
ip nat outside source list 1 pool net-10
!
interface gigabitethernet 1/1/1
ip address 10.114.11.39 255.255.255.0
ip nat inside
!
interface gigabitethernet 0/0/0
ip address 172.16.232.182 255.255.255.240
ip nat outside
!
ip nat outside source static tcp 10.1.1.1 20000 192.168.1.1 20000 no-payload
ip nat outside source static network 10.1.1.1 192.168.251.0/24 no-payload
The following example shows how to limit the access control list named vrf3 to 100 NAT entries:
ip nat translation max-entries list vrf3 100
The following example shows how to limit the host at IP address 10.0.0.1 to 300 NAT entries:
ip nat translation max-entries host 10.0.0.1 300
Where to Go Next
To configure NAT for use with application-level gateways, see the Using Application Level Gateways
with NAT module.
To verify, monitor, and maintain NAT, see the Monitoring and Maintaining NAT module.
To integrate NAT with Multiprotocol Label Switching (MPLS) VPNs, see the Integrating NAT with
MPLS VPNs module.
To configure NAT for high availability, see the Configuring NAT for High Availability module.
NAT commands: complete command syntax, Cisco IOS IP Addressing Services Command Reference
command mode command history, defaults,
usage guidelines, and examples
IP access list sequence numbering IP Access List Entry Sequence Numbering document
RADIUS attributes overview RADIUS Attributes Overview and RADIUS IETF Attributes
module
Standard/RFC Title
IETF Behave Draft NAT MIB Definitions of Managed Objects for Network Address
Translators (NAT) draft-ietf-behave-nat-mib-11
Technical Assistance
Description Link
The Cisco Support website provides extensive online http://www.cisco.com/support
resources, including documentation and tools for
troubleshooting and resolving technical issues with
Cisco products and technologies.
To receive security and technical information about
your products, you can subscribe to various services,
such as the Product Alert Tool (accessed from Field
Notices), the Cisco Technical Services Newsletter,
and Really Simple Syndication (RSS) Feeds.
Access to most tools on the Cisco Support website
requires a Cisco.com user ID and password.
NAT Duplicate Inside Global Cisco IOS XE Release The Cisco IOS XE software supports the NAT
Address 2.1 Duplicate Inside Global Addresses feature.
NAT Host Number Preservation Cisco IOS XE Release For ease of network management, some sites
2.1 prefer to translate prefixes rather than addresses.
These sites want the translated address to have
the same host number as the original address.
The two prefixes must be of the same length.
The NAT Host Number Preservation feature
can be enabled by configuring dynamic
translation with the address pool of the type,
match-host.
NAT Route Maps Outside-to- Cisco IOS XE Release The NAT Route Maps Outside-to- Inside
Inside Support 2.2 Support feature enables the deployment of a
NAT route map configuration that will allow IP
sessions to be initiated from the outside to the
inside.
NAT Static IP Support Cisco IOS XE Release The NAT Static IP Support feature provides
2.1 support for users with static IP addresses,
enabling those users to establish an IP session
in a public wireless LAN environment.
NAT Timers Cisco IOS XE Release The NAT Timers feature allows you to change
2.1 the amount of time after which NAT translations
time out.
NAT Translation of External IP Cisco IOS XE Release You can use the NAT Translation of External
Addresses Only 2.1 IP Address Only feature to configure NAT to
ignore all embedded IP addresses for any
application and traffic type.
Rate Limiting NAT Translation Cisco IOS XE Release The Rate Limiting NAT Translation feature
2.1 provides the ability to limit the maximum
number of concurrent Network Address
Translation (NAT) operations on a router. In
addition to giving users more control over how
NAT addresses are used, the Rate Limiting NAT
Translation feature can be used to limit the
effects of viruses, worms, and denial-of-service
attacks.
NAT support on BDI interface Cisco IOS XE Denali The NAT support on BDI interface feature
16.3.1 enables you to configure NAT on Bridge
Domain Interface (BDI).
No commands were introduced or modified for
this feature.
Multi-Tenant support for NAT Cisco IOS XE Denali With Multi-Tenant support for NAT feature,
16.3.1 the configuration changes of a VRF instance
does not interrupt the traffic flow of other VRFs
in the network.
This feature uses no new or modified
commands.
Bypass NAT functionality Cisco IOS XE Denali The Bypass NAT functionality feature enables
16.3.2 you to permit an ACL with deny statements
using a bypass pool. The Bypass NAT
functionality feature reduces the TCAM size by
resolving the deny jump issue.
This feature uses no new or modified
commands.