/*auto readmore*/ /*auto readmore*/ /* an hien script*/ // an hien password /*an hien ma chuong trinh cong tru */ /*Scrollbox thanh cuon*/ /***Nhung CODE***/ /* dòng xanh dòng trắng */ /* https://cdnjs.com/libraries/prism lay thu vien, can vao ten file ma goi 1. copy link vao vi du:prism-python.min.js 2. ten ngon nua la python */ /*=== New posts ===*/ /*header slider*/ /*=== bai viet lien quan===*/ /*===tabcode===*/

Cisco, Dynamic Multipoint VPN - DMVPN Phase 1 OSPF Routing

Giới thiệu: Trước đây chúng ta đã có chủ đề DMVPN Phase 1 căn bản để thiết lập tunnel giữa các site với nhau. Và trước đó chúng ta đã có chủ đề dùng EIGRP để quảng bá các loopback 0 của các router: R1, R2, R3, đảm bảo rằng các loopback 0 phải ping thấy nhau. Hôm nay chúng ta dùng giao thức OSPF để quảng bá các loopback 0 của các router.

Bài Lab

Các kiến thức sử dụng trong bài: cấu hình DMVPN Phase 1 căn bản, OSPF

1. Kiểm tra trước khi vào cấu hình dùng giao thức OSPF để quảng bá (sử dụng tiếp theo bài DMVPN Phase 1 căn bản)
R1#show dmvpn | begin 172.16.0.
     1 2.2.2.2              172.16.0.2    UP 02:19:26     D
     1 3.3.3.3              172.16.0.3    UP 01:55:56     D


R1#ping 172.16.0.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
R1#ping 172.16.0.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms

2. Sử dụng giao thức OSPF để quảng bá các loopback 0 của các router R1, R2, R3 thông qua DMVPN
  • Trước tiên với network type là POINT-TO-POINT của OSPF
!R1
router ospf 2
 network 172.16.0.0 0.0.0.255 area 2
 network 192.168.1.0 0.0.0.255 area 2
end

!R2
router ospf 2
 network 172.16.0.0 0.0.0.255 area 2
 network 192.168.2.0 0.0.0.255 area 2
end

!R3
router ospf 2
 network 172.16.0.0 0.0.0.255 area 2
 network 192.168.3.0 0.0.0.255 area 2
end

Ngay lập tức ta sẽ thấy thông báo  trên R1 như bên dưới:

!R1#
*Aug  2 05:57:15.499: %OSPF-5-ADJCHG: Process 2, Nbr 192.168.2.1 on Tunnel0 from EXCHANGE to DOWN, Neighbor Down: Adjacency forced to reset
*Aug  2 05:57:15.501: %OSPF-5-ADJCHG: Process 2, Nbr 192.168.3.1 on Tunnel0 from EXCHANGE to DOWN, Neighbor Down: Adjacency forced to reset

Vì network type mặt định của OSPF là point-to-point mà chúng ta cấu hình là multipoint, kiểm tra cấu hình trên R1 bằng lệnh show ip ospf interface tunnel 0 | include Network Type

!
R1#show ip ospf interface tunnel 0 | include Network Type
  Process ID 2, Router ID 192.168.1.1, Network Type POINT_TO_POINT, Cost: 1000
  • Để thiết lập được neighbor chúng ta phải chuyển network type trên cả ba router R1, R2, R3 là BROADCAST
!
interface tunnel 0
ip ospf network broadcast
end
!

Kiểm tra
R1#show ip ospf interface tunnel 0 | include Network Type
  Process ID 2, Router ID 192.168.1.1, Network Type BROADCAST, Cost: 1000

R2#show ip ospf interface tunnel 0 | include Network Type
  Process ID 2, Router ID 192.168.2.1, Network Type BROADCAST, Cost: 1000

R3#show ip ospf interface tunnel 0 | include Network Type 
  Process ID 2, Router ID 192.168.3.1, Network Type BROADCAST, Cost: 1000

Để đảm bảo cho R1 là DR và R2, R3 không tham gia bình cầu DR, BDR ta cần phải chỉnh priority  về giá trị 0 clear ip ospf 2 procees (trong bài lab ta có 2 Procees ID của OSPF, process 1 dùng trong việc quảng bá các IP public, procees 2 dùng quảng bá các interface loopback 0).

!R2, R3
interface tunnel 0
ip ospf priority 0
end
clear ip ospf 2 process

Kiểm tra
R1#show ip ospf 2 neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.2.1       0   FULL/DROTHER    00:00:31    172.16.0.2      Tunnel0
192.168.3.1       0   FULL/DROTHER    00:00:33    172.16.0.3      Tunnel0

R1#show ip route ospf 2
đã xóa 1 số dòng
Gateway of last resort is not set

      192.168.2.0/32 is subnetted, 1 subnets
O        192.168.2.1 [110/1001] via 172.16.0.2, 00:10:18, Tunnel0
      192.168.3.0/32 is subnetted, 1 subnets
O        192.168.3.1 [110/1001] via 172.16.0.3, 00:06:02, Tunnel0
R2#show ip route ospf 2
đã xóa 1 số dòng
Gateway of last resort is not set

      192.168.1.0/32 is subnetted, 1 subnets
O        192.168.1.1 [110/1001] via 172.16.0.1, 00:13:07, Tunnel0
      192.168.3.0/32 is subnetted, 1 subnets
O        192.168.3.1 [110/1001] via 172.16.0.3, 00:08:51, Tunnel0

