219
7.9.7. VRF Configuration Example
1. Create virtual router instances. The following commands create and name two instances and enter VRF
Configuration mode for each.
In VRF Configuration mode for each VR, a description is added and the maximum number of routes allowed in
each virtual instance is configured. On the “Red” instance, the number of routes above which a warning
message is issued is also configured.
The ip routing command enables routing in each VR instance:
(Switch) #configure
(Switch) (Config)#ip vrf Red
(Switch) (Config-vrf-Red)#description "finance department" (Switch) (Config-vrf-Red)#maximum
routes 2048
(Switch) (Config-vrf-Red)#maximum routes warn 80 (Switch) (Config-vrf-Red)#ip routing
(Switch) (Config-vrf-Red)#exit
(Switch) (Config)#ip vrf Blue
(Switch) (Config-vrf-Blue)#description "human resources department" (Switch) (Config-vrf-
Blue)#maximum routes 4096
(Switch) (Config-vrf-Blue)#ip routing
(Switch) (Config-vrf-Blue)#exit
2. In Interface Config mode, assign interfaces to each virtual router:
(Switch) (Config)#interface 0/1
(Switch) (Interface 1/0/1)#ip vrf forwarding Red
Warning: routing interface moved from Default router instance to "Red" router instance.
(Switch) (Interface 1/0/1)#exit
(Switch) (Config)#interface 0/2
(Switch) (Interface 1/0/2)#ip vrf forwarding Blue
Warning: routing interface moved from Default router instance to "Blue" router instance.
(Switch) (Interface 1/0/2)#exit
3. Create static leaked routes as needed in the VR
instances.
In the following example, subnetwork 9.0.0.0/24 is a connected subnetwork in the global route table and
subnet 56.6.6.0/24 is reachable via a gateway 9.0.0.2 in the global route table. Subnet 8.0.0.0/24 is a
connected subnetwork in virtual router Red.