Use this command to set a VRF context before entering several privileged EXEC commands that you want to apply to the same VRF. This command saves you from repeatedly entering a VRF name in several EXEC commands that apply to a single VRF.
When in a routing context, the system prompt changes to indicate the routing context being used.
Commands that can be used in a routing context are ping, show ip route, telnet, and traceroute.
Use the routing-context vrf global command to exit the routing context.
The following example of the routing-context command causes subsequent EXEC commands to apply to VRF red:
Router# routing-context vrf red
Router%red# ping 10.2.2.3
Sending 5, 100-byte ICMP Echos to 10.2.2.3, timeout is 2 seconds:
Success rate is 100 percent, round-trip min/avg/max = 1/2/4 ms
Router%red# show ip route
Routing Table: red
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.1.3.0/24 is directly connected, GigabitEthernet0/0/0.100
L 10.1.3.1/32 is directly connected, GigabitEthernet0/0/0.100