Integrating NAT with MPLS VPNs

Network Address Translation (NAT) Integration with MPLS VPNs feature allows multiple Multiprotocol Label Switching (MPLS) Virtual Private Networks (VPNs) to be configured on a single device to work together. NAT can differentiate which MPLS VPN it receives IP traffic from even if the MPLS VPNs are all using the same IP addressing scheme. This enhancement enables multiple MPLS VPN customers to share services while ensuring that each MPLS VPN is completely separate from the other.

Prerequisites for Integrating NAT with MPLS VPNs

  • Before performing the tasks in this module, you should be familiar with the concepts described in the “Configuring NAT for IP Address Conservation” module.

  • All access lists required for use with the tasks in this module should be configured prior to beginning the configuration task. For information about how to configure an access list, see the IP Access List Sequence Numbering document at the following URL:

http://www.cisco.com/univercd/cc/td/doc/product/software/ios122s/122snwft/release/122s14/fsaclseq.htm


Note


If you specify an access list to use with a NAT command, NAT does not support the commonly used permit ip any any command in the access list.


Restrictions for Integrating NAT with MPLS VPNs

Inside VPN to VPN with NAT is not supported.

Information About Integrating NAT with MPLS VPNs

Benefits of NAT Integration with MPLS VPNs

MPLS service providers would like to provide value-added services such as Internet connectivity, domain name servers (DNS), and voice over IP (VoIP) service to their customers. The providers require that their customers; IP addresses be different when reaching the services. Because MPLS VPN allows customers to use overlapped IP addresses in their networks, NAT must be implemented to make the services possible.

Implementation Options for Integrating Nat with MPLS VPNs

There are two approaches to implementing NAT in the MPLS VPN network. NAT can be implemented on the customer edge (CE) router, which is already supported by NAT, or it can be implemented on a provider edge (PE) router. The NAT Integration with MPLS VPNs feature enables the implementation of NAT on a PE router in an MPLS cloud.

Scenarios for Implementing NAT on the PE Router

NAT could be implemented on the PE router in the following scenarios:

  • Service point--Shared access can be from a generic interface or from a VPN interface.

  • NAT point--NAT can be configured on the PE router that is directly connected to the shared access gateway, or on the PE router that is not directly connected to the shared access gateway.

  • NAT interface--The shared access gateway interface most often is configured as the outside interface of NAT. The inside interface of NAT can be either the PE-CE interface of a VPN, the interface to the MPLS backbone, or both. The shared access gateway interface can also be configured as the inside interface.

  • Routing type--Common service can be Internet connectivity or a common server. For Internet connectivity, a default route should be propagated to all the VPN customers that use the service. For common server access, a static or dynamically learned route should be propagated to the VPN customers.

  • NAT configuration--NAT can have different configurations: static, dynamic, pool/interface overloading, and route-map.

The figure below shows a typical NAT integration with MPLS VPNs. The PE router connected to the internet and centralized mail service is employed to do the address translation.

Figure 1. Typical NAT Integration with MPLS VPNs

How to Integrate NAT with MPLS VPNs

Perform one or more of the following tasks depending on the type of translation you wish to configure for your network:

Configuring Inside Dynamic NAT with MPLS VPNs

Perform this task to configure your NAT PE router for dynamic translations to integrate with MPLS VPNs.

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. ip nat pool name start-ip end-ip netmask netmask
  4. ip nat [inside | outside ] source [list {access-list-number | access-list-name } | route-map name ] [interface type number | pool pool-name ] vrf vrf-name [overload ]
  5. Repeat Step 4 for each VPN being configured
  6. ip route vrf vrf-name prefix mask interface-type interface-number next-hop-address
  7. Repeat Step 6 for each VPN being configured.
  8. exit
  9. show ip nat translations vrf vrf-name

DETAILED STEPS

  Command or Action Purpose

Step 1

enable

Example:


Router> enable

Enables higher privilege levels, such as privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:


Router# configure terminal

Enters global configuration mode.

Step 3

ip nat pool name start-ip end-ip netmask netmask

Example:


