VRF - jibingl/CCNA-CCNP GitHub Wiki
Virtual Routing and Forwarding
- Function as isolated virtual router instances inside a physical router
- VRF-lite: VRF without MP-BGP or MPLS
Configuration Example
In this topology, VRF separates customers Gym and School network traffic. Each customer has isolated routing even though they use the same IP addresses.
ISP-1
ip vrf GYM //Create a virtual router instance named GYM
ip vrf SCHOOL //Create a virtual router instance named SCHOOL
interface Ethernet 0/1
description GYM
ip vrf forwarding GYM //Assign this interface to virtual router GYM
ip address 61.201.1.1 255.255.255.248
interface Ethernet 0/0.11
description GYM
encapsulation dot1q 11
ip vrf forwarding GYM //Assign this sub-interface to virtual router GYM
ip address 10.1.1.1 255.255.255.252
interface Ethernet 0/0.12
description SCHOOL
encapsulation dot1q 12
ip vrf forwarding SCHOOL //Assign this sub-interface to virtual router SCHOOL
ip address 10.1.1.1 255.255.255.252
router ospf 11 vrf GYM //An OSPF process 11 for virtual router GYM
network 10.1.1.0 0.0.0.255 area 1
network 61.201.1.0 0.0.0.255 area 1
router ospf 22 vrf SCHOOL //An OSPF process 22 for virtual router SCHOOL
network 10.1.1.0 0.0.0.255 area 1
network 61.201.1.0 0.0.0.255 area 1
ISP-2
ip vrf GYM
ip vrf SCHOOL
interface Ethernet 0/1
description GYM
ip vrf forwarding GYM
ip address 61.202.2.1 255.255.255.248
interface Ethernet 0/2
description SCHOOL
ip vrf forwarding SCHOOL
ip address 61.202.2.1 255.255.255.248
interface Ethernet 0/0.11
description GYM
encapsulation dot1q 11
ip vrf forwarding GYM
ip address 10.1.1.2 255.255.255.252
interface Ethernet 0/0.12
description SCHOOL
encapsulation dot1q 12
ip vrf forwarding SCHOOL
ip address 10.1.1.2 255.255.255.252
router ospf 11 vrf GYM
network 10.1.1.0 0.0.0.255 area 1
network 61.202.2.0 0.0.0.255 area 1
router ospf 22 vrf SCHOOL
network 10.1.1.0 0.0.0.255 area 1
network 61.202.2.0 0.0.0.255 area 1
show ip ospf neighbor
show ip route vrf GYM
show ip route vrf SCHOOL