1.7 Configure and verify VRF-Lite
ENARSI 300-410 v1.1 · 1.0 Layer 3 Technologies
VRF-Lite splits one router into several routing tables. Each VRF has its own interfaces, routes and routing processes, so two customers can even use the same addresses. There is no MPLS: VRFs are carried between routers on separate links or 802.1Q subinterfaces, one per VRF.
What you must know
- Create a VRF with
vrf definitionand an address family, and put interfaces in it. - Know that
vrf forwardingremoves the interface's IP address. - Run OSPF, EIGRP and BGP per VRF, and static routes with
ip route vrf. - Verify and test per VRF:
show ip route vrf,ping vrf,traceroute vrf.
Two VRFs over one trunk
vrf definition RED
address-family ipv4
vrf definition BLUE
address-family ipv4
!
interface GigabitEthernet0/0.100
encapsulation dot1Q 100
vrf forwarding RED
ip address 10.0.12.1 255.255.255.252
interface GigabitEthernet0/0.200
encapsulation dot1Q 200
vrf forwarding BLUE
ip address 10.0.12.1 255.255.255.252 ! the same address, another VRF
!
router ospf 10 vrf RED
network 10.0.0.0 0.255.255.255 area 0
router eigrp CUSTOMERS
address-family ipv4 unicast vrf BLUE autonomous-system 200
network 10.0.0.0RED traffic stays in RED (1). BLUE has its own table and no route to RED's networks (2), even though the addresses are the same.
Verifying and the classic traps
R1# show vrf
Name Default RD Protocols Interfaces
BLUE <not set> ipv4 Gi0/0.200
Gi0/2
RED <not set> ipv4 Gi0/0.100
Gi0/1
R1# ping vrf RED 10.2.2.10
!!!!!vrf forwardingon an interface deletes its IP address (IOS prints% Interface ... IPv4 disabled and address(es) removed due to enabling VRF). Configure the VRF first, then the address.- A plain
ping 10.2.2.10uses the global table and fails; useping vrf RED. - OSPF needs one process per VRF (
router ospf 10 vrf RED). EIGRP named mode and BGP use one process with an address family per VRF. - A static route in a VRF is
ip route vrf RED 0.0.0.0 0.0.0.0 10.0.12.2. A next hop in another VRF needs theglobalkeyword or route leaking. - An RD is only required for BGP in a VRF (
rd 65000:1); VRF-Lite with IGPs does not need one.
Commands
show vrf [detail] | VRFs, their RD, address families and interfaces. |
show ip route vrf <name> | One VRF's routing table. |
show ip protocols vrf <name> | Routing processes in that VRF. |
ping vrf <name> <ip> / traceroute vrf <name> <ip> | Test inside the VRF. |
Exam traps
- Putting an interface in a VRF removes its address.
- Tests without
vrfuse the global table. - Each VRF needs its own link or subinterface between routers; VRF-Lite does not multiplex on one interface without tags.
ip vrf(old style, IPv4 only) andvrf definition(multiprotocol) are different commands; don't mix them on one VRF.
Check yourself
- Why does an interface lose its address when you add
vrf forwarding? - The address belonged to the global table; IOS removes it so you add it again in the VRF.
- Can RED and BLUE both use 10.1.1.0/24 on R1?
- Yes, each VRF has its own routing table.
- How many OSPF processes do two VRFs with OSPF need?
- Two: one
router ospf <id> vrf <name>per VRF. - A ping from R1 to a RED host fails, but
ping vrf REDworks. Why? - Plain ping uses the global table, which has no route to the RED network.
Labs
More topics in 1.0 Layer 3 Technologies
- 1.1 Troubleshoot administrative distance across every routing source
- 1.2 Troubleshoot route maps in any routing protocol: attributes, tags and filters
- 1.3 Troubleshoot routing loop prevention: filters, tags, split horizon and poisoned routes
- 1.4 Troubleshoot redistribution between routing protocols and other route sources
- 1.5 Troubleshoot manual and automatic route summarization
- 1.9 Troubleshoot EIGRP in classic and named mode, globally and in a VRF
- 1.10 Troubleshoot OSPFv2 and OSPFv3
- 1.11 Troubleshoot internal and external BGP, globally and in a VRF