VRF-aware NAT and VASI
Two customers both use 10.0.0.0/8 and both need one shared server. VRF-aware NAT lets hosts in different VRFs reach common servers in the global table or the internet: ordinary NAT with a VRF written on it. Translation between two VRFs is a different matter: IOS XE does not support classic inter-VRF NAT and uses VASI, a pair of virtual interfaces each in a different VRF, instead.
By Arif, founder of Daveth · Updated
The full 5 min walkthrough is in Daveth Pro (Network). See what the plan opens
What this page answers
What is VRF-aware NAT?
NAT that lets hosts in private address space in different VRFs reach common servers in the internet or the global table, with the VRF named on the ip nat inside source command. Read it in “VRF-aware NAT, and which direction it is for”
How do you NAT between two VRFs on IOS XE?
Through VASI. IOS XE does not support classic inter-VRF NAT configurations; inter-VRF NAT is achieved with VASI pairs, where each interface of the pair belongs to a different VRF. Read it in “And then somebody asks for traffic between two instances”
What is VASI?
Pairs of virtual interfaces, vasileft and vasiright, each associated with a different VRF. They pair automatically by interface index, and a packet entering vasileft is forwarded to its paired vasiright: a cable inside the router between two instances. Read it in “A cable inside the router”
Two customers, one address range, one shared server
Both customers use 10.0.0.0/8. Both have a host at 10.0.0.50. Both need to reach 172.16.9.10. Everything in 4.5.d.i to iii assumed a single routing table.
There are two mechanisms for this, and the boundary between them is the whole lesson, because one of them is not what you expect.
State 1 The same address twice
Which of these two hosts is the one the server will see?

VRF-aware NAT, and which direction it is for
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.
Read the end of that sentence carefully: and common servers in the Internet or the global domain. This is an instance talking outward: to the global table, or to something shared. It is ordinary NAT with a VRF written on it:
The syntax, as the Match-in-VRF page prints it. Not a command typed here.
ip nat inside source static local-ip global-ip [vrf vrf-name [match-in-vrf]]
The problem it solves is overlap: 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.
And the keyword that sounds like it is about matching is not. The match-in-vrf keyword enables NAT inside and outside traffic in the same VRF. It keeps both ends of the translation inside one instance, so each customer's translated addresses stay in its own space rather than colliding with another's. To separate the address space for translated addresses among VPNs, configure the match-in-vrf keyword in the NAT mapping.
Two restrictions come with it, both quoted: the feature "is not supported on interface overload configuration", and "The match-in-vrf keyword for intra-VPN NAT is not supported with CGN."
And then somebody asks for traffic between two instances
You need traffic to go from CUST_A to SHARED, translated on the way. You have ip nat inside source ... vrf ... available.
“Devices that run on Cisco IOS XE do not support classical inter-VRF NAT configurations as those found on Cisco IOS devices. Support for inter-VRF NAT on Cisco IOS XE is achieved via VASI implementation.”
The command itself is fine. The Match-in-VRF page's own example types ip nat inside source static with vrf vrf1 match-in-vrf on the end, and what that builds is translation inside one instance. Between two instances is the case the platform leaves out.
No, and there is no keyword combination that will. An engineer bringing a working IOS configuration to IOS XE finds not a renamed command but a missing architecture. This is worth knowing before spending an afternoon on it.
VASI provides the ability to configure services such as IPsec, firewall, and NAT to traffic that flows between virtual routing and forwarding (VRF) instances. Note that NAT is one of three consumers. VASI is infrastructure, not a NAT feature, which is why looking for it in the NAT documentation is unrewarding.
A cable inside the router
VASI is implemented by configuring VASI pairs, where each of the interfaces in the pair is associated with a different VRF instance. And the pairing needs no cable and no configuration of its own:
The pairing is done automatically based on the two interface indexes such that the vasileft interface is automatically paired to the vasiright interface. Any packet that enters the vasileft interface is automatically forwarded to its paired vasiright interface.
So the pairing arranges itself, and that is genuinely all it does. Nobody has to cable anything, and nothing else has been decided on your behalf either: the two sides are joined, and every question about which addresses travel across the join and what happens to them is still yours to answer.
State 2 Where the pair actually is
Two interfaces, in different instances, wired to each other. Where is the wire?

