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 network traffic for customer Gym and School. Each customer has isolated routing even though they use the same IP addresses.

ISP-1

! Create virtual router instances for Gym and School
ip vrf GYM
ip vrf SCHOOL

! Assign the interface to virtual router instance GYM
interface Ethernet 0/1
 description GYM
 ip vrf forwarding GYM
 ip address 61.201.1.1 255.255.255.248
 ip ospf 11 area 1

! Assign a sub-interface to virtual router GYM
interface Ethernet 0/0.11
 description GYM
 encapsulation dot1q 11
 ip vrf forwarding GYM
 ip address 10.1.1.1 255.255.255.252
 ip ospf 11 area 1

! Assign a sub-interface to virtual router SCHOOL
interface Ethernet 0/0.12
 description SCHOOL
 encapsulation dot1q 12
 ip vrf forwarding SCHOOL
 ip address 10.1.1.1 255.255.255.252
 ip ospf 12 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
 ip ospf 11 area 1

interface Ethernet 0/2
 description SCHOOL
 ip vrf forwarding SCHOOL
 ip address 61.202.2.1 255.255.255.248
 ip ospf 12 area 1

interface Ethernet 0/0.11
 description GYM
 encapsulation dot1q 11
 ip vrf forwarding GYM
 ip address 10.1.1.2 255.255.255.252
 ip ospf 11 area 1

interface Ethernet 0/0.12
 description SCHOOL
 encapsulation dot1q 12
 ip vrf forwarding SCHOOL
 ip address 10.1.1.2 255.255.255.252
 ip ospf 12 area 1

show ip ospf neighbor - ISP-1 has two neighbors pointing to the same router ISP-2

show ip route vrf GYM

show ip route vrf SCHOOL