Restrictions for Match-in-VRF Support for NAT
-
The Match-in-VRF Support for NAT feature is not supported on interface overload configuration.
- The match-in-vrf keyword for intra-VPN NAT is not supported with CGN.
The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
The Match-in-VRF Support for NAT feature supports Network Address Translation (NAT) of packets that communicate between two hosts within the same VPN routing and forwarding (VRF) instance. In intra-VPN NAT, both the local and global address spaces for end hosts are isolated to their respective VPNs, and as a result, the translated addresses for the hosts overlap each other. The Match-in-VRF Support for NAT feature helps separate the address space for translated addresses among VPNs.
The Match-in-VRF Support for NAT feature is not supported on interface overload configuration.
In Cisco IOS XE Release 3.5S and later releases, the Match-in-VRF Support for NAT feature supports NAT of packets that communicate between two hosts within the same VPN.
The VRF-aware NAT enables communication between hosts in the private address space in different VPN routing and forwarding (VRF) instances and common servers in the Internet or the global domain. Because IP addresses of the inside hosts overlap with each other, the VRF-aware NAT facilitates communication between these hosts by converting overlapped inside IP addresses into globally unique addresses. The Match-in-VRF Support for NAT feature extends VRF-aware NAT by supporting intra-VPN NAT capability. In the intra-VPN NAT, both the local and global address spaces for end hosts are isolated to their respective VPNs, and as a result translated addresses for hosts overlap each other. To separate the address space for translated addresses among VPNs, configure the match-in-vrf keyword in the NAT mapping (ip nat inside source command) configuration. Both static and dynamic NAT configurations support the match-in-vrf keyword.
Note |
All NAT commands that support VRF support the match-in-vrf keyword. Because NAT outside rules (ip nat outside source command) support the match-in-VRF functionality by default, the match-in-vrf keyword is not supported by NAT outside rules. |
In VRF-aware NAT, the IP alias and Address Resolution Protocol (ARP) entries for inside global addresses are configured in the global domain. For intra-VPN NAT, the IP alias and ARP entries for inside global addresses are configured in the VRF through which the translation happens. In intra-VPN NAT, configuration of the match-in-vrf keyword implies that at least one NAT outside interface is configured in the same VRF. The ARP entry in that VRF replies to the ARP request from the outside host.
If inside addresses are configured, the match-in-VRF is determined through inside mappings during the address translation of VRF traffic. If you have configured only outside mapping of IP addresses for address translations, the match-in-VRF will work. When a translation entry is created with both inside and outside mappings, the match-in-vrf keyword is determined by the inside mapping.
The Match-in-VRF Support for NAT feature supports the configuration of multiple dynamic mappings with the same IP address pool.
The following table provides you information about VRF support for NAT:
NAT Inside Interface |
NAT Outside Interface |
||
---|---|---|---|
Global |
Global IPv4 (non-MPLS) |
||
MPLS IP |
VRF
|
||
VRF |
VRF
|
||
VRF |
MPLS
|
||
VRF |
Global IPv4 (non-MPLS) |
Perform the following task to configure a static NAT translation and to enable NAT inside and outside traffic in the same VRF.
Command or Action | Purpose | |||
---|---|---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode.
|
||
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
||
Step 3 |
ip nat inside source static local-ip global-ip [vrf vrf-name [match-in-vrf]] Example:
|
|
||
Step 4 |
interface type number Example:
|
Specifies an interface and enters interface configuration mode. |
||
Step 5 |
ip address ip-address mask [secondary ] Example:
|
Sets a primary IP address for an interface. |
||
Step 6 |
ip nat inside Example:
|
Marks the interface as connected to the inside. |
||
Step 7 |
ip vrf forwarding vrf-name Example:
|
Associates a VRF with an interface or subinterface. |
||
Step 8 |
exit Example:
|
Exits interface configuration mode and returns to global configuration mode. |
||
Step 9 |
interface type number Example:
|
Specifies a different interface and enters interface configuration mode. |
||
Step 10 |
ip address ip-address mask Example:
|
Sets a primary IP address for an interface. |
||
Step 11 |
ip nat outside Example:
|
Marks the interface as connected to the outside.
|
||
Step 12 |
ip vrf forwarding vrf-name Example:
|
Associates a VRF with an interface or subinterface. |
||
Step 13 |
end Example:
|
Exits interface configuration mode and returns to privileged EXEC mode. |
Perform the following task to configure a dynamic NAT translation with the same address pool and to enable NAT inside and outside traffic in the same VRF.
Command or Action | Purpose | |||
---|---|---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode.
|
||
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
||
Step 3 |
ip nat inside source list access-list-number pool pool-name [vrf vrf-name [match-in-vrf]] Example:
|
|
||
Step 4 |
access-list access-list-number permit source [source-wildcard] Example:
|
Defines a standard access list permitting those addresses that are to be translated. |
||
Step 5 |
ip nat inside source list access-list-number pool pool-name vrf vrf-name [match-in-vrf] Example:
|
Establishes dynamic source translation, specifying the access list defined in the previous step. |
||
Step 6 |
interface type number Example:
|
Specifies an interface and enters interface configuration mode. |
||
Step 7 |
ip address ip-address mask Example:
|
Sets a primary IP address for an interface. |
||
Step 8 |
ip nat inside Example:
|
Marks the interface as connected to the inside. |
||
Step 9 |
ip vrf forwarding vrf-name Example:
|
Associates a VRF with an interface or subinterface. |
||
Step 10 |
exit Example:
|
Exits interface configuration mode and returns to global configuration mode. |
||
Step 11 |
interface type number Example:
|
Specifies a different interface and enters interface configuration mode. |
||
Step 12 |
ip address ip-address mask Example:
|
Sets a primary IP address for an interface. |
||
Step 13 |
ip nat outside Example:
|
Marks the interface as connected to the outside.
|
||
Step 14 |
ip vrf forwarding vrf-name Example:
|
Associates a VRF with an interface or subinterface. |
||
Step 15 |
end Example:
|
Exits interface configuration mode and returns to global configuration mode. |
The following example shows how to configure a static NAT translation between the local IP address 10.10.10.1 and the global IP address 172.16.131.1. The match-in-vrf keyword enables NAT inside and outside traffic in the same VRF.
Router# configure terminal
Router(config)# ip nat inside source static 10.10.10.1 172.16.131.1 vrf vrf1 match-in-vrf
Router(config)# interface gigabitethernet 0/0/1
Router(config-if)# ip address 10.114.11.39 255.255.255.0
Router(config-if)# ip nat inside
Router(config-if)# ip vrf forwarding vrf1
Router(config-if)# exit
Router(config)# interface gigabitethernet 0/0/0
Router(config-if)# ip address 172.31.232.182 255.255.255.240
Router(config-if)# ip nat outside
Router(config-if)# ip vrf forwarding vrf1
Router(config-if)# end
The following example shows how to configure dynamic NAT mappings with the same address pool. The match-in-vrf keyword enables NAT inside and outside traffic in the same VRF.
Router# configure terminal
Router(config)# ip nat inside source list 1 pool shared-pool vrf vrf1 match-in-vrf
Router(config)# access-list 1 permit 192.168.34.0 0.0.0.255
Router(config)# ip nat inside source list 1 pool shared-pool vrf vpn1
Router(config)# interface gigabitethernet 0/0/1
Router(config-if)# ip address 172.31.232.182 255.255.255.240
Router(config-if)# ip nat inside
Router(config-if)# ip vrf forwarding vpn1
Router(config-if)# exit
Router(config)# interface gigabitethernet 0/0/0
Router(config-if)# ip address 172.31.232.182 255.255.255.240
Router(config-if)# ip nat outside
Router(config-if)# ip vrf forwarding vpn1
Router(config-if)# end
Related Topic |
Document Title |
---|---|
Cisco IOS commands |
|
NAT commands: complete command syntax, command mode, command history, usage guidelines, and examples |
Cisco IOS IP Addressing Services Command Reference |
IP Access List Sequence Numbering |
IP Access List Sequence Numbering document |
NAT configuration tasks |
“Configuring NAT for IP Address Conservation” module |
NAT maintenance |
“Monitoring and Maintaining NAT” module |
Using NAT with MPLS VPNs |
“Integrating NAT with MPLS VPNs” module |
Standard/RFC |
Title |
---|---|
RFC 903 |
Reverse Address Resolution Protocol |
RFC 826 |
Ethernet Address Resolution Protocol: Or converting network protocol addresses to 48.bit Ethernet address for transmission on Ethernet hardware |
RFC 1027 |
Using ARP to implement transparent subnet gateways |
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. |
Feature Name |
Releases |
Feature Information |
---|---|---|
Match-in-VRF Support for NAT |
Cisco IOS XE Release 3.5S |
The Match-in-VRF Support for NAT feature supports the NAT translation of packets that communicate between two hosts within the same VPN. |