Guest

IP Addressing Services

Cisco Network Address Translation (NAT) Frequently Asked Questions

Document ID: 26704



Questions

Introduction
What is NAT?
What are the main differences between the Cisco IOS Software and Cisco® PIX® Security Appliance implementations of NAT?
On which Cisco routing hardware is Cisco IOS NAT available? How can the hardware be ordered?
Does NAT occur before or after routing?
How is routing awareness learned for IP addresses that are created using NAT?
How many concurrent NAT sessions are supported in Cisco IOS NAT?
What kind of routing performance can be expected when using Cisco IOS NAT?
Can Cisco IOS NAT be applied to subinterfaces?
Can Cisco IOS NAT be used with Hot Standby Router Protocol (HSRP) to provide redundant links to an ISP?
Does Cisco IOS NAT support inbound translations on a serial trunk running Frame Relay? Does it support outbound translations on the Ethernet side?
Can a single NAT-enabled router allow some users to use NAT and other users on the same Ethernet interface to continue with their own IP addresses?
What is PAT, or overloading?
When configuring for PAT (overloading), what is the maximum number of translations that can be made per inside global IP address?
How does PAT work?
What are NAT IP pools?
What is the maximum number of configurable NAT IP pools (ip nat pool "name")?
How does NAT support multiple pools using route maps?
What is IP address "overlapping" within the context of NAT?
What are static NAT translations?
What are dynamic NAT translations?
Is it possible to build a configuration with both static and dynamic NAT translations?
How do I change the dynamic NAT configuration?
Can routing loops be avoided when using dynamic NAT?
Can IP sessions be translated based on the destination network a session is trying to reach?
Why does a subnet mask need to be specified when configuring a NAT address pool?
Can IP addresses be allocated from the NAT router’s outside interface subnet to a dynamic NAT pool?
Will a NAT router properly handle ICMP redirects?
How does NAT handle ICMP fragments?
Does Cisco NAT support all application traffic?
Why does Cisco IOS NAT not support Simple Network Management Protocol (SNMP) traffic?
Does Cisco IOS NAT support Domain Name System (DNS) queries?
How does multicast NAT work on Cisco routers?
What is “NAT on a stick”?
Why does active FTP work with static and extended port forwarding, but not with PAT?
Does NAT support the use of non-standard FTP port numbers?
What is Service Provider PAT Port Allocation Enhancement for RTP and RTCP?
What is Session Initiation Protocol (SIP)?
What is Hosted NAT Traversal support for Session Border Controller?
Does Cisco IOS NAT support ACLs that permit any or all packets?
Does Cisco IOS NAT support ACLs with a “log” keyword?
Can PAT and NAT work at the same time on a router?
What does the term longest chain refer in the show ip nat statistics output?
Is it possible to apply NAT on a switch virtual interface (SVI) for Cisco® Integrated Services Routers?
What is Bi-directional NAT?
How do you clear the NAT translation table in order to release the addresses that are not used, when you run out of space in the pool?
NetPro Discussion Forums - Featured Conversations
Related Information

Introduction

This document provides answers to some of the more frequently asked questions about Cisco IOS® Network Address Translation (NAT).

Refer to Cisco Technical Tips Conventions for more information on document conventions.

Q. What is NAT?

A. Network Address Translation (NAT) is designed for IP address simplification and conservation. It enables private IP networks that use unregistered IP addresses to connect to the Internet. NAT operates on a router, usually connecting two networks together, and translates the private (not globally unique) addresses in the internal network into legal addresses, before packets are forwarded to another network. As part of this capability, NAT can be configured to advertise only one address for the entire network to the outside world. This provides additional security by effectively hiding the entire internal network behind that address. NAT offers the dual functions of security and address conservation, and is typically implemented in remote-access environments.

Q. What are the main differences between the Cisco IOS Software and Cisco® PIX® Security Appliance implementations of NAT?

