Guest

Cisco IOS Software Releases 12.3 T

NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support--Stateful NAT Phase 2

Table Of Contents

NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support —Stateful NAT Phase 2

Contents

Restrictions for Using the NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support—Stateful NAT Phase 2 Feature

Information About the NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support—Stateful NAT Phase 2 Feature

Benefits of Stateful Failover Asymmetric Outside-to-Inside Support

How Stateful Failover for Asymmetric Outside-to-Inside Support Works

How Stateful Failover for ALGs Works

How to Configure NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support

Configuring SNAT with HSRP

Configuring SNAT Primary/Backup

Configuration Examples for NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support

Configuring SNAT with HSRP: Example

Configuring SNAT Primary/Backup: Example

Additional References

Related Documents

Standards

MIBs

RFCs

Technical Assistance

Command Reference

ip nat inside destination

ip nat inside source

ip nat outside source


NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support —Stateful NAT Phase 2


The NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support—Stateful NAT Phase 2 feature improves the ability to handle asymmetric paths by allowing multiple routing paths from outside-to-inside, and per-packet load balancing. This feature also provides seamless failover translated IP sessions with traffic that includes embedded IP addressing such as Voice over IP, FTP, and Domain Name System (DNS) applications.

Feature History for the NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support Feature

Release
Modification

12.3(7)T

This feature was introduced.


Finding Support Information for Platforms and Cisco IOS Software Images

Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at the login dialog box and follow the instructions that appear.

Contents

Restrictions for Using the NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support—Stateful NAT Phase 2 Feature

Information About the NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support—Stateful NAT Phase 2 Feature

How to Configure NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support

Configuration Examples for NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support

Additional References

Command Reference

Restrictions for Using the NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support—Stateful NAT Phase 2 Feature

Each router must have the same Network Address Translation (NAT) configurations.

Information About the NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support—Stateful NAT Phase 2 Feature

Before enabling the NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support—Stateful NAT Phase 2 feature, be sure you understand the following concepts:

Benefits of Stateful Failover Asymmetric Outside-to-Inside Support

How Stateful Failover for Asymmetric Outside-to-Inside Support Works

How Stateful Failover for ALGs Works

Benefits of Stateful Failover Asymmetric Outside-to-Inside Support

Stateful NAT Phase 1 required all sessions to pass through the primary NAT router that controlled the NAT translation entries unless the primary NAT router was unavailable. This requirement assured integrity of the translation information by guarding against the possibility of some packets relevant to NAT session control from traversing the backup without the primary being aware of it. Without synchronized IP sessions NAT eventually times out the IP session entries and the result is IP session states that are out of sequence.

The stateful failover asymmetric outside-to-inside enhancement provides the following benefits:

Ability to support multiple routing paths from outside-to-inside

Ability to handle per-packet load balancing of asymmetric routing from outside-to-inside

How Stateful Failover for Asymmetric Outside-to-Inside Support Works

Stateful failover for asymmetric outside-to-inside support enables two NAT routers to participate in a primary/backup design. One of the routers is elected as the primary NAT router and a second router acts as the backup router. As traffic is actively translated by the primary NAT router it updates the backup NAT router with the NAT translation state from NAT translation table entries. If the primary NAT router fails or is out of service, the backup NAT router will automatically take over. When the primary comes back into service it will take over and request an update from the backup NAT router. Return traffic is handled by either the primary or the backup NAT translator and NAT translation integrity is preserved.

When the backup NAT router receives asymmetric IP traffic and performs NAT of the packets, it will update the primary NAT router to ensure both the primary and backup NAT translation tables remain synchronized.

Figure 1 shows a typical configuration that uses the NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support—Stateful NAT Phase 2 feature.

Figure 1 Stateful NAT Asymmetric Outside-to-Inside Support

How Stateful Failover for ALGs Works

For Application Layer Gateways (ALGs) the stateful failover embedded addressing enhancement allows the secondary or backup NAT router to properly handle NAT and delivery of IP traffic. NAT inspects all IP traffic entering interfaces that have been configured with the NAT feature. The inspection consists of matching the incoming traffic against a set of translations rules and performs an address translation if a match occurs. The following are examples:

Matching a source address range

Matching a specific destination address range

Matching a list of applications known to NAT that might require a specific source port for control plane negotiation, or embedded source IP addresses within the application protocol

