VRF-aware routing with any routing protocol
General information on “VRF-aware routing”:
- By default, a configured routing protocol uses the global routing table
- With VRF-aware routing, a routing protocol uses a virtual, independent routing table
- An example of usage could be an ISP who wants to separate the customers routing information
- For VRF-aware routing to work, not only the routing protocol, but also the interfaces need to be in the same VRF
“VRF-aware routing” CLI configuration commands:
## Configuring a VRF
Router(config)# vrf definition <vrf-name>
Router(config-vrf)# address-family [ipv4 | ipv6]
## Assigning an interface to a VRF
Router(config)# interface <if>
Router(config-if)# vrf forwarding <vrf-name>
## Configuring VRF-aware routing for static routes
Router(config)# [ip | ipv6] route vrf <vrf-name> <network> <mask> [<next-hop-ip> | <exit-if>] [<ad>]
## Configuring VRF-aware routing for EIGRP (classic mode)
Router(config)# router eigrp <pid>
Router(config-router)# address-family ipv4 vrf <vrf-name> autonomous-system <asn>
## Configuring VRF-aware routing for EIGRP (named mode)
Router(config)# router eigrp [WORD]
Router(config-router)# address-family [ipv4 | ipv6] vrf <vrf-name> autonomous-system <asn>
## Configuring VRF-aware routing for OSPFv2
Router(config)# router ospf <pid> vrf <vrf-name>
## Configuring VRF-aware routing for OSPFv3
Router(config)# router ospfv3 <pid>
Router(config-router)# address-family [ipv4 | ipv6] vrf <vrf-name>
## Configuring VRF-aware routing for BGP
Router(config)# router bgp <asn>
Router(config-router)# address-family [ipv4 | ipv6 | vpnv4 | vpnv6] vrf <vrf-name>