A. Cisco IOS Software-based NAT is not fundamentally different from the NAT function in the Cisco PIX Security Appliance. The main differences involve the different traffic types supported in the implementations. Refer to Cisco PIX 500 Series Security Appliances and NAT Configuration Examples for more information on the configuration of NAT on Cisco PIX devices (includes the traffic types supported).

Q. On which Cisco routing hardware is Cisco IOS NAT available? How can the hardware be ordered?

A. The Cisco Feature Navigator tool allows customers to identify which release and hardware any Cisco IOS Software feature is available on. In order to use this tool, refer to Cisco Feature Navigator.

Originally introduced in Cisco IOS Software Release 11.2, NAT was only available in the "Plus" images. With introduction of Cisco IOS Software Release 11.3, Port Address Translation (PAT) became available in all IP images, while full NAT (1-1 and PAT) was still available only in "Plus" images. With Cisco IOS Software Release 12.0, all IP images provide full NAT capability.

This table shows how the Feature Navigator can be used to find all the hardware and feature sets that support the NAT capability in Cisco IOS Software Release 12.4(11)T:

Feature Navigator Snapshot

Your Selections
Features NAT (Network Address Translation)
Major Release Cisco IOS Software Release 12.4T
Release Cisco IOS Software Release 12.4(11)T
Platform All platforms
Feature Set Advanced Security
New Search  

Note: These next releases might not be supported by all platforms and feature sets.

Search Results

Cisco IOS Quick Pick Latest Releases

Note: You must be a registered user to use the links in this table.

GD Release 12.3(22), 12.3(8)JEA1, 12.2(40), 12.1(27b), 12.0(28d)
LD Release 12.4(13), 12.4(4)T3, 12.3(17b), 12.2(21), 12.1(27b)E1, 12.1(12a), 12.1(5)T15, 12.0(32)S6, 12.0(7a), 12.0(2a)T1
ED Release 12.4(11)XJ, 12.4(11)T1, 12.4(9)XG1, 12.4(6)XT, 12.4(6)XP, 12.4(6)XE2, 12.4(4)XD5, 12.4(4)XC6, 12.4(2)XB5, 12.4(2)XA2, 12.3(14)YX4, 12.3(14)YU1, 12.3(14)YT1, 12.3(14)YQ8, 12.3(14)T7, 12.3(11)YZ1, 12.3(11)YS1, 12.3(11)YK2, 12.3(11)YJ, 12.3(11)YF4, 12.3(11)XL1, 12.3(11)JX1, 12.3(11)JA1, 12.3(8)ZA, 12.3(8)YI3, 12.3(8)YH, 12.3(8)YG5, 12.3(8)YD1, 12.3(8)YA1, 12.3(8)XY7, 12.3(8)XX1, 12.3(8)XW3, 12.3(8)XU4, 12.3(7)XS2, 12.3(7)XR6, 12.3(7)XJ2, 12.3(7)XI9, 12.3(5a)B5, 12.3(4)XQ1, 12.3(4)XK4, 12.3(4)XG5, 12.3(4)XD4, 12.3(4)TPC11a, 12.3(2)XF, 12.3(2)XE4, 12.3(2)XC4, 12.3(2)XB3, 12.3(2)XA5, 12.3(2)JL, 12.3(2)JK2, 12.3(1a)BW, 12.2(35)SE2, 12.2(33)SRA3, 12.2(31)SGA1, 12.2(31)SG1, 12.2(31)SB3, 12.2(30)S1, 12.2(29a)SV, 12.2(27)SBC5, 12.2(25)SEG1, 12.2(25)SEF2, 12.2(25)SEE3, 12.2(25)SED1, 12.2(25)SEC2, 12.2(25)SEB4, 12.2(25)SEA, 12.2(25)FZ, 12.2(25)FX, 12.2(25)EZ1, 12.2(25)EY4, 12.2(25)EX1, 12.2(25)EWA7, 12.2(25)EW, 12.2(20)EU2, 12.2(18)ZU2, 12.2(18)SXF8, 12.2(18)SXE6a, 12.2(18)SXD7b, 12.2(17d)SXB9, 12.2(17b)SXA2, 12.2(17a)SX4, 12.2(16)BX3, 12.2(15)ZL1, 12.2(15)ZJ5, 12.2(15)XR2, 12.2(15)T9, 12.2(15)JK5, 12.2(15)JA, 12.2(14)ZA7, 12.2(14)SZ6, 12.2(14)SY5, 12.2(14)SU2, 12.2(13)ZP4, 12.2(13)ZH8, 12.2(13)ZG, 12.2(13)ZF2, 12.2(13)ZE, 12.2(13)ZD4, 12.2(13)ZC, 12.2(11)YZ2, , 12.2(11)YV1, 12.2(11)YU, 12.2(11)YT2, 12.2(11)YQ, 12.2(8)ZB8, 12.2(8)YN1, 12.2(8)YM, 12.2(8)TPC10a, 12.2(4)XF1, 12.2(2)YK1, 12.2(1)XS2, 12.1(26)EB1, 12.1(26)E8, 12.1(22)EA9, 12.1(22)AY1, 12.1(20)EW3, 12.1(20)EU1, 12.1(20)EO, 12.1(14)AZ, 12.1(14)AX4, 12.1(11b)EX1, 12.1(11)YJ4, 12.1(5)T9, 12.0(32)SY2, 12.0(32)S5, 12.0(21)ST7, 12.0(7)T2, 12.0(5)XQ1

