Example of Dynamic Inter-VRF route leaking

The figure below depicts a typical dynamic route-leaking scenario. VRFs “Yellow” and “Green” are virtual partitions in the same router. The destination VRF ("Green") is where the route is being leaked to, and the source VRF ("Yellow") is where the route is being leaked from. In this example, IPv4 is used.

Click to expand in new window
Dynamic inter-VRF route leaking

  1. Configure VRF "Green".
    device(config)# vrf Green
    device(config-vrf-Green)# address-family ipv4 unicast
  2. Configure VRF "Yellow".
    device(config)# vrf Yellow
    device(config-vrf-Yellow)# address-family ipv4 unicast
  3. Configure an IPv4 prefix list, named "import-prefix" in this example.
    device(config)# ip prefix-list import-prefix permit 10.2.3.0/24
    device(config)# ip prefix-list import-prefix permit 10.1.2.0/24
    
  4. Configure a route map with "match" conditions, including metric and tag for matched routes, and then import it.
    device(config)# route-map import-map permit 10                        
    device(config-route-map-import-map/permit/10)# match metric 10
    device(config-route-map-import-map/permit/10)# match tag 10
    device(config-route-map-import-map/permit/10)# match ip address prefix-list import-prefix 
    
    
  5. Import the desired route map for the specified VRF.
    device(config)# vrf Green
    device(config-vrf-Green)# address-family ipv4 unicast
    device(vrf-Green-ipv4-unicast)# ip import routes Yellow route-map import-map
    
  6. (Optional) Redistribute any routes learned by OSPF (or BGP) in the source VRF into the destination VRF. The following shows an OSPF example.
    device(config-ipv4-unicast)# exit
    device(config-vrf-Green)# exit
    device(config)# router ospf
    device(config-router-ospf-vrf-default-vrf)# redistribute ospf