VRF basics LAB-1

As we know, Virtual routing and forwarding (VRF) is a technology included in IP (Internet Protocol) network routers that allows multiple instances of a routing table to exist in a router and work simultaneously. You can read about it from the last post VRF: Virtual Routing & Forwarding by Kirandeep Mittal.

Here, we will going to work on basic configurations of VRF and learn how it can increase functionality in networks.
Some Application of Vrf can also found here.

Below is lab scenario :

Configuring Router R1 i.e. PE router (Provider Edge)

R1>enable
R1#config t
R1(config)#ip vrf R2
R1(config)#rd 2:2
R1(config)#ip vrf R3
R1(config)#rd 3:3
R1(config)#ip vrf R4
R1(config)#rd 4:4
R1(config)#ip vrf R5
R1(config)#rd 5:5

By using ip vrf R2 router enters into VRF configuration mode and defines the VPN routing instance by assigning a VRF name R2 .
By using command “rd 2:2″ creates routing and forwarding tables. The rd command is in the format ASN:nn or IP-address:nn .

R1(config)#interface f0/0
R1(config-if)#ip vrf forwarding R2
R1(config)#ip vrf forwarding R2
R1(config)#ip address 192.168.1.1 255.255.255.252

R1(config-if)#interface f0/1
R1(config-if)#ip vrf forwarding R3
R1(config-if)#ip address 192.168.1.1 255.255.255.252
R1(config-if)#no shutdown

R1(config)#interface f1/0
R1(config-if)#no switchport
R1(config-if)#ip vrf forwarding R4
R1(config-if)#ip address 192.168.1.1 255.255.255.252
R1(config-if)#no shutdown

R1(config)#interface f1/1
R1(config-if)#no switchport
R1(config-if)#ip vrf forwarding R5
R1(config-if)#ip address 192.168.1.1 255.255.255.252
R1(config-if)#no shutdown

Note: If you look at int f1/0, f1/1 – i have used #no switchport command.
If you will be using GNS for this, there is probability to get this error:

% IP addresses may not be configured on L2 links.

It depends on IOS. I got this error in additional slots only.

For R2, R3, R4, R5 – Just configure the ip address and you are done . πŸ™‚

R2(config)#interface FastEthernet0/0
R2(config)#ip address 192.168.1.2 255.255.255.252
R2(config)#no shutdown

Note:Ip address on all routers interfaces on CE i.e. R2, R3, R4, R5 remain same.
Now try to ping R1 or PE from all CE routers, it should give successful reply.


R2#ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/62/148 ms

Seems too easy though too much useful ..isn't it ? πŸ˜‰
Now, checking vrf's on our routers.
R1#show ip vrf
Name Default RD Interfaces
R2 2:2 Fa0/0
R3 3:3 Fa0/1
R4 4:4 Fa1/0
R5 5:5 Fa1/1

Now, we will going to check vrf route using below command
R1#show ip route vrf R2

Routing Table: R2
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

192.168.1.0/30 is subnetted, 1 subnets
C 192.168.1.0 is directly connected, FastEthernet0/0

R1#show ip route vrf R5

Routing Table: R5
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

192.168.1.0/30 is subnetted, 1 subnets
C 192.168.1.0 is directly connected, FastEthernet1/1

 

You should check VRF route for all other routers also (R3,R4).