Note: You must be a registered user to use the links in this table.

Platform Image Name DRAM Flash
1701 c1700-advsecurityk9-mz.12.4-11.T.bin 96 32
1711 c1700-advsecurityk9-mz.12.4-11.T.bin 96 32
1712 c1700-advsecurityk9-mz.12.4-11.T.bin 96 32
1721 c1700-advsecurityk9-mz.12.4-11.T.bin 96 32
1751 c1700-advsecurityk9-mz.12.4-11.T.bin 96 32
1751-V c1700-advsecurityk9-mz.12.4-11.T.bin 96 32
1760 c1700-advsecurityk9-mz.12.4-11.T.bin 96 32
1841 c1841-advsecurityk9-mz.12.4-11.T.bin 192 64
2610XM-2611XM c2600-advsecurityk9-mz.12.4-11.T.bin 128 32
2620XM-2621XM c2600-advsecurityk9-mz.12.4-11.T.bin 128 32
2650XM-2651XM c2600-advsecurityk9-mz.12.4-11.T.bin 128 32
2691 c2691-advsecurityk9-mz.12.4-11.T.bin 256 64
2801 c2801-advsecurityk9-mz.12.4-11.T.bin 192 64
2811 c2800nm-advsecurityk9-mz.12.4-11.T.bin 256 64
2821 c2800nm-advsecurityk9-mz.12.4-11.T.bin 256 64
2851 c2800nm-advsecurityk9-mz.12.4-11.T.bin 256 64
3725 c3725-advsecurityk9-mz.12.4-11.T.bin 256 64
3745 c3745-advsecurityk9-mz.12.4-11.T.bin 256 32
3825 c3825-advsecurityk9-mz.12.4-11.T.bin 256 64
3845 c3845-advsecurityk9-mz.12.4-11.T.bin 256 64
7200 c7200-advsecurityk9-mz.12.4-11.T.bin 256 48
7200-NPE-G2 c7200p-advsecurityk9-mz.12.4-11.T.bin 256 48
7301 c7301-advsecurityk9-mz.12.4-11.T.bin 256 64
851 c850-advsecurityk9-mz.12.4-11.T.bin 64 20
857 c850-advsecurityk9-mz.12.4-11.T.bin 64 20
871 c870-advsecurityk9-mz.12.4-11.T.bin 128 24
876 c870-advsecurityk9-mz.12.4-11.T.bin 128 24
877 c870-advsecurityk9-mz.12.4-11.T.bin 128 24
878 c870-advsecurityk9-mz.12.4-11.T.bin 128 24

Q. Does NAT occur before or after routing?

