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.
device(config)# vrf Green device(config-vrf-Green)# address-family ipv4 unicast
device(config)# vrf Yellow device(config-vrf-Yellow)# address-family ipv4 unicast
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
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
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
device(config-ipv4-unicast)# exit device(config-vrf-Green)# exit device(config)# router ospf device(config-router-ospf-vrf-default-vrf)# redistribute ospf