Setting VRF Lite VLAN Cisco – GNS3 Lab19

Setting VRF Lite VLAN Cisco – GNS3 Lab19

  • R1 FastEthernet 0/0 : 172.1.1.1
  • R1 FastEthernet 0/1 : 172.1.2.1
  • R1 Loopback 0 : 7.7.7.7
  • R2 FastEthernet 1/0 : 172.1.1.2 – vrf cust1
  • R2 FastEthernet 1/1 : 172.1.2.2 – vrf cust2
  • R2 FastEthernet 0/1.10 : 192.168.10.2 – vlan 10 – vrf cust1
  • R2 FastEthernet 0/1.20 : 192.168.20.2 – vlan 10 – vrf cust2
  • SW1 FastEthernet 0/0 : mode trunk
  • SW1 FastEthernet 0/1 : mode access vlan 10
  • SW1 FastEthernet 0/1 : mode access vlan 20
  • R3 FastEthernet 0/0 : 192.168.10.1
  • R3 FastEthernet 0/1 : 10.10.10.1
  • R4 FastEthernet 0/0 : 192.168.20.1
  • R4 FastEthernet 0/1 : 20.20.20.1
  • PC1 : 10.10.10.2
  • PC2 : 20.20.20.2

Setting IP address

  • R1
R1# configure terminal
R1(config)# interface fastEthernet 0/0
R1(config-if)# ip address 172.1.1.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit

R1(config)# interface fastEthernet 0/1
R1(config-if)# ip address 172.1.2.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit

R1(config)# interface loopback 0
R1(config-if)# ip address 7.7.7.7 255.255.255.0
R1(config-if)# exit
  • R2
R2# configure terminal
R2(config)# ip vrf cust1
R2(config-vrf)# rd 101:10
R2(config-vrf)# exit
R2(config)# ip vrf cust2
R2(config-vrf)# rd 102:20
R2(config-vrf)# exit

R2(config)# interface fastEthernet 1/0
R2(config-if)# ip address 172.1.1.2 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# exit

R2(config)# interface fastEthernet 1/1
R2(config-if)# ip address 172.1.2.2 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# exit

R2(config)# interface fastEthernet 0/1
R2(config-if)# no shutdown
R2(config-if)# exit

R2(config)# interface fastEthernet 0/1.10
R2(config-subif)# encapsulation dot1Q 10
R2(config-subif)# ip vrf forwarding cust1
R2(config-subif)# ip address 192.168.10.2 255.255.255.0
R2(config-subif)# exit

R2(config)# interface fastEthernet 0/1.20
R2(config-subif)# encapsulation dot1Q 20
R2(config-subif)# ip vrf forwarding cust2
R2(config-subif)# ip address 192.168.20.2 255.255.255.0
R2(config-subif)# exit
  • SW1
SW1# vlan database
SW1(vlan)# vlan 10 name vlan10
SW1(vlan)# vlan 20 name vlan20
SW1(vlan)# exit

SW1# configure terminal
SW1(config)# interface fastEthernet 0/0
SW1(config-if)# switchport trunk encapsulation dot1q
SW1(config-if)# switchport mode trunk
SW1(config-if)# no shutdown
SW1(config-if)# exit

SW1(config)# interface fastEthernet 0/1
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 10
SW1(config-if)# no shutdown
SW1(config-if)# exit

SW1(config)# interface fastEthernet 0/2
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 20
SW1(config-if)# no shutdown
SW1(config-if)# exit
  • R3
R3# configure terminal
R3(config)# interface fastEthernet 0/0
R3(config-if)# ip address 192.168.10.1 255.255.255.0
R3(config-if)# no shutdown
R3(config-if)# exit

R3(config)# interface fastEthernet 0/1
R3(config-if)# ip address 10.10.10.1 255.255.255.0
R3(config-if)# no shutdown
R3(config-if)# exit
  • R4