A. The order in which the transactions are processed using NAT is based on whether a packet is going from the inside network to the outside network, or from the outside network to the inside network. Inside to outside translation occurs after routing, and outside to inside translation occurs before routing. Refer to NAT Order of Operation for more information.

Q. How is routing awareness learned for IP addresses that are created using NAT?

A. Routing for IP addresses created by NAT is learned if:

  • The inside global address pool is derived from the subnet of a next-hop router.
  • Static route entry is configured in the next-hop router and redistributed within the routing network.

Q. How many concurrent NAT sessions are supported in Cisco IOS NAT?

A. The NAT session limit is bounded by the amount of available DRAM in the router. Each NAT translation consumes about 312 bytes in DRAM. As a result, 10,000 translations (more than would generally be handled on a single router) would consume about 3 MB. Therefore, typical routing hardware has more than enough memory to support thousands of NAT translations.

Q. What kind of routing performance can be expected when using Cisco IOS NAT?

A. Cisco IOS NAT supports Cisco Express Forwarding switching, fast switching, and process switching. Performance depends on several factors:

  • The type of application and its type of traffic
  • Whether IP addresses are embedded
  • Exchange and inspection of multiple messages
  • Source port required
  • The number of translations
  • Other applications running at the time
  • The type of hardware and processor

For most applications, degradation of performance due to NAT should be negligible.

Q. Can Cisco IOS NAT be applied to subinterfaces?

A. Yes. Source and/or destination NAT translations can be applied to any interface or subinterfaces having an IP address (including dialer interfaces).

Q. Can Cisco IOS NAT be used with Hot Standby Router Protocol (HSRP) to provide redundant links to an ISP?

A. No. In this scenario, the standby router would not have the translation table of the active router. When the cutover occurs, connections will time out and fail.

Q. Does Cisco IOS NAT support inbound translations on a serial trunk running Frame Relay? Does it support outbound translations on the Ethernet side?

A. Yes.

Q. Can a single NAT-enabled router allow some users to use NAT and other users on the same Ethernet interface to continue with their own IP addresses?

A. Yes. This can be accomplished through the use of an access list that describes the set of hosts or networks that require NAT. All sessions on the same host will either be translated or will pass through the router and not be translated.

Access lists, extended access lists, and route maps can be used to define "rules" by which IP devices get translated. The network address and appropriate subnet mask should always be specified. The keyword "any" should not be used in place of the network address or subnet mask.

Sample NAT Configuration Rules

NAT Translation Configuration Comment
ip nat inside source static 10.1.1.10 140.16.1.254 ! Static translation for ns.bar.com DNS server
ip nat outside source static 10.1.1.10 192.168.1.254 ! Static translation for ns.foo.com DNS server
ip nat pool iga 140.16.1.1 140.16.1.253 netmask 255.255.255.0 ! Dynamic IL->IG address xlations
ip nat pool ola 192.168.1.1 192.168.1.253 netmask 255.255.255.0 ! Dynamic OG->OL address xlations
ip nat inside source list 1 pool iga ! NAT Translation rule for inside traffic to be NAT'd, for which inside addresses and to what will they be NAT'd
ip nat outside source list 2 pool ola ! NAT Translation rule for outside traffic to be NAT'd, for which inside addresses and to what will they be NAT'd
access-list 1 permit 10.2.17.0 .255.255.255.0 ! Translate all traffic from 10.2.17 internal hosts
access-list 2 permit 10.0.0.0 255.0.0.0 ! Translate all externally originated traffic

Q. What is PAT, or overloading?

A. PAT, or overloading, is a feature of Cisco IOS NAT and can be used to translate "internal" (inside local) private addresses to one or more "outside" (inside global, usually registered) IP addresses. Unique source port numbers on each translation are used to distinguish between the conversations. With NAT overload, a translation table entry containing full address and source port information is created.

Q. When configuring for PAT (overloading), what is the maximum number of translations that can be made per inside global IP address?

