Use of a NAT device provides RFC 1631-style network address translation on the router platform. The goal of NAT is to provide functionality as if the private network had globally unique addresses and the NAT device was not present. RFC 1631 represents a subset of Cisco IOS NAT functionality.
Cisco IOS NAT supports "bi-directional translation" through the simultaneous use of "inside source" and "outside source" translations.
(1-->511, 512-->1023, 1024-->4999, 5000-->65535)
This prevents end stations from seeing connection requests with source
ports apparently corresponding to the Telnet, HTTP, or FTP daemon, for
example. As a result, Cisco IOS PAT supports about 4000 local addresses
that can be mapped to the same global address.
This feature was designed to provide protocol translation load distribution. It is not designed nor intended to be used as a substitute technology for Cisco's LocalDirector product. Destination address rotary translation should not be used to provide web service load balancing because, like vanilla DNS, it knows nothing about service availability. As a result, if a web server were to become offline, the destination address rotary translation feature would continue to send requests to the downed server.
Traffic Types Supported
Refer to the following table for
traffic types supported by Cisco IOS NAT:
Traffic Types/Applications Supported | Traffic Types/Applications not Supported |
---|---|
Any TCP/UDP traffic that does not carry source and/or destination IP addresses in the application data stream | IP Multicast |
HTTP | Routing table updates |
TFTP | DNS zone transfers |
telnet | BOOTP |
archie | talk, ntalk |
finger | SNMP |
NTP | NetShow |
NFS | |
rlogin, rsh, rcp | |
Although the following traffic types carry IP addresses in the application data stream, they are supported by Cisco IOS NAT: | |
ICMP |
|
FTP (including PORT
& PASV commands) |
|
NetBIOS over TCP/IP (datagram
and name services only, session service support coming soon) |
|
Progressive Networks’ RealAudio |
|
White Pines’ CuSeeMe |
|
Xing Technologies’ StreamWorks |
|
DNS "A" and "PTR" queries |
|
H.323 [12.0(1)/12.0(1)T and later] |
|
NetMeeting [12.0(1)/12.0(1)T and
later] |
|
VDOLive [11.3(4)/11.3(4)T and later] |
|
Vxtreme [11.3(4)/11.3(4)T and later] |
ip nat { inside | outside }Interfaces need to be marked whether they are on the inside or the outside. Only packets arriving on a marked interface will be subject to translation.
ip nat pool <name> <start-ip> <end-ip> { netmask <netmask> | prefix-length <prefix-length> } [ type { rotary } ]
ip nat inside source { list <acl> pool <name> [overload] | static <local-ip><global-ip> }
The second form of the command sets up a single static translation.
ip nat inside destination { list <acl> pool <name> | static <global-ip> <local-ip> }
ip nat outside source { list <acl> pool <name> | static <global-ip> <local-ip> }
The second form (static) of the command sets up a single static translation.
ip nat translation timeout <seconds>Dynamic translations time out after a period of non-use. When port translation is not configured, translation entries time out after 24 hours. This time can be adjusted with the above command or the following 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 using it. Non-DNS UDP translations time out after 5 minutes; DNS times out in 1 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 1 minute.
show ip nat translations [ verbose ]
show ip nat statistics
clear ip nat translation <global-ip>
Clears a simple translation.
clear ip nat translation <global-ip> <local-ip> <proto>
<global-port> <local-port>
Clears a particular dynamic translation.
debug ip nat [ <list> ] [ detailed ]
ip nat pool net-20 171.69.233.208 171.69.233.223 netmask <netmask> 255.255.255.240 ip nat inside source list 1 pool net-20 ! interface Ethernet0 ip address 171.69.232.182 255.255.255.240 ip nat outside ! interface Ethernet1 ip address 192.168.1.94 255.255.255.0 ip nat inside ! access-list 1 permit 192.168.1.0 0.0.0.255 access-list 1 permit 192.168.2.0 0.0.0.255The next sample configuration translates between inside hosts addressed from the 9.114.11.0 net to the globally unique 171.69.233.208/28 network. Packets from outside hosts addressed from 9.114.11.0 net (the "true" 9.114.11.0 net) are translated to appear to be from net 10.0.1.0/24.
ip nat pool net-20 171.69.233.208 171.69.233.223 netmask <netmask> 255.255.255.240 ip nat pool net-10 10.0.1.0 10.0.1.255 netmask <netmask> 255.255.255.0 ip nat inside source list 1 pool net-20 ip nat outside source list 1 pool net-10 ! interface Ethernet0 ip address 171.69.232.182 255.255.255.240 ip nat outside ! interface Ethernet1 ip address 9.114.11.39 255.255.255.0 ip nat inside ! access-list 1 permit 9.114.11.0 0.0.0.255
ip nat pool <name> { netmask <mask> | prefix-length <length> } [ type { rotary } ]
This command will put the user into IP NAT Pool configuration mode, where a sequence of address ranges can be configured. There is only one command in this mode:
address <start> <end>
Example:
Router(config)#ip nat pool fred prefix-length 24 Router(config-ipnat-pool)#address 171.69.233.225 171.69.233.226 Router(config-ipnat-pool)#address 171.69.233.228 171.69.233.238This configuration creates a pool containing addresses 171.69.233.225-226 and 171.69.233.228-238 (171.69.233.227 has been omitted).
ip nat inside source list <number> interface <interface> overload
If there is no address on the interface, or it the interface is not up, no translation will occur.
Example:
ip nat inside source list 1 interface Serial0 overload
ip nat inside source static { tcp | udp } <localaddr> <localport> <globaladdr> <globalport>
Example:
ip nat inside source static tcp 192.168.10.1 25 171.69.232.209 25
In this example, outside-initiated connections to the SMTP port (25) will be sent to the inside host 192.168.10.1.
ip nat inside source route-map <name> pool <name>
Example:
ip nat pool provider1-space 171.69.232.1 171.69.232.254 prefix-length 24 ip nat pool provider2-space 131.108.43.1 131.108.43.254 prefix-length 24 ip nat inside source route-map provider1-map pool provider1-space ip nat inside source route-map provider2-map pool provider2-space ! interface Serial0/0 ip nat outside ! interface Serial0/1 ip nat outside ! interface Fddi1/0 ip nat inside ! route-map provider1-map permit 10 match ip address 1 match interface Serial0/0 ! route-map provider2-map permit 10 match ip address 1 match interface Serial0/1
ip nat inside source static <localaddr> <globaladdr> extendable
Some customers want to use more than one service provider and translate into each provider's address space. You can use route-maps to base the selection of global address pool on output interface as well as an access-list match. Following is an example:
ip nat pool provider1-space ... ip nat pool provider2-space ... ip nat inside source route-map provider1-map pool provider1-space ip nat inside source route-map provider2-map pool provider2-space ! route-map provider1-map permit 10 match ip address 1 match interface Serial0/0 ! route-map provider2-map permit 10 match ip address 1 match interface Serial0/1 . . .
Once that is working, they might also want to define static mappings for a particular host using each provider's address space. The software does not allow two static translations with the same local address, though, because it is ambiguous from the inside. The router will accept these static translations and resolve the ambiguity by creating full translations (all addresses and ports) if the static translations are marked as "extendable". For a new outside-to-inside flow, the appropriate static entry will act as a template for a full translation. For a new inside-to-outside flow, the dynamic route-map rules will be used to create a full translation.
This automatic aliasing also occurs for inside global or outside local addresses in static entries. It can be disabled for static entries can be disabled by using the "no-alias" keyword:.
ip nat inside source static <local-ip-address> <global-ip-address> no-alias
ip nat pool fred <start> <end> prefix-length <len> type match-host
ip nat translation ?
syn-timeout Specify timeout for NAT TCP flows after a SYN and no further data
ip nat translation max-entries <n>
Refer to the "Configure Network Address Translation (NAT)" section in the Configuring IP Addressing documentation.
Copyright © 1992--1999 Cisco Systems Inc. Important Notices.