Router(config)# ip nat pool inside 2.2.2.10 2.2.2.10 netmask 255.255.255.0

Defines a pool of IP addresses for NAT.

Step 4

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

Example:


Router(config)# ip nat inside source list 1 pool mypool vrf shop overload

Allows NAT to be configured on a particular VPN.

Step 5

Repeat Step 4 for each VPN being configured

--

Step 6

ip route vrf vrf-name prefix mask interface-type interface-number next-hop-address

Example:


Router(config)# 
ip route vrf shop 0.0.0.0 0.0.0.0 ethernet 0 168.58.88.2

Allows NAT to be configured on a particular VPN.

Step 7

Repeat Step 6 for each VPN being configured.

--

Step 8

exit

Example:


Router(config)# exit

Returns to privileged EXEC mode.

Step 9

show ip nat translations vrf vrf-name

Example:


Router# show ip nat translations vrf shop

(Optional) Displays the settings used by virtual routing/forwarding (VRF) table translations.

Configuring Inside Static NAT with MPLS VPNs

Perform this task to configure your NAT PE router for static translations to integrate with MPLS VPNs.

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. 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 ]
  4. Repeat Step 3 for each VPN being configured.
  5. ip route vrf vrf-name prefix prefix mask next-hop-address global
  6. Repeat Step 5 for each VPN being configured.
  7. exit
  8. show ip nat translations vrf vrf-name

DETAILED STEPS

  Command or Action Purpose

Step 1

enable

Example:


Router> enable

Enables higher privilege levels, such as privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:


Router# configure terminal

Enters global configuration mode.

Step 3

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 ]

Example:


Router(config)# 
ip nat inside source static 192.168.121.113 2.2.2.1 vrf shop 

Enables inside static translation on the VRF.

Step 4

Repeat Step 3 for each VPN being configured.

--

Step 5

ip route vrf vrf-name prefix prefix mask next-hop-address global

Example:


Router(config)# 
ip route vrf shop 0.0.0.0 0.0.0.0 168.58.88.2 global

Allows the route to be shared by several customers.

Step 6

Repeat Step 5 for each VPN being configured.

--

Step 7

exit

Example:


Router(config)# exit

Returns to privileged EXEC mode.

Step 8

show ip nat translations vrf vrf-name

Example:


Router# show ip nat translations vrf shop

(Optional) Displays the settings used by VRF translations.

Configuring Outside Dynamic NAT with MPLS VPNs

Perform this step to configure your NAT PE router for dynamic outside translations to integrate with MPLS VPNs.

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. ip nat pool outside global-ip local-ip netmask netmask
  4. ip nat inside source static local-ip global-ip vrf vrf-name
  5. Repeat Step 4 for each VRF being configured.
  6. ip nat outside source static global-ip local-ip vrf vrf-name
  7. exit
  8. show ip nat translations vrf vrf-name

DETAILED STEPS

  Command or Action Purpose

Step 1

enable

Example:


Router> enable

Enables higher privilege levels, such as privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:


Router# configure terminal

Enters global configuration mode.

Step 3

ip nat pool outside global-ip local-ip netmask netmask

Example:


Router(config)# 
ip nat pool outside 4.4.4.1 4.4.4.254 netmask 255.255.255.00

Allows the configured VRF to be associated with the NAT translation rule.

Step 4

ip nat inside source static local-ip global-ip vrf vrf-name

Example:


Router(config)# 
ip nat inside source static 192.168.121.113 2.2.2.1 vrf shop

Allows the route to be shared by several customers.

Step 5

Repeat Step 4 for each VRF being configured.

Allows the route to be shared by several customers.

Step 6

ip nat outside source static global-ip local-ip vrf vrf-name

Example:


Router(config)# 
ip nat outside source static 168.58.88.2 4.4.4.1 vrf shop

Enables NAT translation of the outside source address.

Step 7

exit

Example:


Router(config)# exit

Returns to privileged EXEC mode.

Step 8

show ip nat translations vrf vrf-name

Example:


Router# show ip nat translations vrf shop