A. PAT (overloading) divides the available ports per global IP address into three ranges: 0-511, 512-1023, and 1024-65535. PAT assigns a unique source port for each UDP or TCP session. It will attempt to assign the same port value of the original request, but if the original source port has already been used, it will start scanning from the beginning of the particular port range to find the first available port and will assign it to the conversation.

Q. How does PAT work?

A. PAT works with either one IP address or multiple addresses.

  • PAT with one IP address:
    1. NAT/PAT inspects traffic and matches it to a translation rule.
    2. Rule matches to a PAT configuration.
    3. If PAT knows about the traffic type, and that traffic type has "a set of specific ports or ports it negotiates" that it will use, PAT sets them aside and does not allocate them as unique identifiers.
    4. If a session with no special port requirements attempts to connect out, PAT translates the IP source address and checks availability of the originated source port (433, for example).

      Note: For Transmission Control Protocol (TCP) and User Datagram Protocol (UDP), the ranges are: 1-511, 512-1023, 1024-65535. For Internet Control Message Protocol (ICMP), the first group starts at 0.

    5. If the requested source port is available, PAT assigns the source port, and the session continues.
    6. If the requested source port is not available, NAT starts searching from the beginning of the relevant group (starting at 1 for TCP or UDP applications, and from 0 for ICMP).
    7. If a port is available it is assigned, and the session continues.
    8. If no ports are available, the packet is dropped.
  • PAT with multiple IP addresses:

    Note: The first seven conditions are the same as with a single IP address.

    1. If no ports are available in the relevant group on the first IP address, NAT flips to the next IP address in the pool and tries to allocate the original source port requested.
    2. If the requested source port is available, NAT assigns the source port and the session continues.
    3. If the requested source port is not available, NAT starts searching from the beginning of the relevant group (starting at 1 for TCP or UDP applications, and from 0 for ICMP).
    4. If a port is available, it is assigned and the session continues
    5. If no ports are available, the packet is dropped, unless another IP address is available in the pool.

Q. What are NAT IP pools?

A. NAT IP pools are a range of IP addresses that are allocated for NAT translation as needed. In order to define a pool, the configuration command is used:

ip nat pool <name> <start-ip> <end-ip> { netmask <netmask>
| prefix-length <prefix-length> } [ type { rotary } ]

Q. What is the maximum number of configurable NAT IP pools (ip nat pool "name")?

A. In practical use, the maximum number of configurable IP pools is limited by the amount of available DRAM being used in the particular router. It is highly recommended that a pool of size 255 is configured.

Q. How does NAT support multiple pools using route maps?

A. Refer to NAT Support for Multiple Pools Using Route Maps.

Q. What is IP address "overlapping" within the context of NAT?

A. IP address overlapping refers to a situation where two locations that want to interconnect are both using the same IP address scheme. This is not an unusual occurrence; it often happens when companies merge or are acquired. Without special support, the two locations will not be able to connect and establish sessions. The overlapped IP address can be a public address assigned to another company, a private address assigned to another company, or can come from the range of private addresses as defined in RFC 1918. Private IP addresses are unroutable and require NAT translations to allow connections to the outside world. The solution involves intercepting Domain Name System (DNS) name-query responses from the outside to the inside, setting up a translation for the outside address, and fixing up the DNS response before forwarding it to the inside host. A DNS server is required to be involved on both sides of the NAT device to resolve users wanting to have connection between both networks.

NAT is able to inspect and perform address translation on the contents of DNS "A" and "PTR" records, as shown in Using NAT in Overlapping Networks.

Q. What are static NAT translations?

A. Static NAT translations have one-to-one mapping between local and global addresses. Users can also configure static address translations to the port level, and use the remainder of the IP address for other translations. This typically occurs where you are performing Port Address Translation (PAT).

Q. What are dynamic NAT translations?

A. In dynamic NAT translations, the users can establish dynamic mapping between local and global addresses. This is done by describing the local addresses to be translated and the pool of addresses from which to allocate global addresses, and associating the two.

Q. Is it possible to build a configuration with both static and dynamic NAT translations?

