In this tutorial , I will cover vrf(virtual routing and forwarding) implementation and verification in static and dynamic routing.
TOPOLOGY
■STATIC router CONFIG
interface Loopback0
ip address 10.1.1.1 255.255.255.0
!
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0
duplex auto
speed auto
ip route 0.0.0.0 0.0.0.0 192.168.1.1
■RIP router CONFIG
interface Loopback0
ip address 40.40.40.40 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0
duplex auto
speed auto
!
router rip
network 40.0.0.0
network 192.168.1.0
■EIGRP router CONFIG
interface Loopback0
ip address 30.30.30.30 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0
duplex auto
speed auto
!
router eigrp 1
network 30.0.0.0
network 192.168.1.0
■OSPF router CONFIG
interface Loopback0
ip address 20.20.20.20 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 0.0.0.0 255.255.255.255 area 0
■R1 CONFIG
ip vrf EIGRP
!
ip vrf OSPF
!
ip vrf RIP
!
ip vrf STATIC
!
interface Loopback1
ip vrf forwarding RIP
ip address 1.1.1.1 255.255.255.255
!
interface Loopback2
ip vrf forwarding EIGRP
ip address 2.2.2.2 255.255.255.255
!
interface Loopback3
ip vrf forwarding OSPF
ip address 3.3.3.3 255.255.255.255
!
interface Loopback4
ip vrf forwarding STATIC
ip address 4.4.4.4 255.255.255.255
!
interface FastEthernet0/3
no switchport
ip vrf forwarding OSPF
ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet1/0
ip vrf forwarding EIGRP
ip address 192.168.1.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet2/0
ip vrf forwarding STATIC
ip address 192.168.1.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet3/0
ip vrf forwarding RIP
ip address 192.168.1.1 255.255.255.0
duplex auto
speed auto
!
router eigrp 1
auto-summary
!
address-family ipv4 vrf EIGRP
network 2.0.0.0
network 192.168.1.0
auto-summary
autonomous-system 1
exit-address-family
!
router ospf 1 vrf OSPF
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 192.168.1.1 0.0.0.0 area 0
!
router rip
!
address-family ipv4 vrf RIP
network 1.0.0.0
network 192.168.1.0
no auto-summary
exit-address-family
!
ip route vrf STATIC 10.1.1.1 255.255.255.255 192.168.1.2
!
VERIFICATION
■
Verification on R1
***** STATIC
R1#sh ip route vrf STATIC
Routing Table: STATIC
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
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback4
10.0.0.0/32 is subnetted, 1 subnets
S 10.1.1.1 [1/0] via 192.168.1.2
C 192.168.1.0/24 is directly connected, FastEthernet2/0
R1#ping vrf STATIC 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/49/128 ms
R1#
**** RIP
R1#sh ip route vrf RIP
Routing Table: RIP
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
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback1
R 40.0.0.0/8 [120/1] via 192.168.1.2, 00:00:26, FastEthernet3/0
C 192.168.1.0/24 is directly connected, FastEthernet3/0
R1#
R1#
R1#ping vrf RIP 40.40.40.40
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 40.40.40.40, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/30/88 ms
R1#
**** EIGRP
R1#sh ip route vrf EIGRP
Routing Table: EIGRP
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
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 2.2.2.2/32 is directly connected, Loopback2
D 2.0.0.0/8 is a summary, 00:32:30, Null0
C 192.168.1.0/24 is directly connected, FastEthernet1/0
D 30.0.0.0/8 [90/156160] via 192.168.1.2, 00:32:17, FastEthernet1/0
R1#
R1#ping vrf EIGRP 30.30.30.30
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 30.30.30.30, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/43/100 ms
R1#
**** OSPF
R1#sh ip route vrf OSPF
Routing Table: OSPF
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
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback3
20.0.0.0/32 is subnetted, 1 subnets
O 20.20.20.20 [110/2] via 192.168.1.2, 00:49:42, FastEthernet0/3
C 192.168.1.0/24 is directly connected, FastEthernet0/3
R1#
R1#ping vrf OSPF 20.20.20.20
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.20.20.20, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/52/100 ms
R1#
■
Verification on STATIC router
STATIC#sh ip route
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 192.168.1.1 to network 0.0.0.0
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
S* 0.0.0.0/0 [1/0] via 192.168.1.1
STATIC#ping 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/60/116 ms
STATIC#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
STATIC#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
STATIC#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
STATIC#
■
Verification on RIP router
RIP#sh ip route
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
R 1.0.0.0/8 [120/1] via 192.168.1.1, 00:00:17, FastEthernet0/0
40.0.0.0/32 is subnetted, 1 subnets
C 40.40.40.40 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
RIP#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/49/100 ms
RIP#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
RIP#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
RIP#ping 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
RIP#
■
Verification on EIGRP router
EIGRP#sh ip route
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
D 2.0.0.0/8 [90/156160] via 192.168.1.1, 00:37:00, FastEthernet0/0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
30.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 30.30.30.30/32 is directly connected, Loopback0
D 30.0.0.0/8 is a summary, 00:43:47, Null0
EIGRP#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
EIGRP#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/43/108 ms
EIGRP#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
EIGRP#ping 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
EIGRP#
■
Verification on OSPF router
OSPF#sh ip route
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
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 192.168.1.1, 00:55:35, FastEthernet0/0
20.0.0.0/32 is subnetted, 1 subnets
C 20.20.20.20 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
OSPF#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
OSPF#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
OSPF#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/55/152 ms
OSPF#ping 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
OSPF#
OTHER VERIFICATION COMMANDS
- sh ip vrf [ interfaces | brief ]
- sh ip eigrp vrf EIGRP neigh
- sh ip ospf nei
- sh ip rip nei