Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

VRF Configuration

For some very basic VRF configuration follow the steps:

Figure 1 Basic VRF Configuration

1. Enters VRF configuration mode and assigns a VRF name.

Router(config)#ip vrf vrf-name

2. Creates a VPN route distinguisher (RD) following one of the 16bit-ASN:32bit-number or 32bit-
IP:16bit-number explained above

Router(config-vrf)#rd route-distinguisher

3. Creates a list of import and/or export route target communities for the specified VRF.

Router(config-vrf)# route-target {import | export | both} route-distinguisher

4. (Optional step) Associates the specified route map with the VRF.

Router(config-vrf)# import map route-map

5. Specifies an interface and enters interface configuration mode.

Router(config)# interface type number


VRF Configuration
6. Associates a VRF with an interface or subinterface.

Router(config-vrf)# ip vrf forwarding vrf-name

To check your configuration, you can use ping or traceroute tools under Cisco CLI, but remember
that you have to use “vrf vrf-name” parameter:

Router# ping vrf vrf-name IP-address

Also you can check the virtual routing table:

Router# show ip route vrf vrf-name

(Note: The RD / RT is a 8-byte (64-bits) number which can be written down as follow:

- 16-bit AS number: your 32-bit number

(e.g.) 65000:100

or

-32-bit IP address: your 16-bit number

(e.g) 192.168.0.1:10)
VRF Configuration
Example

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

R1(config)#interface f0/0
R1(config-if)#ip vrf forwarding R2
VRF Configuration
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

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 Company End 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:
!!!!!

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
VRF Configuration
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

You might also like