A. Yes. However, the global addresses used in static translations are not automatically excluded with dynamic pools containing those global addresses. Dynamic pools have to be created to exclude addresses assigned by static entries. Refer to Configuring Static and Dynamic NAT Simultaneously for more information.

Q. How do I change the dynamic NAT configuration?

A. Refer to How to Change the Dynamic NAT Configuration in order to learn how to change the dynamic NAT configuration.

Q. Can routing loops be avoided when using dynamic NAT?

A. Yes. Refer to Avoiding Routing Loops When Using Dynamic NAT for more information.

Q. Can IP sessions be translated based on the destination network a session is trying to reach?

A. Yes. IP sessions can be translated by NAT based on the destination network the sessions and user are trying to reach. This capability is commonly referred to as destination based NATing.

Destination-based NATing uses route maps to determine which IP address each IP session is translated to based on routing reachability of the destination IP host. The dynamic translation command can now specify a route map to be processed instead of an access list. A route map allows the user to match any combination of access list, next-hop IP address, and output interface to determine which pool to use.

Refer to NAT Support for Multiple Pools Using Route Maps for more information on destination-based NAT’ing.

Q. Why does a subnet mask need to be specified when configuring a NAT address pool?

A. The subnet mask is used to double-check the addresses allocated from the pool. For example, the subnet broadcast address does not get allocated. The subnet mask must match the size of the subnet into which it is translated.

Q. Can IP addresses be allocated from the NAT router’s outside interface subnet to a dynamic NAT pool?

A. Yes. The NAT router will answer Address Resolution Protocol (ARP) requests for these IP addresses in the dynamic pool.

Q. Will a NAT router properly handle ICMP redirects?

A. Yes.

Q. How does NAT handle ICMP fragments?

A. Whether NAT drops or forwards an ICMP fragment depends on several factors, such as the order in which the NAT router receives the fragments, and the state of the translation table at that time. Under certain conditions, NAT translates the fragments differently, which makes it impossible for the destination device to reassemble the packet. The handling of ICMP fragments depends on the state of the NAT translation table, and the order in which the NAT router receives the ICMP fragments. Refer to How NAT Handles ICMP Fragments for more information.

Q. Does Cisco NAT support all application traffic?

A. Application traffic is transparent to Cisco IOS NAT unless:

  • There are embedded IP addresses in the data portion.
  • An application requires preset or negotiated source/destination port values.

Cisco IOS NAT performs stateful inspection and needs to have previous knowledge of all applications that embed or require specific source ports. For instance, Cisco supports the translation of embedded IP addresses in DNS "A and PTR" records, FTP, and NetMeeting v2.11 (4.3.2519) and 3.01 (4.4.3385) by setting aside the source port values they require. Cisco will not assign those source port values when using the PAT feature of Cisco IOS NAT.

With embedded IP addresses, Cisco IOS NAT needs to know the messages that contain embedded addresses and the offset within these messages. If the embedded addresses match the configured rules, they will be translated according to the configuration. An application that embeds IP addresses that Cisco IOS NAT does not know about will not work properly in a Cisco IOS NAT configuration.

There is an exception. When a tunneling protocol such as Point-to-Point Tunneling Protocol (PPTP) is used, the embedded IP addresses of the tunneled packets will not be translated, but it is assumed that users who are connecting back to their corporate networks using PPTP would be using the IP addressing scheme of the corporate network, so NAT would not need to be applied to any embedded messages. If those users then want to access the outside world through their corporate networks, they might choose to apply NAT at that point.

Embedded IP addresses are an issue regardless of the types of translation that have been configured with Cisco IOS NAT (simple or extended overload, for example). Pre-set or negotiated source port values are an issue only when the PAT feature of Cisco IOS NAT is used. PAT multiplexes multiple IP conversations over one or more IP addresses and uses the source port to uniquely identify conversations on each IP address. The PAT feature needs to set aside all specific port values that Cisco has awareness for, in case it gets a conversation for those application types (FTP or NetMeeting, for example).