Some of the applications and protocols that embed source port or IP address information include:

H.323 Registration, Admission, and Status (RAS) Protocol

DNS queries

NetMeeting Internet Locator Server (ILS)

Internet Control Message Protocol (ICMP)

Simple Mail Transfer Protocol (SMTP)

Point-to-Point Tunneling Protocol (PPTP)

Network File System (NFS)

A complete list of current ALG protocols supported by Cisco IOS NAT can be found at

http://www.cisco.com/en/US/tech/tk648/tk361/tech_brief09186a00801af2b9.html

How to Configure NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support

This section contains the following procedures:

Configuring SNAT with HSRP (required)

Configuring SNAT Primary/Backup (required)

Configuring SNAT with HSRP

To configure your Hot Standby Router Protocol (HSRP) router with Stateful Network Address Translation (SNAT), use the following commands:

SUMMARY STEPS

1. enable

2. configure terminal

3. interface type number

4. standby [group-name] ip [ip-address [secondary]]

5. exit

6. ip nat stateful id ip-address redundancy group-name mapping-id map-id

7. ip nat pool name start-ip end-ip prefix-length prefix-length

8. ip nat inside source route-map name pool pool-name mapping-id map-id [overload]

9. ip nat inside destination list number pool name mapping-id map-id

10. ip nat outside source static global-ip local-ip extendable mapping-id map-id

11. end

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

enable

Example:

Router> enable

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2 

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3 

interface type number

Example:

Router(config)# interface ethernet 1/1

Enters interface configuration mode.

Step 4 

standby [group-name] ip [ip-address [secondary]]

Example:

Router(config-if)# standby SNATHSRP ip 11.1.1.1 secondary

Enables the HSRP protocol.

Step 5 

exit

Example:

Router(config-if)# exit

Returns to global configuration mode.

Step 6 

ip nat stateful id ip-address redundancy group-name mapping-id map-id

Example:

Router(config)# ip nat stateful id 1 redundancy snathsrp mapping-id 10

Specifies SNAT on routers configured for HSRP.

Step 7 

ip nat pool name start-ip end-ip prefix-length prefix-length

Example:

Router(config)# ip nat pool snatpool1 11.1.1.1 11.1.1.9 prefix-length 24


Defines a pool of IP addresses.

Step 8 

ip nat inside source static route-map name pool pool-name mapping-id map-id [overload]

Example:

Router(config)# ip nat inside source static route-map rm-101 pool snatpool2 mapping-id 10 overload

Enables stateful NAT for the HSRP translation group.

Step 9 

ip nat inside destination list number pool name mapping-id map-id

Example:

Router(config)# ip nat inside destination list 1 pool snatpool2 mapping-id 10

Enables the local SNAT router to distribute a particular set of locally created entries to a peer SNAT router.

Step 10 

ip nat outside source static global-ip local-ip extendable mapping-id map-id

Example:

Router(config)# ip nat outside source static 1.1.1.1 2.2.2.2 extendable mapping-id 10

Enables stateful NAT for the HSRP translation group.

Step 11 

end

Example:

Router(config)# end

Exits global configuration mode.

Use the end command to save your configuration and leave configuration mode.


Configuring SNAT Primary/Backup

Use the following commands to enable the NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support feature:

SUMMARY STEPS

1. enable

2. configure terminal

3. ip nat stateful id id-number {primary | back-up} ip-address peer ip-address mapping-id map-number

4. ip nat pool name start-ip end-ip prefix-length prefix-length

5. ip nat inside source static route-map name pool pool-name mapping-id map-id [overload]

6. ip nat inside destination list number pool name mapping-id map-id

7. ip nat outside source static global-ip local-ip extendable mapping-id map-id

8. end

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

enable

Example:

Router> enable

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2 

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3 

ip nat stateful id id-number {primary | backup} ip-address peer ip-address mapping-id map-id

Example:

Router(config)# ip nat stateful id 1 primary 1.1.1.1 peer 2.2.2.2 mapping-id 10

Specifies stateful NAT on the primary router.

Step 4 

ip nat pool name start-ip end-ip prefix-length prefix-length

Example:

Router(config)# parser config cache interface

Defines a pool of IP addresses.

Step 5 

ip nat inside source static route-map name pool pool-name mapping-id map-id [overload]

Example:

Router(config)# ip nat inside source static route-map rm-101 pool snatpool2 mapping-id 10 overload