(Optional) Displays the settings used by VRF translations.

Configuring Outside Static NAT with MPLS VPNs

Perform this task to configure your NAT PE router for static outside translations to integrate with MPLS VPNs.

SUMMARY STEPS

  1. enable
  2. configure {terminal | memory | network }
  3. ip nat pool inside global-ip local-ip netmask netmask
  4. Repeat Step 3 for each pool being configured.
  5. ip nat inside source list access-list-number pool pool-name vrf vrf-name
  6. Repeat Step 5 for each pool being configured.
  7. ip nat outside source static global-ip local-ip vrf vrf-name
  8. Repeat Step 7 for all VPNs being configured.
  9. exit
  10. show ip nat translations vrf vrf-name

DETAILED STEPS

  Command or Action Purpose

Step 1

enable

Example:


Router> enable

Enables higher privilege levels, such as privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure {terminal | memory | network }

Example:


Router# configure terminal

Enters global configuration mode.

Step 3

ip nat pool inside global-ip local-ip netmask netmask

Example:


Router(config)# ip nat pool inside1 2.2.1.1 2.2.1.254 netmask 255.255.255.0

Allows the configured VRF to be associated with the NAT translation rule.

Step 4

Repeat Step 3 for each pool being configured.

--

Step 5

ip nat inside source list access-list-number pool pool-name vrf vrf-name

Example:


Router(config)# 
ip nat inside source list 1 pool inside2 vrf shop

Allows the route to be shared by several customers.

Step 6

Repeat Step 5 for each pool being configured.

Defines the access list.

Step 7

ip nat outside source static global-ip local-ip vrf vrf-name

Example:


Router(config)# 
ip nat outside source static 168.58.88.2 4.4.4.1 vrf shop

Allows the route to be shared by several customers.

Step 8

Repeat Step 7 for all VPNs being configured.

--

Step 9

exit

Example:


Router(config)# exit

Returns to privileged EXEC mode.

Step 10

show ip nat translations vrf vrf-name

Example:


Router# show ip nat translations vrf shop

(Optional) Displays the settings used by VRF translations.

Configuration Examples for Integrating NAT with MPLS VPNs

Configuring Inside Dynamic NAT with MPLS VPNs Example

The following example shows configuring inside Dynamic NAT with MPLS VPNs.


!
ip nat pool inside 2.2.2.10 2.2.2.10 netmask 255.255.255.0
ip nat inside source list 1 pool inside vrf bank overload
ip nat inside source list 1 pool inside vrf park overload
ip nat inside source list 1 pool inside vrf shop overload
!
ip route vrf shop 0.0.0.0 0.0.0.0 Ethernet1/3 168.58.88.2
ip route vrf bank 0.0.0.0 0.0.0.0 Ethernet1/3 168.58.88.2
ip route vrf park 0.0.0.0 0.0.0.0 Ethernet1/3 168.58.88.2
!
access-list 1 permit 192.168.0.0 0.0.255.255

Configuring Inside Static NAT with MPLS VPNs Example

The following example shows configuring inside static NAT with MPLS VPNs.


!
ip nat inside source static 192.168.121.113 2.2.2.1 vrf shop
ip nat inside source static 192.168.122.49 2.2.2.2 vrf shop
ip nat inside source static 192.168.121.113 2.2.2.3 vrf bank
ip nat inside source static 192.168.22.49 2.2.2.4 vrf bank
ip nat inside source static 192.168.121.113 2.2.2.5 vrf park
ip nat inside source static 192.168.22.49 2.2.2.6 vrf park
ip nat inside source static 192.168.11.1 2.2.2.11 vrf shop
ip nat inside source static 192.168.11.3 2.2.2.12 vrf shop
ip nat inside source static 140.48.5.20 2.2.2.13 vrf shop
!
ip route 2.2.2.1 255.255.255.255 Ethernet1/0 192.168.121.113
ip route 2.2.2.2 255.255.255.255 Ethernet1/0 192.168.121.113
ip route 2.2.2.3 255.255.255.255 Serial2/1.1 192.168.121.113
ip route 2.2.2.4 255.255.255.255 Serial2/1.1 192.168.121.113
ip route 2.2.2.5 255.255.255.255 FastEthernet0/0 192.168.121.113
ip route 2.2.2.6 255.255.255.255 FastEthernet0/0 192.168.121.113
ip route 2.2.2.11 255.255.255.255 Ethernet1/0 192.168.121.113
ip route 2.2.2.12 255.255.255.255 Ethernet1/0 192.168.121.113
ip route 2.2.2.13 255.255.255.255 Ethernet1/0 192.168.121.113