Q. Why does Cisco IOS NAT not support Simple Network Management Protocol (SNMP) traffic?

A. The SNMP packet format depends on the particular MIB being used and is not self-describing. There is no single format for SNMP requests and responses that can be processed in a general fashion.

Q. Does Cisco IOS NAT support Domain Name System (DNS) queries?

A. Yes. Cisco IOS NAT will translate the addresses that appear in DNS responses to name lookups (A queries) and inverse lookups (PTR queries). Therefore, if an outside host sends a name lookup to a DNS server on the inside, and that server responds with a local address, the NAT code will translate that local address to a global address. The opposite is also true. This is how Cisco supports IP addresses overlapping: an inside host queries an outside DNS server and the response contains an address that matches the access list specified on the outside source command, so the code translates the outside global address to an outside local address.

Time-to-live (TTL) values on all DNS resource records, which receive address translations in resource records payloads, are automatically set to zero.

Cisco IOS NAT does not translate IP addresses embedded in DNS zone transfers.

Q. How does multicast NAT work on Cisco routers?

A. When you configure NAT on a Cisco IOS router, multicast sources and receivers or Protocol Independent Multicast (PIM) entities, such as rendezvous points (RPs) or RP mapping agents, work on either side of the NAT router without additional configuration commands. You must enable multicast on all the routers (inside, outside, and the NAT router itself). Refer to How Does Multicast NAT Work on Cisco Routers? for more information.

Q. What is “NAT on a stick”?

A. The term “on a stick” usually implies the use of a single physical interface of a router for a task. Just as you can use subinterfaces of the same physical interface to perform Inter-Switch Link (ISL) trunking, you can use a single physical interface on a router in order to accomplish NAT. Refer to Network Address Translation on a Stick for more information.

Q. Why does active FTP work with static and extended port forwarding, but not with PAT?

A. The reason is that when you open up the FTP connection you connect to port 21 at the remote FTP server. However, when you do a "ls", "put", get", or anything that needs to use a data port, the server opens up another connection back to the client. When you open your original FTP connection from the inside and the router pretends that you are a specific outside IP, and picks a random port number to use, the FTP server thinks it is talking to that IP address and that port number.

Therefore, when it needs to open up the data connection back, due to the "get" or "ls", it attempts to open a TCP connection from port 20 to a random port that the server decides. While on the outside IP it thinks it is talking to, the router hears traffic directed at its outside IP, but does not have any PAT mapping for that random port number that the server picked. Therefore, it does not know that this traffic is supposed to go back to the client.

The port 20 never gets established. The fix is to use "passive FTP" mode. Passive FTP has the client open both port 21 and port 20 connections from the start. The router knows about both of them rather than just port 21, and allows the server to open port 20.

Refer to Analysis of the File Transfer Protocol (FTP) leavingcisco.com for more information on FTP.

You need extended translations for port 20 and 21 with static mappings (example address).

ip nat inside source static tcp 192.168.0.4 20 66.46.64.82 20 extendable
ip nat inside source static tcp 192.168.0.4 21 66.46.64.82 21 extendable

The way that active FTP works does not allow for the use of dynamic NAT. Only static NAT can be used in this case. This is a limitation of FTP.

Q. Does NAT support the use of non-standard FTP port numbers?

A. Yes. In order to support the use of non-standard FTP port numbers, you must use the ip nat service command. This is a sample syntax:

router-6(config)#ip nat service list 10 ftp tcp port 2021

Refer to Using Non-Standard FTP Port Numbers with NAT for more information.

Q. What is Service Provider PAT Port Allocation Enhancement for RTP and RTCP?

A. The Service Provider PAT Port Allocation Enhancement for RTP and RTCP feature ensures that for SIP, H.323, and Skinny voice calls using Cisco IOS Session Border Controller, the port numbers used for RTP streams are even port numbers and the RTCP streams are the next subsequent odd port number. Cisco IOS Session Border Controller gives the administrator the control to ensure that PAT-enabled voice calls will be guaranteed to get the port number translated to a number within the range specified by the RFC, thereby conforming to RFC-1889. A call with a port number within the range will result in a PAT translation to another port number within this range. Likewise, a PAT translation for a port number outside this range will not result in a translation to a number within the given range.

