VIRTUAL ROUTING AND FORWARDING LABS
VIRTUAL ROUTING AND FORWARDING LABS
By Justin O. OLANGI
(view my LinkedIn)
II. TOPOLOGY
This topologies are used just as a example.
For more advanced features of VRF, see the Cisco CCNP MPLS Layer 3 VPN course.
2 By Justin O. OLANGI
II. VIRTUAL ROUTING AND FORWARDING CONFIG
The following steps are required to create a VRF and assign it to an interface:
Step 1. Create a multiprotocol VRF routing table by using the command vrf definition vrf-name.
Step 2. Initialize the appropriate address family by using the command address-family {ipv4 |
ipv6}. The address family can be IPv4, IPv6, or both.
Step 3. Enter interface configuration submode and specify the interface to be associated with the
VRF instance by using the command interface interface-id.
Step 4. Associate the VRF instance to the interface or subinterface by entering the command vrf
forwarding vrf-name under interface configuration submode.
Step 5. Configure an IP address (IPv4, IPv6, or both) on the interface or subinterface by entering
either or both of the following commands:
a. SW1
SW1(config)# vlan 10
SW1(config-vlan)# name Banking
SW1(config-vlan)# exit
SW1(config)# vlan 20
SW1(config-vlan)# name Employees
SW1(config-vlan)# exit
3 By Justin O. OLANGI
SW1(config)# interface g0/2
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 20
a. SW2
SW2(config)# vlan 10
SW2(config-vlan)# name Banking
SW2(config-vlan)# exit
SW2(config)# vlan 20
SW2(config-vlan)# name Employees
SW2(config-vlan)# exit
a. R1
R1(config)# vrf definition Banking
R1(config-vrf)# description SENSITIVE_TRAFFIC
R1(config-vrf)# address-family ipv4
R1(config-vrf-af)# address-family ipv6
4 By Justin O. OLANGI
R1(config)# interface g0/1
R1(config-if)# no shutdown
R1(config-if)# exit
5 By Justin O. OLANGI
b. R2
R2(config)# vrf definition Banking
R2(config-vrf)# description SENSITIVE_TRAFFIC
R2(config-vrf)# address-family ipv4
R2(config-vrf-af)# address-family ipv6
6 By Justin O. OLANGI
R2(config)# interface g0/0.20
R2(config-if)# description FOR_Employees
R2(config-if)# vrf forwarding Employees
R2(config-if)# encapsulation dot1q 20
R2(config-if)# ip address 10.177.2.2 255.255.255.0
R2(config-if)# ipv6 address 2001:db8:177:2::2/64
a. R1
R1(config)# ip route vrf Banking 10.77.10.0 255.255.255.0 10.177.1.2
R1(config)# ip route vrf Employees 10.77.20.0 255.255.255.0 10.177.2.2
R1(config)# ip route vrf MyRemote 10.77.44.0 255.255.255.0 10.177.4.2
b. R2
R2(config)# ip route vrf Banking 10.177.10.0 255.255.255.0 10.177.1.1
R2(config)# ip route vrf Employees 10.177.20.0 255.255.255.0 10.177.2.1
R2(config)# ip route vrf MyRemote 10.177.44.0 255.255.255.0 10.177.4.1
7 By Justin O. OLANGI
II.5 VRF Test
a. Show VRF
➢ R1
R1#show vrf
Name Default RD Protocols Interfaces
Banking <not set> ipv4,ipv6 Gi0/1.10
Gi0/0.10
Employees <not set> ipv4,ipv6 Gi0/1.20
Gi0/0.20
MyRemote <not set> ipv4,ipv6 Gi0/1.444
Gi0/0.444
➢ R2
R2#
R2#show vrf
Name Default RD Protocols Interfaces
Banking <not set> ipv4,ipv6 Gi0/1.10
Gi0/0.10
Employees <not set> ipv4,ipv6 Gi0/1.20
Gi0/0.20
MyRemote <not set> ipv4,ipv6 Gi0/1.444
Gi0/0.444
R2#
8 By Justin O. OLANGI
b. Show VRF Routing Table
➢ R2 IPv4
R2#
9 By Justin O. OLANGI
➢ R2 IPv6
C 2001:DB8:77:10::/64 [0/0]
via GigabitEthernet0/1.10, directly connected
L 2001:DB8:77:10::1/128 [0/0]
via GigabitEthernet0/1.10, receive
C 2001:DB8:177:1::/64 [0/0]
via GigabitEthernet0/0.10, directly connected
L 2001:DB8:177:1::2/128 [0/0]
via GigabitEthernet0/0.10, receive
S 2001:DB8:177:10::/64 [1/0]
via 2001:DB8:177:1::1
L FF00::/8 [0/0]
via Null0, receive
R2#
10 By Justin O. OLANGI
c. Ping between vPC by VRF
➢ User1 VRF Banking R1 to SRV1 VRF Banking R2
11 By Justin O. OLANGI
➢ User2 VRF Employees R1 to SRV2 VRF Employees R2
12 By Justin O. OLANGI