Enables stateful NAT of the inside source address to distribute a particular set of locally created entries to a peer SNAT router.

Step 6 

ip nat inside destination list number pool name mapping-id map-id

Example:

Router(config)# ip nat inside destination list 1 pool snatpool2 mapping-id 10 overload

Defines the inside destination address that enables the local SNAT router to distribute locally created entries to a peer SNAT router.

Step 7 

ip nat outside source Static global-ip local-ip extendable mapping-id map-id

Example:

Router(config)# ip nat outside source static 1.1.1.1 2.2.2.2 extendable mapping-id 10

Enables stateful NAT of the outside source address to distribute a particular set of locally created entries to a peer SNAT router.

Step 8 

end

Example:

Router(config)# end

Exits global configuration mode.

Use the end command to save your configuration and leave configuration mode.

Configuration Examples for NAT Stateful Failover for Asymmetric Outside-to-Inside and ALG Support

This section contains the following examples:

Configuring SNAT with HSRP

Configuring SNAT Primary/Backup

Configuring SNAT with HSRP: Example

The following example shows how to configure SNAT with HSRP.

ip nat Stateful id 1
redundancy SNATHSRP
mapping-id 10
ip nat pool SNATPOOL1 11.1.1.1 11.1.1.9 prefix-length 24
ip nat inside source route-map rm-101 pool SNATPOOL1 mapping-id 10 overload
ip classless
ip route 11.1.1.0 255.255.255.0 Null0
no ip http server
ip pim bidir-enable

Configuring SNAT Primary/Backup: Example

The following example shows how to configure SNAT on the primary/backup router.

ip nat Stateful id 1
primary 10.88.194.17
peer 10.88.194.18
mapping-id 10
!
ip nat Stateful id 2
backup 10.88.194.17
peer 10.88.194.17
mapping-id 10

Additional References

The following sections provide references related to Stateful NAT.

Related Documents

Related Topic
Document Title

Phase I - NAT Stateful Failover

NAT Stateful Failover of Network Address Translation feature document, Release 12.2(13)T

Addressing and Services commands

Cisco IOS IP Command Reference, Volume 1 of 4: Addressing and Services, Release 12.3 T


Standards

Standards
Title

None


MIBs

MIBs
MIBs Link

None

To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator found at the following URL:

http://www.cisco.com/go/mibs


RFCs

RFCs
Title

None


Technical Assistance

Description
Link

Technical Assistance Center (TAC) home page, containing 30,000 pages of searchable technical content, including links to products, technologies, solutions, technical tips, and tools. Registered Cisco.com users can log in from this page to access even more content.

http://www.cisco.com/public/support/tac/home.shtml


Command Reference

This section documents modified commands. All other commands used with this feature are documented in the Cisco IOS Release 12.3 T command reference publications.

ip nat inside destination

ip nat inside source

ip nat outside source

ip nat inside destination

To enable Network Address Translation (NAT) of the inside destination address, use the ip nat inside destination command in global configuration mode. To remove the dynamic association to a pool, use the no form of this command.

ip nat inside destination list {access-list-number | name} pool name [mapping-id map-id]

no ip nat inside destination list {access-list-number | name} pool name [mapping-id map-id]

Syntax Description

list access-list-number

Standard IP access list number. Packets with destination addresses that pass the access list are translated using global addresses from the named pool.

list name

Name of a standard IP access list. Packets with destination addresses that pass the access list are translated using global addresses from the named pool.

pool name

Name of the pool from which global IP addresses are allocated during dynamic translation.

mapping-id map-id

(Optional) Specifies whether the local Stateful NAT Translation (SNAT) router will distribute a particular set of locally created entries to a peer SNAT router.


Defaults

No inside destination addresses are translated.

Command Modes

Global configuration

Command History

Release
Modification

11.2

This command was introduced.

12.3(7)T

The mapping-id map-id keyword and argument combination was added.


Usage Guidelines

This command has two forms: dynamic and static address translation. The form with an access list establishes dynamic translation. Packets from addresses that match the standard access list are translated using global addresses allocated from the pool named with the ip nat pool command.

Examples

The following example shows how to translate between inside hosts addressed to either the 192.168.1.0 or 192.168.2.0 network to the globally unique 171.69.233.208/28 network:

