Virtaul Route Forwarding (VRF) on CISCO Routers

So in this Lab we are going to implement basic VRFs on Cisco devices.

We will handle the scenario as a real world implementation scenario.

Problem statement:

As a service provider we are tasked with handling 3 customer & their routes.

Customer are using private IP addresses.

You are to devise a solution so that the customer's routes don't inter-mingle with one another.

Suggested Solution:

• Globally define three VRFs 

• Configure sub-interfaces for Gig 0/1 on the Common SP router(vIOS) 

• Assign sub-interfaces to VLAN and VRF instances 

• Associate an OSPF routing process with each VRF 

• Customer A (vIOS4) must be assigned to VLAN 2 

• Customer B (vIOS3) must be assigned to VLAN 3 

• Customer C (vIOS2) must be assigned to VLAN 4 

Consider you have the following topology:


Let's begin by assigning basic configs on the devices:

Common SP Router Configs:

==================================================================

 !   Change the name of the Router

 !

      hostname COMMON-SP 

      !

!

!   Change the admin state of port to UP

!

interface GigabitEthernet0/0

no shutdown

!

!  Configure the VRFs on the Router

!

vrf definition Cust-A

 description "For Customer A Routes"

 !

 address-family ipv4

 exit-address-family

!

!  Configure a Sub-interface for the customer 

!

interface GigabitEthernet0/0.2

 description "VRF Customer A"

 encapsulation dot1Q 2

 vrf forwarding Cust-A

 ip address 192.0.2.1 255.255.255.252

end

!

!  Configure a vrf aware IGP Protocol

!

router ospf 1 vrf Cust-A

 network 0.0.0.0 255.255.255.255 area 0

!

!  Note : The OSPF runs on all the possible network interface associated with Cust-A

! As OSPF runs on range of networks, the above commands allows it on all possible networks

==================================================================

Do the above for other 2 customers as well.

Switch 6 Configs:

=================================================================

!Change the name of the Switch

!

      hostname SW6

      !

! Configure trunk port with the COMMON SP Router, and allow relevant VLANs

 !

      interface GigabitEthernet0/0

       switchport trunk allowed vlan 2-4

       switchport trunk encapsulation dot1q

       switchport mode trunk

       media-type rj45

       negotiation auto

       no cdp enable

      !

! Configure Access ports to receive packets from respective customers connected with the switch

!

      interface GigabitEthernet0/1

       switchport access vlan 2

       media-type rj45

       negotiation auto

       no cdp enable

      !

      interface GigabitEthernet0/2

       switchport access vlan 3

       media-type rj45

       negotiation auto

       no cdp enable

      !

      interface GigabitEthernet0/3

       switchport access vlan 4

       media-type rj45

       negotiation auto

       no cdp enable

      !

==============================================================

Customer A side Configs:

! Change the name of the device

!

      hostname Cust-A

      !

!

! Configure the interface | No VRF config Required on Client side 

!

      interface GigabitEthernet0/1

       no shutdown

       ip address 192.0.2.2 255.255.255.252

       duplex auto

       speed auto

       media-type rj45

      !

! Configure OSPF

      !

      router ospf 1

       network 0.0.0.0 255.255.255.255 area 0

      !

Do the same for other 2 customers the peers should be UP on both sides.

The OSPF peers should be up and we can verify the results.

You can see that the network command in OSPF takes a range of IPs and runs OSPF on the interfaces that lie in that range.


We can see that there is no routes in the Global Routing Table (GRT).


And the Routes are present in separate routing table which don't inter-mingle with one another.



And the OSPF peering are up and kicking as well.

So the Customer can introduce as many IP prefixes as he requires.

So we have learnt that VRF creates virtual routers on a physical router.

Comments

Popular posts from this blog

Denial of Service : Ping of Death [Kali Linux]

GRE over IPSEC Tunnel

OSPF Special Areas