IMPLEMENTING VRF - LITE
Chirag Dhall
CCIE #68677 | Corporate Trainer at PyNet Labs | CCIE Enterprise Infrastructure | SDWAN | CCNP ENCOR | CCNP ENARSI | CCNA Enterprise | CCNA DevNet | Ansible | Foundations of Network Automation
Part 1: Build the Network and Configure Basic Device Settings.
Configure all the Routers with the hostnames and IP address configurations as mentioned in the topology.
Part 2: Configure and Verify VRF and Interface Addressing
Enable VRF on R1.
R1(config)#ip vrf a
R1(config-vrf)#ip vrf b
R1(config-vrf)exit
Bind the interfaces of R1 to the respective VRF
R1(config)#interface gi 0/2
R1(config-if)#ip vrf forwarding a
R1(config-if)#ip address 11.11.11.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config-if)#interface gi 0/1
R1(config-if)#ip vrf forwarding b
R1(config-if)#ip address 11.11.11.1 255.255.255.0
R1(config-if)#no shutdown
Now, let’s configure R2.
R2(config)#interface gi 0/1
R2(config-if)#ip vrf forwarding a
R2(config-if)#ip address 22.22.22.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config-if)#interface gi 0/2
R2(config-if)#ip vrf forwarding b
R2(config-if)#ip address 22.22.22.1 255.255.255.0
R2(config-if)#no shutdown
Now, we will bring up the connectivity between R1 and R2 for which you can either add one physical link per VRF or you can create some sub-interfaces to make the communication possible. Here I am using sub-interfaces.
R1(config)#interface gi 0/0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config-if)#interface gi 0/0.1
R1(config-subif)#ip vrf forwarding a
R1(config-subif)#encapsulation dot1q 2
R1(config-subif)#ip address 12.10.1.1 255.255.255.252
R1(config-subif)#interface gi 0/0.2
R1(config-subif)#ip vrf forwarding b
R1(config-subif)#encapsulation dot1q 3
R1(config-subif)#ip address 12.10.1.1 255.255.255.252
R1(config-subif)#exit
Let’s configure R2 now.
R2(config)#interface gi 0/0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config-if)#interface gi 0/0.1
领英推荐
R2(config-subif)#ip vrf forwarding a
R2(config-subif)#encapsulation dot1q 2
R2(config-subif)#ip address 12.10.1.2 255.255.255.252
R2(config-subif)#interface gi 0/0.2
R2(config-subif)#ip vrf forwarding b
R2(config-subif)#encapsulation dot1q 3
R2(config-subif)#ip address 12.10.1.2 255.255.255.252
R2(config-subif)#exit
Now let’s configure OSPF to make both the sites of Customer A and Customer B communicate with each other. Let’s begin with R3
For Customer A:
R3
R3(config)router ospf 10
R3(config-router)network 11.11.11.0 0.0.0.255 area 1
R3(config-router)exit
R5
R5(config)router ospf 10
R5(config-router)network 22.22.22.0 0.0.0.255 area 1
R5(config-router)exit
R1
R1(config)router ospf 10 vrf a
R1(config-router)network 12.10.1.0 0.0.0.3 area 1
R1(config-router)network 11.11.11.0 0.0.0.255 area 1
R1(config-router)exit
R2
R2(config)router ospf 10 vrf a
R2(config-router)network 12.10.1.0 0.0.0.3 area 1
R2(config-router)network 22.22.22.0 0.0.0.255 area 1
R2(config-router)exit
Verify connectivity by pinging R5 from R3 and vice versa. If you wish to ping from R1 there you will have to specify the source as VRF A by using the command ping vrf a 22.22.22.2
For Customer B:
R4
R3(config)router ospf 20
R3(config-router)network 11.11.11.0 0.0.0.255 area 2
R3(config-router)exit
R5
R5(config)router ospf 20
R5(config-router)network 22.22.22.0 0.0.0.255 area 2
R5(config-router)exit
R1
R1(config)router ospf 20 vrf b
R1(config-router)network 12.10.1.0 0.0.0.3 area 2
R1(config-router)network 11.11.11.0 0.0.0.255 area 2
R1(config-router)exit
R2
R2(config)router ospf 20 vrf b
R2(config-router)network 12.10.1.0 0.0.0.3 area 2
R2(config-router)network 22.22.22.0 0.0.0.255 area 2
R2(config-router)exit
Senior Network Engineer
9 个月Great, thanks for sharing !!
Network Security Engineer
9 个月Thanks for sharing
Sr. Network Engineer
9 个月Very informative. Thank you for sharing!