R3#show ip route ospf 2
đã xóa 1 số dòng
Gateway of last resort is not set

      192.168.1.0/32 is subnetted, 1 subnets
O        192.168.1.1 [110/1001] via 172.16.0.1, 00:08:55, Tunnel0
      192.168.2.0/32 is subnetted, 1 subnets
O        192.168.2.1 [110/1001] via 172.16.0.2, 00:08:55, Tunnel0

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

R2#ping 192.168.3.1 source loopback 0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.2.1 
!!!!!

Success rate is 100 percent  (5/5), round-trip min/avg/max = 1/1/2 ms

R2#traceroute 192.168.3.1 source loopback 0
Type escape sequence to abort.
Tracing the route to 192.168.3.1
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.0.1 6 msec 6 msec 1 msec
  2 172.16.0.3 1 msec 7 msec * 

Các spoke có thể ping thấy nhau, nhưng khi traceroute ta thấy dữ liệu vẫn thông qua Hub, vì DMVPN phase 1 mọi dữ liệu đều phải thông qua Hub.

NON-BROADCAST
Non-broadcast hoạt động cũng giống broadcast chỉ khác là thiết lập neighbor là thiết lập tĩnh, chỉ cần cấu hình một bên là đủ.

!R1
interface tunnel 0
ip ospf network non-broadcast
exit
router ospf  2
neighbor 172.16.0.2
neighbor 172.16.0.3
end

!R2, R3
interface tunnel 0
ip ospf network non-broadcast
exit

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

R2#traceroute 192.168.3.1 source loopback 0
Type escape sequence to abort.
Tracing the route to 192.168.3.1
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.0.1 1 msec 1 msec 2 msec
  2 172.16.0.3 2 msec 2 msec * 

OK, các loopback 0 của các router spoke vẫn ping thấy nhau.

POINT-TO-MULTIPOINT
Không cần chỉnh priority của các các router spoke, chỉ chỉnh network type của Hub và spoke là point-to-multipoint

!R1, R2, R3
interface tunnel 0
 ip ospf network point-to-multipoint
end

Kiểm tra
R1#show ip ospf 2 neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.2.1       0   FULL/  -        00:01:57    172.16.0.2      Tunnel0

192.168.3.1       0   FULL/  -        00:01:48    172.16.0.3      Tunnel0

R1#show ip route ospf 2
đã xóa 1 số dòng
Gateway of last resort is not set
      172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
O        172.16.0.2/32 [110/1000] via 172.16.0.2, 00:03:57, Tunnel0
O        172.16.0.3/32 [110/1000] via 172.16.0.3, 00:03:57, Tunnel0
      192.168.2.0/32 is subnetted, 1 subnets
O        192.168.2.1 [110/1001] via 172.16.0.2, 00:03:57, Tunnel0
      192.168.3.0/32 is subnetted, 1 subnets
O        192.168.3.1 [110/1001] via 172.16.0.3, 00:03:57, Tunnel0

R2#show ip route ospf 2
đã xóa 1 số dòng
Gateway of last resort is not set
      172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
O        172.16.0.1/32 [110/1000] via 172.16.0.1, 00:04:21, Tunnel0
O        172.16.0.3/32 [110/2000] via 172.16.0.1, 00:04:21, Tunnel0
      192.168.1.0/32 is subnetted, 1 subnets
O        192.168.1.1 [110/1001] via 172.16.0.1, 00:04:21, Tunnel0
      192.168.3.0/32 is subnetted, 1 subnets
O        192.168.3.1 [110/2001] via 172.16.0.1, 00:04:21, Tunnel0

R3#show ip route ospf 2
đã xóa 1 số dòng
Gateway of last resort is not set
      172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
O        172.16.0.1/32 [110/1000] via 172.16.0.1, 00:05:01, Tunnel0
O        172.16.0.2/32 [110/2000] via 172.16.0.1, 00:04:51, Tunnel0
      192.168.1.0/32 is subnetted, 1 subnets
O        192.168.1.1 [110/1001] via 172.16.0.1, 00:05:01, Tunnel0
      192.168.2.0/32 is subnetted, 1 subnets
O        192.168.2.1 [110/2001] via 172.16.0.1, 00:04:51, Tunnel0

Thấy các router đều có bảng route đi đến loopback 0 của các router khác.

POINT-TO-MULTIPOINT NON-BROADCAST
Cũng có thể chọn network type là point-to-multipoint non-broadcast, mọi thứ đều giống nhau chỉ khác là ta chọn cách thiết lập neighbor là tĩnh

!R1, R2, R3
interface tunnel 0
 ip ospf network point-to-multipoint non-broadcast
end

!R1
router ospf 2
 neighbor 172.16.0.3
 neighbor 172.16.0.2
end

Kiểm tra
R1#show ip ospf 2 neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.2.1       0   FULL/  -        00:01:39    172.16.0.2      Tunnel0
192.168.3.1       0   FULL/  -        00:01:39    172.16.0.3      Tunnel0

R2#traceroute 192.168.3.1 source loopback 0
Type escape sequence to abort.
Tracing the route to 192.168.3.1
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.0.1 2 msec 1 msec 1 msec
  2 172.16.0.3 2 msec 2 msec * 

Nhận xét: Ta thấy mọi traffic của spoke đều phải thông qua Hub mà các spoke biết được, và có rất nhiều dòng route trỏ về spoke. Chúng ta sẽ tìm hiểu kỹ hơn trong phase 2, phase 3.

Xong!

No comments:

Post a Comment

/*header slide*/