R4# configure terminal
R4(config)# interface fastEthernet 0/0
R4(config-if)# ip address 192.168.20.1 255.255.255.0
R4(config-if)# no shutdown
R4(config-if)# exit

R4(config)# interface fastEthernet 0/1
R4(config-if)# ip address 20.20.20.1 255.255.255.0
R4(config-if)# no shutdown
R4(config-if)# exit

Setting OSPF

  • R1
R1# configure terminal
R1(config)# router ospf 1
R1(config-router)# router-id 7.7.7.7
R1(config-router)# network 7.7.7.0 0.0.0.255 area 1
R1(config-router)# network 172.1.1.0 0.0.0.255 area 1
R1(config-router)# network 172.1.2.0 0.0.0.255 area 1
R1(config-router)# exit
  • R2
R2# configure terminal
R2(config)# router ospf 1 vrf cust1
R2(config-router)# router-id 192.168.10.2
R2(config-router)# network 172.1.1.0 0.0.0.255 area 1
R2(config-router)# network 192.168.10.0 0.0.0.255 area 1
R2(config-router)# exit

R2(config)# router ospf 2 vrf cust2
R2(config-router)# router-id 192.168.20.2
R2(config-router)# network 172.1.2.0 0.0.0.255 area 1
R2(config-router)# network 192.168.20.0 0.0.0.255 area 1
R2(config-router)# exit
  • R3
R3# configure terminal
R3(config)# router ospf 1
R3(config-router)# router-id 10.10.10.1
R3(config-router)# network 10.10.10.0 0.0.0.255 area 1
R3(config-router)# network 192.168.10.0 0.0.0.255 area 1
R3(config-router)# exit
  • R4
R4# configure terminal
R4(config)# router ospf 1
R4(config-router)# router-id 20.20.20.1
R4(config-router)# network 20.20.20.0 0.0.0.255 area 1
R4(config-router)# network 192.168.20.0 0.0.0.255 area 1
R4(config-router)# exit

Verifikasi Routing Table

  • R1
R1# show 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
     20.0.0.0/24 is subnetted, 1 subnets
O       20.20.20.0 [110/3] via 172.1.2.2, 00:33:17, FastEthernet0/1
O    192.168.10.0/24 [110/2] via 172.1.1.2, 00:33:17, FastEthernet0/0
     172.1.0.0/24 is subnetted, 2 subnets
C       172.1.1.0 is directly connected, FastEthernet0/0
C       172.1.2.0 is directly connected, FastEthernet0/1
     7.0.0.0/24 is subnetted, 1 subnets
C       7.7.7.0 is directly connected, Loopback0
O    192.168.20.0/24 [110/2] via 172.1.2.2, 00:33:17, FastEthernet0/1
     10.0.0.0/24 is subnetted, 1 subnets
O       10.10.10.0 [110/3] via 172.1.1.2, 00:33:19, FastEthernet0/0

-----------------------------------------------------------------------------
R1# show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.20.2      1   FULL/BDR        00:00:37    172.1.2.2       FastEthernet0/1
192.168.10.2      1   FULL/BDR        00:00:34    172.1.1.2       FastEthernet0/0
  • R2
R2# show ip route
Codes: L - local, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

-----------------------------------------------------------------------------
R2# show ip route vrf cust1
Routing Table: cust1
Codes: L - local, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set
      7.0.0.0/32 is subnetted, 1 subnets
O        7.7.7.7 [110/2] via 172.1.1.1, 00:35:40, FastEthernet1/0
      10.0.0.0/24 is subnetted, 1 subnets
O        10.10.10.0 [110/2] via 192.168.10.1, 00:35:29, FastEthernet0/1.10
      20.0.0.0/24 is subnetted, 1 subnets
O        20.20.20.0 [110/4] via 172.1.1.1, 00:34:59, FastEthernet1/0
      172.1.0.0/16 is variably subnetted, 3 subnets, 2 masks