Refer to Service Provider PAT Port Allocation Enhancement for RTP and RTCP for more information.

Q. What is Session Initiation Protocol (SIP)?

A. Session Initiation Protocol (SIP) is an ASCII-based, application-layer control protocol that can be used to establish, maintain, and terminate calls between two or more endpoints. SIP is an alternative protocol developed by the Internet Engineering Task Force (IETF) for multimedia conferencing over IP. The Cisco SIP implementation enables supported Cisco platforms to signal the setup of voice and multimedia calls over IP networks.

Q. What is Hosted NAT Traversal support for Session Border Controller?

A. The Cisco IOS Hosted NAT Traversal for Session Border Controller feature enables a Cisco IOS NAT SIP Application-Level Gateway (ALG) router to act as a Session Border Controller on a Cisco Multiservice IP-to-IP Gateway. This helps to ensure smooth delivery of voice over IP (VoIP) services.

Refer to Configuring Cisco IOS Hosted NAT Traversal for Session Border Controller for more information.

Q. Does Cisco IOS NAT support ACLs that permit any or all packets?

A. When you configure Cisco IOS NAT for dynamic NAT translation, an ACL is used to identify packets that can be translated. The current NAT architecture does not support the use of any or all packets in the ACLs used by NAT. If any or all packets are used, then unexpected behavior can occur.

Q. Does Cisco IOS NAT support ACLs with a “log” keyword?

A. When you configure Cisco IOS NAT for dynamic NAT translation, an ACL is used to identify packets that can be translated. The current NAT architecture does not support ACLs with a "log" keyword.

Q. Can PAT and NAT work at the same time on a router?

A. PAT is also knows as NAT Overload. PAT technology allows the NAT-enabled router to permit access to the Internet through the public IP address given by the service provider. PAT is a type of NAT, hence it can work simultaneously on a single router.

Q. What does the term longest chain refer in the show ip nat statistics output?

A. The term longest chain refers to the size of a data structure that is used internally when route-map is configured with NAT. The maximum value that can be seen in the ouput is 2048. It does not cause any problems even if it reaches maximum value.

Q. Is it possible to apply NAT on a switch virtual interface (SVI) for Cisco® Integrated Services Routers?

A. NAT translates public IP addresses to private address pools, and private addresses to public IP addresses, so SVI is typically used as a NAT inside interface.

Q. What is Bi-directional NAT?

A. With Bi-directional NAT, it is possible to initiate sessions from hosts in the public network and the private network. Private network addresses are bound to globally unique addresses, statically or dynamically as you establish connections in either direction.

Q. How do you clear the NAT translation table in order to release the addresses that are not used, when you run out of space in the pool?

A. Dynamic translations time out after a period of non-use. When port translation is not configured, translation entries times out after 24 hours. This time can be adjusted with these command variations:

ip nat translation udp-timeout [seconds]
ip nat translation dns-timeout [seconds] 
ip nat translation tcp-timeout [seconds]
ip nat translation finrst-timeout [seconds]

When port translation is configured, there is finer control over translation entry timeouts because each entry contains more context about the traffic that uses it. Non-DNS UDP translations time out after five minutes; DNS times out in one minute. TCP translations time out after 24 hours, unless a RST or FIN is seen on the stream, in which case it times out in one minute.

NetPro Discussion Forums - Featured Conversations

Networking Professionals Connection is a forum for networking professionals to share questions, suggestions, and information about networking solutions, products, and technologies. The featured links are some of the most recent conversations available in this technology.
NetPro Discussion Forums - Featured Conversations for Router and IOS Architecture
Network Infrastructure: LAN Routing and Switching
Network Infrastructure: WAN Routing and Switching

Related Information



Updated: Nov 16, 2006Document ID: 26704