RTR# configure terminal RTR(config)# interface vasileft1 RTR(config-if)# vrf forwarding CUST_A RTR(config-if)# ip address 10.1.1.1 255.255.255.252 RTR(config-if)# interface vasiright1 RTR(config-if)# vrf forwarding SHARED RTR(config-if)# ip address 10.1.1.2 255.255.255.252 RTR(config-if)# end
Two interfaces, in one router, in different instances, wired to each other. A packet leaves CUST_A through a virtual interface and arrives in SHARED through its partner without ever touching copper. There is something quietly absurd about patching a router to itself to get around its own routing separation, and the absurdity is the thing that makes the mechanism stick.
So which interfaces take ip nat inside and ip nat outside? The pair looks like the obvious boundary, one half each. The VASI document does something else:
It configures NAT solely on the vasileft side and has the traffic NATted before it is sent to VRF_RIGHT: The incoming interface on VRF_LEFT is considered as the NAT inside interface, and vasileft 1 is configured as the NAT outside interface.
Both NAT interfaces are in CUST_A: the customer's own interface, GigabitEthernet0/1, already in CUST_A on the link to HOST-A, is inside, vasileft1 is outside, and vasiright1 carries no NAT at all. The translation is finished before the packet reaches the pair. The rule names CUST_A too, typed the way the document types its own:
RTR# configure terminal RTR(config)# interface GigabitEthernet0/1 RTR(config-if)# ip nat inside RTR(config-if)# interface vasileft1 RTR(config-if)# ip nat outside RTR(config-if)# end
RTR# configure terminal RTR(config)# ip nat inside source static 10.0.0.50 192.0.2.10 vrf CUST_A RTR(config)# end
Why this side, when the document also shows NAT on the other one? Its NAT-on-vasiright example puts ip nat inside on vasiright and ip nat outside on the WAN interface, both in the right-hand instance, and then "another route for the source subnet 192.168.0.0 is configured on VRF_RIGHT pointing to the vasiright interface." Applied to this scenario, as this course reads it, that route would be for 10.0.0.50 in SHARED, and both customers have a host at 10.0.0.50. Translating on each customer's own side keeps the overlapping addresses out of SHARED altogether.
One arrangement is ruled out either way: Configuring both the VASI interfaces of a pair as outside is not supported.
And the pair being wired is not the same as traffic knowing to use it. "The VASI virtual interface is the next-hop interface for any packet that needs to be switched between these two VRF instances", which means a route has to name it:
RTR# configure terminal RTR(config)# ip route vrf CUST_A 172.16.0.0 255.255.0.0 vasileft1 10.1.1.2 RTR(config)# end
The entry is there and nothing comes back
Traffic leaves the customer instance, a translation entry appears, and no reply ever arrives. So did the NAT rule do its job? Read the table under the VRF the rule names, CUST_A, which is where the document reads its own: its verification list says "Check if NAT has been configured for the correct VRF."
Computed for this scenario, in the columns of the VASI document's sample. That sample also prints a Pro column, ports and a total line; they are left out because this scenario defines no transport. Not a published sample.
RTR# show ip nat translations vrf CUST_A Inside global Inside local Outside local Outside global 192.0.2.10 10.0.0.50 172.16.9.10 172.16.9.10 ! four columns, all correct, and the reply is not arriving
Do not question the NAT rule. The entry existing is proof it matched and translated: the mechanism you would naturally suspect has already demonstrated that it works.
Because the return packet has never once been impressed by a healthy outbound counter. Everything you are looking at describes traffic leaving. Nothing in that table has any opinion about whether anything can get back, and a one-way success is exactly what a working translation with no return path looks like.
Check the routing table in the other instance, for the global address the translation created. "The pairing is done automatically", but the pairing carries packets between the two interfaces and puts no route for the far side's addresses in either instance. The VASI document's own example types a static route in each, and the one for the reply is in the right-hand instance: "another route for the source NATted IP 172.16.1.5 is configured on VRF_RIGHT pointing to the vasiright interface." So what does each instance have a route for?
Computed from the model: the routes each instance holds at this point. Not the output of a command.
CUST_A 172.16.0.0/16 via vasileft1 next hop 10.1.1.2
There is a route out of CUST_A and nothing in SHARED for 192.0.2.10. This reading is not the output of the command above: a routing table is a different thing, and the point of putting them side by side is that the first looks healthy while the second is the problem.
Which is worth separating from the leak you may already have configured, because the two feel like one job and are not. Making a prefix reachable in the other instance is routing. Deciding what a source address becomes on the way across is translation. Doing the first does not write the second, and a design that stops after the first produces exactly this: a correct entry, a correct outbound path, and silence.
Continue the lesson
The whole lesson, with its drawings and its questions. The rest of this section and 3 more after it.