C        172.1.1.0/24 is directly connected, FastEthernet1/0
L        172.1.1.2/32 is directly connected, FastEthernet1/0
O        172.1.2.0/24 [110/2] via 172.1.1.1, 00:35:40, FastEthernet1/0
      192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.10.0/24 is directly connected, FastEthernet0/1.10
L        192.168.10.2/32 is directly connected, FastEthernet0/1.10
O     192.168.20.0/24 [110/3] via 172.1.1.1, 00:34:59, FastEthernet1/0

-----------------------------------------------------------------------------
R2# show ip route vrf cust2
Routing Table: cust2
Codes: L - local, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set
      7.0.0.0/32 is subnetted, 1 subnets
O        7.7.7.7 [110/2] via 172.1.2.1, 00:35:43, FastEthernet1/1
      10.0.0.0/24 is subnetted, 1 subnets
O        10.10.10.0 [110/4] via 172.1.2.1, 00:35:43, FastEthernet1/1
      20.0.0.0/24 is subnetted, 1 subnets
O        20.20.20.0 [110/2] via 192.168.20.1, 00:35:38, FastEthernet0/1.20
      172.1.0.0/16 is variably subnetted, 3 subnets, 2 masks
O        172.1.1.0/24 [110/2] via 172.1.2.1, 00:35:43, FastEthernet1/1
C        172.1.2.0/24 is directly connected, FastEthernet1/1
L        172.1.2.2/32 is directly connected, FastEthernet1/1
O     192.168.10.0/24 [110/3] via 172.1.2.1, 00:35:43, FastEthernet1/1
      192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.20.0/24 is directly connected, FastEthernet0/1.20
L        192.168.20.2/32 is directly connected, FastEthernet0/1.20

-----------------------------------------------------------------------------
R2# show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
20.20.20.1        1   FULL/DR         00:00:39    192.168.20.1    FastEthernet0/1.20
7.7.7.7           1   FULL/DR         00:00:39    172.1.2.1       FastEthernet1/1
10.10.10.1        1   FULL/DR         00:00:30    192.168.10.1    FastEthernet0/1.10
7.7.7.7           1   FULL/DR         00:00:39    172.1.1.1       FastEthernet1/0
  • R3
R3# show 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
     20.0.0.0/24 is subnetted, 1 subnets
O       20.20.20.0 [110/5] via 192.168.10.2, 00:38:43, FastEthernet0/0
C    192.168.10.0/24 is directly connected, FastEthernet0/0
     172.1.0.0/24 is subnetted, 2 subnets
O       172.1.1.0 [110/2] via 192.168.10.2, 00:38:43, FastEthernet0/0
O       172.1.2.0 [110/3] via 192.168.10.2, 00:38:43, FastEthernet0/0
     7.0.0.0/32 is subnetted, 1 subnets
O       7.7.7.7 [110/3] via 192.168.10.2, 00:38:43, FastEthernet0/0
O    192.168.20.0/24 [110/4] via 192.168.10.2, 00:38:45, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, FastEthernet0/1

-----------------------------------------------------------------------------
R3# show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.10.2      1   FULL/BDR        00:00:35    192.168.10.2    FastEthernet0/0
  • R4
R4# show 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
     20.0.0.0/24 is subnetted, 1 subnets
C       20.20.20.0 is directly connected, FastEthernet0/1
O    192.168.10.0/24 [110/4] via 192.168.20.2, 00:39:59, FastEthernet0/0
     172.1.0.0/24 is subnetted, 2 subnets
O       172.1.1.0 [110/3] via 192.168.20.2, 00:39:59, FastEthernet0/0
O       172.1.2.0 [110/2] via 192.168.20.2, 00:39:59, FastEthernet0/0
     7.0.0.0/32 is subnetted, 1 subnets
O       7.7.7.7 [110/3] via 192.168.20.2, 00:39:59, FastEthernet0/0
C    192.168.20.0/24 is directly connected, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
O       10.10.10.0 [110/5] via 192.168.20.2, 00:40:01, FastEthernet0/0