ip nat pool net-208 171.69.233.208 171.69.233.223 prefix-length 28
ip nat inside destination list 1 pool net-208
!
interface ethernet 0
 ip address 171.69.232.182 255.255.255.240
 ip nat outside
!
interface ethernet 1
 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.255
Need example for mapping-id

Related Commands

Command
Description

clear ip nat translation

Clears dynamic NAT translations from the translation table.

ip nat

Designates that traffic originating from or destined for the interface is subject to NAT.

ip nat inside source

Enables NAT of the inside source address.

ip nat outside source

Enables NAT of the outside source address.

ip nat pool

Defines a pool of IP addresses for NAT.

ip nat service

Enables a port other than the default port.

show ip nat statistics

Displays NAT statistics.

show ip nat translations

Displays active NAT translations.



ip nat inside source

To enable Network Address Translation (NAT) of the inside source address, use the ip nat inside source command in global configuration mode. To remove the static translation or remove the dynamic association to a pool, use the no form of this command.

Dynamic NAT

ip nat inside source {list {access-list-number | access-list-name} | route-map name} {interface type number | pool name} [mapping-id map-id | overload | vrf name]

no ip nat inside source {list {access-list-number | access-list-name} | route-map name} {interface type number | pool name} [mapping-id map-id | overload | vrf name]

Static NAT

ip nat inside source {static {esp local-ip interface type number | local-ip global-ip}} [extendable | mapping-id map-id | no-alias | no-payload | redundancy group-name | route-map | vrf name]

no ip nat inside source {static {esp local-ip interface type number | local-ip global-ip}} [extendable | mapping-id map-id | no-alias | no-payload | redundancy group-name | route-map | vrf name]

Port Static NAT