Configuring Outside Dynamic NAT with MPLS VPNs Example

The following example shows configuring outside dynamic NAT with MPLS VPNs.


!
ip nat pool outside 4.4.4.1 4.4.4.254 netmask 255.255.255.0
ip nat inside source static 192.168.121.113 2.2.2.1 vrf shop
ip nat inside source static 192.168.122.49 2.2.2.2 vrf shop
ip nat inside source static 192.168.121.113 2.2.2.3 vrf bank
ip nat inside source static 192.168.22.49 2.2.2.4 vrf bank
ip nat inside source static 192.168.121.113 2.2.2.5 vrf park
ip nat inside source static 192.168.22.49 2.2.2.6 vrf park
ip nat outside source list 1 pool outside
!

Configuring Outside Static NAT with MPLS VPNs Example

The following example shows configuring outside static NAT with MPLS VPNs.


!
ip default-gateway 10.1.15.1
ip nat pool inside1 2.2.1.1 2.2.1.254 netmask 255.255.255.0
ip nat pool inside2 2.2.2.1 2.2.2.254 netmask 255.255.255.0
ip nat pool inside3 2.2.3.1 2.2.3.254 netmask 255.255.255.0
ip nat inside source list 1 pool inside2 vrf bank
ip nat inside source list 1 pool inside3 vrf park
ip nat inside source list 1 pool inside1 vrf shop
ip nat outside source static 168.58.88.2 4.4.4.1 vrf bank
ip nat outside source static 18.68.58.1 4.4.4.2 vrf park
ip nat outside source static 168.58.88.1 4.4.4.3 vrf shop
ip classless
ip route 192.170.10.0 255.255.255.0 Ethernet1/0 192.168.121.113
ip route 192.170.11.0 255.255.255.0 Serial2/1.1 192.168.121.113
ip route 192.170.12.0 255.255.255.0 FastEthernet0/0 192.168.121.113
ip route vrf shop 0.0.0.0 0.0.0.0 168.58.88.2 global
ip route vrf bank 0.0.0.0 0.0.0.0 168.58.88.2 global
ip route vrf park 0.0.0.0 0.0.0.0 168.58.88.2 global
no ip http server
!
access-list 1 permit 192.168.0.0 0.0.255.255

Where to Go Next

  • To learn about Network Address Translation and configure NAT for IP address conservation, see the “Configuring NAT for IP Address Conservation” module.

  • To verify, monitor, and maintain NAT, see the “Monitoring and Maintaining NAT” module.

  • To use NAT with application level gateways, see the “Using Application Level Gateways with NAT” module.

  • To configure NAT for high availability, see the “Configuring NAT for High Availability” module.

Additional References for Integrating NAT with MPLS VPNs

Related Documents

Related Topic

Document Title

IOS Commands

Cisco IOS Master Command List

NAT commands

Cisco IOS IP Addressing Services Command Reference

Standards and RFCs

Standard & RFC

Title

RFC 2547

BGP/MPLS VPNs

Technical Assistance

Description

Link

The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password.

http://www.cisco.com/cisco/web/support/index.html

Feature Information for Integrating NAT with MPLS VPNs

Table 1. Feature Information for Integrating NAT with MPLS VPNs

Feature Name

Releases

Feature Configuration Information

Integrating NAT with MPLS VPNs

12.1(13)T

15.1(1)SY

The Integrating NAT with MPLS VPNs feature allows multiple Multiprotocol Label Switching (MPLS) VPNs to be configured on a single device to work together.