-----------------------------------------------------------------------------
R4# show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.20.2      1   FULL/BDR        00:00:35    192.168.20.2    FastEthernet0/0

Pengujian

  • R1
R1# ping 10.10.10.2 source loopback 0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.2, timeout is 2 seconds:
Packet sent with a source address of 7.7.7.7
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 72/76/80 ms

R1# ping 20.20.20.2 source loopback 0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.20.20.2, timeout is 2 seconds:
Packet sent with a source address of 7.7.7.7
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 64/72/80 ms
  • R2
R2# ping vrf cust1 10.10.10.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 36/48/72 ms

R2# ping vrf cust2 20.20.20.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.20.20.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 36/42/52 ms
  • PC1
PC1> ip 10.10.10.2/24 10.10.10.1
Checking for duplicate address...
PC1 : 10.10.10.2 255.255.255.0 gateway 10.10.10.1

PC1> show ip
NAME        : PC1[1]
IP/MASK     : 10.10.10.2/24
GATEWAY     : 10.10.10.1
DNS         :
MAC         : 00:50:79:66:68:01
LPORT       : 10008
RHOST:PORT  : 127.0.0.1:10010
MTU:        : 1500

PC1> ping 192.168.10.2
84 bytes from 192.168.10.2 icmp_seq=1 ttl=254 time=45.093 ms
84 bytes from 192.168.10.2 icmp_seq=2 ttl=254 time=45.147 ms
84 bytes from 192.168.10.2 icmp_seq=3 ttl=254 time=45.289 ms
84 bytes from 192.168.10.2 icmp_seq=4 ttl=254 time=45.094 ms
84 bytes from 192.168.10.2 icmp_seq=5 ttl=254 time=44.949 ms

PC1> ping 7.7.7.7
84 bytes from 7.7.7.7 icmp_seq=1 ttl=253 time=75.680 ms
84 bytes from 7.7.7.7 icmp_seq=2 ttl=253 time=74.881 ms
84 bytes from 7.7.7.7 icmp_seq=3 ttl=253 time=75.087 ms
84 bytes from 7.7.7.7 icmp_seq=4 ttl=253 time=74.990 ms
84 bytes from 7.7.7.7 icmp_seq=5 ttl=253 time=74.958 ms
  • PC2
PC2> ip 20.20.20.2/24 20.20.20.1
Checking for duplicate address...
PC1 : 20.20.20.2 255.255.255.0 gateway 20.20.20.1

PC2> show ip
NAME        : PC2[1]
IP/MASK     : 20.20.20.2/24
GATEWAY     : 20.20.20.1
DNS         :
MAC         : 00:50:79:66:68:00
LPORT       : 10002
RHOST:PORT  : 127.0.0.1:10004
MTU:        : 1500

PC2> ping 192.168.20.2
84 bytes from 192.168.20.2 icmp_seq=1 ttl=254 time=44.536 ms
84 bytes from 192.168.20.2 icmp_seq=2 ttl=254 time=45.163 ms
84 bytes from 192.168.20.2 icmp_seq=3 ttl=254 time=45.121 ms
84 bytes from 192.168.20.2 icmp_seq=4 ttl=254 time=45.124 ms
84 bytes from 192.168.20.2 icmp_seq=5 ttl=254 time=45.054 ms

PC2> ping 7.7.7.7
84 bytes from 7.7.7.7 icmp_seq=1 ttl=253 time=74.994 ms
84 bytes from 7.7.7.7 icmp_seq=2 ttl=253 time=75.095 ms
84 bytes from 7.7.7.7 icmp_seq=3 ttl=253 time=75.214 ms
84 bytes from 7.7.7.7 icmp_seq=4 ttl=253 time=75.120 ms
84 bytes from 7.7.7.7 icmp_seq=5 ttl=253 time=75.853 ms

herdiana3389

A system administrator with skills in system administration, virtualization, linux, windows, networking, cloud computing, container, etc.