ip nat inside source {static {tcp | udp {local-ip local-port global-ip global-port | interface global-port}} [extendable | mapping-id map-id | no-alias | no-payload | redundancy group-name | route-map | vrf name]

no ip nat inside source {static {tcp | udp {local-ip local-port global-ip global-port | interface global-port}} [extendable | mapping-id map-id | no-alias | no-payload | redundancy group-name | route-map | vrf name]

Network Static NAT

ip nat inside source static network local-network global-network mask [extendable | no-alias | no-payload | mapping-id map-id | redundancy group-name | route-map | vrf name]

no ip nat inside source static network local-network global-network mask [extendable | no-alias | no-payload | mapping-id map-id | redundancy group-name | route-map | vrf name]

Syntax Description

list access-list-number

Number of a standard IP access list. Packets with source addresses that pass the access list are dynamically translated using global addresses from the named pool.

list access-list-name

Name of a standard IP access list. Packets with source addresses that pass the access list are dynamically translated using global addresses from the named pool.

route-map name

Specifies the named route map.

interface type

Specifies the interface type for the global address.

interface number

Specifies the interface number for the global address.

pool name

Name of the pool from which global IP addresses are allocated dynamically.

mapping-id map-id

(Optional) Specifies whether the local Stateful NAT Translation (SNAT) router will distribute a particular set of locally created entries to a peer SNAT router.

vrf name

(Optional) Associates the NAT translation rule with a particular VPN routing and forwarding (VRF) instance.

overload

(Optional) Enables the router to use one global address for many local addresses. When overloading is configured, the TCP or User Datagram Protocol (UDP) port number of each inside host distinguishes between the multiple conversations using the same local IP address.

static local-ip

Sets up a single static translation. The local-ip argument establishes the local IP address assigned to a host on the inside network. The address could be randomly chosen, allocated from RFC 1918, or obsolete.

local-port

Sets the local TCP/UDP port in a range from 1 to 65535.

static global-ip

Sets up a single static translation. The local-ip argument establishes the globally unique IP address of an inside host as it appears to the outside network.

global-port

Sets the global TCP/UDP port in a range from 1 to 65535.

extendable

(Optional) Extends the translation.

no-alias

(Optional) Prohibits an alias from being created for the global address.

no-payload

(Optional) Prohibits the tans la ti on of an embedded address or port in the payload.

redundancy group-name

(Optional) Establishes NAT redundancy.

esp local-ip

Establishes IPSec-ESP (tunnel mode) support.

tcp

Establishes the Transmission Control Protocol.

udp

Establishes the User Datagram Protocol.

network local-network

Specifies the local subnet translation.

global-network

Specifies the global subnet translation.

mask

Established the IP Network mask to be with used with subnet translations.


Defaults

No NAT translation of inside source addresses occurs.

Command Modes

Global configuration

Command History

Release
Modification

11.2

This command was introduced.

12.2(4)T

This command was modified to include the ability to use route maps with static translations, and the route-map name keyword and argument combination was added. This command was modified to include static translation with Hot Standby Routing Protocol (HSRP), and the redundancy group-name keyword and argument combination was added. This command was modified to enable the translation of the IP header address only, and the no-payload keyword was added.

12.2(13)T

The interface keyword was added for static translations. The mapping-id map-id keyword and argument combination was added for dynamic translations. The vrf name keyword and argument combination was added.

12.3(7)T

The static mapping-id map-id keyword and argument combination was added.


Usage Guidelines

This command has two forms: dynamic and static address translation. The form with an access list establishes dynamic translation. Packets from addresses that match the standard access list are translated using global addresses allocated from the pool named with the ip nat pool command.

Packets that enter the router through the inside interface and packets sourced from the router are checked against the access list for possible NAT candidates. The access list is used to specify which traffic is to be translated.

Alternatively, the syntax form with the keyword static establishes a single static translation.

Examples

The following example shows how to translate between inside hosts addressed from either the 192.168.1.0 or 192.168.2.0 network to the globally unique 171.69.233.208/28 network:

ip nat pool net-208 171.69.233.208 171.69.233.223 prefix-length 28
ip nat inside source list 1 pool net-208
!
interface ethernet 0
 ip address 171.69.232.182 255.255.255.240
 ip nat outside
!
interface ethernet 1
 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.255

The following example shows how to translate only traffic local to the providers edge device running NAT (NAT-PE):

ip nat inside source list 1 interface e 0 vrf shop overload
ip nat inside source list 1 interface e 0 vrf bank overload
!
ip route vrf shop 0.0.0.0 0.0.0.0 192.1.1.1
ip route vrf bank 0.0.0.0 0.0.0.0 192.1.1.1
!
access-list 1 permit 10.1.1.1.0 0.0.0.255
!
ip nat inside source list 1 interface e 1 vrf shop overload
ip nat inside source list 1 interface e 1 vrf bank overload
!
ip route vrf shop 0.0.0.0 0.0.0.0 172.1.1.1 global
ip route vrf bank 0.0.0.0 0.0.0.0 172.1.1.1 global
access-list 1 permit 10.1.1.0 0.0.0.255

Related Commands

Command
Description

clear ip nat translation

Clears dynamic NAT translations from the translation table.

ip nat

Designates that traffic originating from or destined for the interface is subject to NAT.

ip nat inside destination

Enables NAT of the inside destination address.

ip nat outside source

Enables NAT of the outside source address.

ip nat pool

Defines a pool of IP addresses for NAT.

ip nat service

Enables a port other than the default port.

show ip nat statistics

Displays NAT statistics.

show ip nat translations

Displays active NAT translations.


ip nat outside source

To enable Network Address Translation (NAT) of the outside source address, use the ip nat outside source command in global configuration mode. To remove the static entry or the dynamic association, use the no form of this command.

Dynamic NAT

ip nat outside source {list {access-list-number | access-list-name} | route-map name} pool pool-name [add-route | mapping-id map-id | vrf name]

no ip nat outside source {list {access-list-number | access-list-name} | route-map name} pool pool-name [add-route | mapping-id map-id | vrf name]

Static NAT

ip nat outside source static global-ip local-ip [add-route | extendable | mapping-id map-id | no-alias | no-payload | redundancy group-name | vrf name]

no ip nat outside source static global-ip local-ip [add-route | extendable | mapping-id map-id | no-alias | no-payload | redundancy group-name | vrf name]

Port Static NAT

ip nat outside source static {tcp | udp} global-ip global-port local-ip local-port [add-route | extendable | mapping-id map-id | no-alias | no-payload | redundancy group-name | vrf name]

no ip nat outside source static {tcp | udp} global-ip global-port local-ip local-port [add-route | extendable | mapping-id map-id | no-alias | no-payload | redundancy group-name | vrf name]

Network Static NAT

ip nat outside source static network global-network local-network mask [add-route | extendable | mapping-id map-id | no-alias | no-payload | redundancy | vrf name]

no ip nat outside source static network global-network local-network mask [add-route | extendable | mapping-id map-id | no-alias | no-payload | redundancy | vrf name]

Syntax Description

list access-list-number

Number of a standard IP access list. Packets with source addresses that pass the access list are translated using global addresses from the named pool.

list access-list-name

Name of a standard IP access list. Packets with source addresses that pass the access list are translated using global addresses from the named pool.

route-map name

Specifies a named route map.

pool pool-name

Name of the pool from which global IP addresses are allocated.

mapping-id map-id

(Optional) Specifies whether the local Stateful NAT Translation (SNAT) router will distribute a particular set of locally created entries to a peer SNAT router.

vrf name

(Optional) Associates the NAT translation rule with a particular VPN.

add-route

(Optional) Adds a static route for the outside local address.

static global-ip

Sets up a single static translation. This argument establishes the globally unique IP address assigned to a host on the outside network by its owner. It was allocated from globally routable network space.

local-ip

Local IP address of an outside host as it appears to the inside network. The address was allocated from address space routable on the inside (RFC 1918, Address Allocation for Private Internets).

extendable

(Optional) Extends the transmission.

no-alias

(Optional) Prohibits an alias from being created for the local address.

no-payload

(Optional) Prohibits the translation of embedded address or port in the payload.

redundancy group-name

(Optional) Enables the NAT redundancy operation.

tcp

Establishes the Transmission Control Protocol.

udp

Establishes the User Datagram Protocol.


Defaults

No translation of source addresses coming from the outside to the inside network occurs.

Command Modes

Global configuration

Command History

Release
Modification

11.2

This command was introduced.

12.2(4)T

This command was modified to include static translation with Hot Standby Routing Protocol (HSRP), and the redundancy group-name keyword and argument combination was added. This command was modified to enable the translation of the IP header address only, and the no-payload keyword was added.

12.2(13)T

The mapping-id map-id keyword and argument combination was added for dynamic translations. The vrf name keyword and argument combination was added.

12.3(7)T

The mapping-id map-id keyword and argument combination was added for static translations.


Usage Guidelines

You might have IP addresses that are not legal, officially assigned IP addresses. Perhaps you chose IP addresses that officially belong to another network. The case of an address used illegally and legally is called overlapping. You can use NAT to translate inside addresses that overlap with outside addresses. Use this command if your IP addresses in the stub network happen to be legitimate IP addresses belonging to another network, and you need to communicate with those hosts or routers.

This command has two forms: dynamic and static address translation. The form with an access list establishes dynamic translation. Packets from addresses that match the standard access list are translated using global addresses allocated from the pool named with the ip nat pool command.

Alternatively, the syntax form with the static keyword establishes a single static translation.

Examples

The following example shows how to translate between inside hosts addressed from the 9.114.11.0 network to the globally unique 171.69.233.208/28 network. Further packets from outside hosts addressed from the 9.114.11.0 network (the true 9.114.11.0 network) are translated to appear to be from the 10.0.1.0/24 network.

ip nat pool net-208 171.69.233.208 171.69.233.223 prefix-length 28 
ip nat pool net-10 10.0.1.0 10.0.1.255 prefix-length 24
ip nat inside source list 1 pool net-208
ip nat outside source list 1 pool net-10
!
interface ethernet 0
 ip address 171.69.232.182 255.255.255.240
 ip nat outside
!
interface ethernet 1
 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

The following example shows NAT configured on the Provider Edge (PE) router with a static route to the shared service for the gold and silver Virtual Private Networks (VPNs). NAT is configured as inside source static one-to-one translations.

ip nat pool outside 4.4.4.1 4.4.4.254 netmask 255.255.255.0
ip nat outside source list 1 pool mypool
access-list 1 permit 168.58.18.0 0.0.0.255
ip nat inside source static 192.168.121.33 2.2.2.1 vrf gold
ip nat inside source static 192.169.121.33.2.2.2.2 vrf silver

Related Commands

Command
Description

clear ip nat translation

Clears dynamic NAT translations from the translation table.

ip nat

Designates that traffic originating from or destined for the interface is subject to NAT.

ip nat inside destination

Enables NAT of the inside destination address.

ip nat inside source

Enables NAT of the inside source address.

ip nat pool

Defines a pool of IP addresses for NAT.

ip nat service

Enables a port other than the default port.

show ip nat statistics

Displays NAT statistics.

show ip nat translations

Displays active NAT translations.