拓撲圖:服務器
1、理論篇:
網絡
動態多點×××(DM×××)是一個高擴展性的IPSec ×××技術。適合企業級的大規模部署,例如:一個大型連鎖企業有上百個連鎖店是很正常的!爲什麼傳統技術的2種IPSec ×××(1.星形拓撲 2. 網狀模型)不適合呢?socket
1. 星形拓撲IPSec ×××缺點:ide
(1)中心站點配置量大oop
不論是經典配置,仍是GRE Over IPSec或者SVI,多一個分支站點,則多一份配置,若是有不少分支站點,那麼配置就會成爲沉重的負擔,而且管理也成爲問題。學習
(2)分支站點間流量延時較大測試
一個分支站點的數據到另一個分支站點,首先加密再送往中心,數據在中心站點被第1次解密,查看路由判斷出隧道,而後在中心站點被第2次加密,而且送往目的站點。目的站點收到數據後,再進行第2次解密。概括:2次加密,2次解密!優化
(3)分支站點間流量佔用中心帶寬加密
星形拓撲的分支站點間的全部流量,都要通過中心站點來進行轉發!若分支站點間的流量過大時,會大大消耗掉中心站點的帶寬。spa
由上可知,星形拓撲的傳統IPSec ×××,顯然不適合在有大量分支機構/站點的大型企業網絡中部署!!!
2. 網狀拓撲IPSec ×××缺點:
(1)中心與分支站點配置量大
不論是經典配置,仍是GRE Over IPSec或者SVI,多一個分支站點,則全部站點都要多一份配置,若是有不少分支站點,那麼使用網狀拓撲的IPSec ×××,呵呵……
(2)分支站點須要維護過多IPSec SA
分支站點要與每個其它站點創建IPSec SA ,若許多站點呢,則每個分支站點就會維護不少的IPSec SA ,實狀況中,分支站點的路由器使用的低端的多。而低端路由器的內存和CPU怎能扛得起啊!
(3)每個分支站點需固定IP地址
兩兩站點間需創建IPSec ××× ,故每個分支站點都需固定IP地址。現實中難以實現,由於大多數分支站點可能會經過低廉的ADSL接入且爲動態的公網IP地址。
正由於思科公司看到傳統IPSec ×××的星形和網狀拓撲的「硬傷」----存在高擴展性問題,因而提出了高擴展性的DM×××(動態多點×××)。
3. 動態多點DM×××與傳統的IPSec ×××技術相較,優勢有:
(1)簡單的星形拓撲配置,提供了虛擬網狀連通性;
(2)分支站點支持動態獲取IP地址;
(3)增長新的分支站點,而無需更改中心站點的配置;
(4)分支站點到分支站點動態產生隧道。
4.動態多點×××(DM×××)的四大協議:
(1)動態多點GRE(Multiple GRE,MGRE)
GRE是通用路由協議封裝,MGRE是一種特殊的GRE技術,是一個典型NBMA網絡。MGRE即任何一個分支站點不只僅可以和中心站點通信,並且還能直接和其它分支站點進行通信。即動態多點DM×××的第1個優勢:虛擬網狀連通性。
(2)下一跳解析協議(Next Hop Resolution Protocol,NHRP)
即便配置了MGRE隧道,全部站點也不能直接進行通信!在以太網中,IP地址爲邏輯地址,MAC地址纔是物理地址。在MGRE網絡中,須要映射邏輯地址到物理地址,MGRE隧道的虛擬地址就是邏輯地址,站點獲取的公網IP地址,就是物理地址。NHRP下一跳解析協議就是爲此而「生」!
①每個分支站點都需手動映射中心站點的虛擬IP到公網IP地址,故中心站點必須是固定IP地址;
②分支站點有了手動映射的中心站點的虛擬IP到公網IP地址,就是可與中心站點通信,而且經過NHRP協議,註冊此分支站點的隧道虛擬IP到動態獲取的公網IP地址,註冊成功後,則中心站點就有全部分支站點的NHRP映射表,這樣中心站點能夠訪問全部註冊的分支站點。分支站點間訪問時,先使用NHRP協議去詢問中心站點(NHRP服務器),目的分支站點隧道虛擬IP所對應的公網IP,中心站點回送NHRP映射給發起方,發起方有了目的站點的NHRP映射後,就能經過MGRE直接發起隧道訪問目的站點,而這個流量是兩個分支站點間直接發起的,並不佔用中心站點的資源。此點而言,DM×××技術是高擴展性的技術。
(3)動態路由協議
動態路由協議的主要目的是宣告隧道接口網絡和站點後的私有網絡。大多數動態路由協議都使用組播來傳輸路由更新信息。可是MGRE隧道是典型的NBMA網絡,不支持直接承載的組播信息,故需配置組播映射,將組播轉換爲單播。因僅中心站點是固定IP地址,故默認只有能配置分支站點和中心站之間的組播映射。因爲組播映射的特色,因此動態路由協議的鄰居關係,僅會出如今分支站點與中心站點之間,分支站點間不存在組播映射,且分支站點間的隧道是動態創建的,故不存在動態路由協議的鄰居關係。
MGRE支持的路由協議有:RIP、EIGRP、OSPF、ODR和BGP。
(4)IPSec技術
也能夠把DM×××理解爲MGRE Over IPSec ,IPSec實質是對MGRE流量加密。MGRE是一種特殊的GRE技術,可是協議號依然是GRE的47 。配置和GRE Over IPSec同樣!
DM×××和GRE Over IPSec同樣也就是傳輸模式封裝。
2、實戰篇:
一、基本配置:
1)在中心站點路由器Center上的基本配置:
Center(config)#int loopback 0
Center(config-if)#ip add 192.168.100.1 255.255.255.0
Center(config-if)#exit
Center(config)#int e0/0
Center(config-if)#ip add 202.100.1.100 255.255.255.0
Center(config-if)#no sh
2)在分支站點路由器Branch1上的基本配置:
Branch1(config)#int lo0
Branch1(config-if)#ip add 192.168.1.1 255.255.255.0
Branch1(config-if)#exit
Branch1(config)#int e0/1
Branch1(config-if)#ip add 202.100.1.1 255.255.255.0
Branch1(config-if)#no sh
3)在分支站點路由器Branch2上的基本配置:
Branch2(config)#int lo0
Branch2(config-if)#ip add 192.168.2.1 255.255.255.0
Branch2(config-if)#exit
Branch2(config)#int e0/1
Branch2(config-if)#ip add 202.100.1.2 255.255.255.0
Branch2(config-if)#no sh
二、MGRE配置:
1)在中心站點路由器Center上的基本配置:
Center(config)#int tunnel 0
Center(config-if)#ip add 172.16.1.100 255.255.255.0
Center(config-if)#tunnel mode gre multipoint
Center(config-if)#tunnel source e0/0
Center(config-if)#tunnel key 56789
2)在分支站點路由器Branch1上的基本配置:
Branch1(config)#int tunnel 0
Branch1(config-if)#ip add 172.16.1.1 255.255.255.0
Branch1(config-if)#tunnel mode gre multipoint
Branch1(config-if)#tunnel source e0/1
Branch1(config-if)#tunnel key 56789
3)在分支站點路由器Branch2上的基本配置:
Branch2(config)#int tunnel 0
Branch2(config-if)#ip add 172.16.1.2 255.255.255.0
Branch2(config-if)#tunnel mode gre multipoint
Branch2(config-if)#tunnel source e0/1
Branch2(config-if)#tunnel key 56789
三、NHRP配置:
1)在中心站點路由器Center上的基本配置:
Center(config)#int tunnel 0
Center(config-if)#ip nhrp network-id 10
Center(config-if)#ip nhrp authentication A1s2#
Center(config-if)#ip nhrp map multicast dynamic
2)在分支站點路由器Branch1上的基本配置:
Branch1(config)#int tunnel 0
Branch1(config-if)#ip nhrp network-id 10
Branch1(config-if)#ip nhrp nhs 172.16.1.100
Branch1(config-if)#ip nhrp map 172.16.1.100 202.100.1.100
Branch1(config-if)#ip nhrp authentication A1s2#
Branch1(config-if)#ip nhrp map multicast 202.100.1.100
3)在分支站點路由器Branch2上的基本配置:
Branch2(config)#int tunnel 0
Branch2(config-if)#ip nhrp network-id 10
Branch2(config-if)#ip nhrp authentication A1s2#
Branch2(config-if)#ip nhrp map 172.16.1.100 202.100.1.100
Branch2(config-if)#ip nhrp map multicast 202.100.1.100
Branch2(config-if)#ip nhrp nhs 172.16.1.100
四、測試NHRP
1)在中心站點路由器Center上的測試:
Center#sh ip nhrp
172.16.1.1/32 via 172.16.1.1
Tunnel0 created 00:17:19, expire 01:42:40
Type: dynamic, Flags: unique registered //註冊動態獲取的映射信息
NBMA address: 202.100.1.1 //映射Branch1的vir的IP172.16.1.1到公網IP地址202.100.1.1
172.16.1.2/32 via 172.16.1.2
Tunnel0 created 00:02:31, expire 01:57:28
Type: dynamic, Flags: unique registered
NBMA address: 202.100.1.2 //映射Branch2的vir的IP172.16.1.2到公網IP地址202.100.1.2
2)在分支站點路由器Branch1上的測試:
Branch1#sh ip nhrp
172.16.1.100/32 via 172.16.1.100
Tunnel0 created 00:36:14, never expire
Type: static, Flags: used //靜態的NHRP映射
NBMA address: 202.100.1.100 //映射Center的vir的IP172.16.1.100到公網IP地址202.100.1.100
//在Branch1上 ping Branch2的虛擬IP 172.16.1.2
Branch1#ping 172.16.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/11/39 ms
Branch1#sh ip nhrp
172.16.1.1/32 via 172.16.1.1
Tunnel0 created 00:04:23, expire 01:55:36
Type: dynamic, Flags: router unique local
NBMA address: 202.100.1.1
(no-socket)
172.16.1.2/32 via 172.16.1.2
Tunnel0 created 00:04:23, expire 01:55:36
Type: dynamic, Flags: router
NBMA address: 202.100.1.2
172.16.1.100/32 via 172.16.1.100
Tunnel0 created 00:50:22, never expire
Type: static, Flags: used
NBMA address: 202.100.1.100
Branch1#
五、動態路由協議的配置:
1)在中心站點路由器Center上的動態路由協議配置:
Center(config)#router eigrp 100
Center(config-router)#no auto-summary
Center(config-router)#network 172.16.1.0 0.0.0.255
Center(config-router)#network 192.168.100.0 0.0.0.255
2)在分支站點路由器Branch1上的動態路由協議配置:
Branch1(config)#router eigrp 100
Branch1(config-router)#no auto-summary
Branch1(config-router)#network 172.16.1.0 0.0.0.255
Branch1(config-router)#network 192.168.1.0 0.0.0.255
3)在分支站點路由器Branch2上的動態路由協議配置:
Branch2(config)#router eigrp 100
Branch2(config-router)#no auto-summary
Branch2(config-router)#network 172.16.1.0 0.0.0.255
Branch2(config-router)#network 192.168.2.0 0.0.0.255
六、測試與調整EIGRP:
1)查看Center EIGRP鄰居關係:
Center#sh ip eigrp neighbors
EIGRP-IPv4 Neighbors for AS(100)
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 172.16.1.1 Tu0 12 00:00:07 1 4500 1 0
1 172.16.1.2 Tu0 13 00:05:40 5 1428 0 4
Center#
由上可知,中心站點和全部分支站點皆有鄰居關係!
//查看Center經過EIGRP學習到的路由
Center#sh ip route eigrp
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
D 192.168.1.0/24 [90/27008000] via 172.16.1.1, 00:04:55, Tunnel0
D 192.168.2.0/24 [90/27008000] via 172.16.1.2, 00:03:08, Tunnel0
Center#
由上可知,Center站點經過動態路協議eigrp已經學習到全部分支站點( Branch1和Branch2)內部網絡的路由。
2)查看Branch1 EIGRP鄰居關係:
Branch1#sh ip eigrp neighbors
EIGRP-IPv4 Neighbors for AS(100)
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 172.16.1.100 Tu0 14 00:17:26 14 1470 0 6
Branch1#
由上可知,分支站點只會與中心站點創建動態路由協議的鄰居關係,分支站點間沒有鄰居關係!
//查看Branch1經過EIGRP學習到的路由
Branch1#sh ip route eigrp
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
D 192.168.100.0/24 [90/27008000] via 172.16.1.100, 00:27:05, Tunnel0
Branch1#
注:因爲動態路由協議水平分割,分支站點只能學習到中心站點(Center)內部網絡的路由!
水平分割:是一種避免路由環的出現和加快路由匯聚的技術。通俗講,把信息從收到它的方向發送回去沒有任何意義。
咱們想實現,分支站點經過動態路由協議,能學習到其它分支站點內部路由,只需在中心站點center的隧道接口上關閉水平分割。以下所示:
Center(config)#int tunnel 0
Center(config-if)#no ip split-horizon eigrp 100
Center(config-if)#
//關閉水平分割後,再在Branch1上查看經過EIGRP學習到的路由
Branch1#sh ip route eigrp
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
D 192.168.2.0/24 [90/28288000] via 172.16.1.100, 00:04:13, Tunnel0
D 192.168.100.0/24 [90/27008000] via 172.16.1.100, 00:53:08, Tunnel0
Branch1#
由上可知,雖然學習到了Branch2內部網絡192.168.2.0/24 的路由,可是下一跳是中心站點172.16.1.100,爲了不「(2)分支站點間流量延時較大,(3)分支站點間流量佔用中心帶寬」,咱們但願Branch1下一跳是172.16.1.2(即Branch2的虛擬隧道IP),同理Branch2下一跳是172.16.1.1(即Branch1的虛擬隧道IP) !咱們只需在中心站點Center上配置以下所示:
Center(config)#int tunnel 0
Center(config-if)#no ip next-hop-self eigrp 100
Center(config-if)#
//到Branch1和Branch2上,驗證下一跳分別是172.16.1.一、172.16.1.2
Branch1#sh ip route eigrp
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
D 192.168.2.0/24 [90/28288000] via 172.16.1.2, 00:00:54, Tunnel0
D 192.168.100.0/24 [90/27008000] via 172.16.1.100, 00:00:54, Tunnel0
Branch1#
Branch2#sh ip route eigrp
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
D 192.168.1.0/24 [90/28288000] via 172.16.1.1, 00:04:20, Tunnel0
D 192.168.100.0/24 [90/27008000] via 172.16.1.100, 00:04:20, Tunnel0
Branch2#
由上可知,Center路由優化後,達到了預期效果!
七、配置IPSec ×××:
1)在中心站點路由器Center上的配置:
Center(config)#crypto isakmp policy 10
Center(config-isakmp)#authentication pre-share
Center(config-isakmp)#hash md5
Center(config-isakmp)#encryption des
Center(config-isakmp)#exit
Center(config)#crypto isakmp key 0 A1s2# address 0.0.0.0 0.0.0.0
Center(config)#crypto ipsec transform-set beyond esp-des esp-md5-hmac
Center(cfg-crypto-trans)#mode transport
Center(cfg-crypto-trans)#exit
Center(config)#crypto ipsec profile dm***-profile
Center(ipsec-profile)#set transform-set beyond
Center(ipsec-profile)#int tunnel 0
Center(config-if)#ip mtu 1400
Center(config-if)#tunnel protection ipsec profile dm***-profile
2)在分支站點路由器Branch1上的配置:
Branch1(config)#crypto isakmp policy 10
Branch1(config-isakmp)#authentication pre-share
Branch1(config-isakmp)#hash md5
Branch1(config-isakmp)#encryption des
Branch1(config-isakmp)#exit
Branch1(config)#crypto isakmp key 0 A1s2# address 0.0.0.0 0.0.0.0
Branch1(config)#crypto ipsec transform-set beyond esp-des esp-md5-hmac
Branch1(cfg-crypto-trans)#mode transport
Branch1(cfg-crypto-trans)#exit
Branch1(config)#crypto ipsec profile dm***-profile
Branch1(ipsec-profile)#set transform-set beyond
Branch1(ipsec-profile)#exit
Branch1(config)#int tunnel 0
Branch1(config-if)#ip mtu 1400
Branch1(config-if)#tunnel protection ipsec profile dm***-profile
2)在分支站點路由器Branch2上的配置:
Branch2(config)#crypto isakmp policy 10
Branch2(config-isakmp)#authentication pre-share
Branch2(config-isakmp)#hash md5
Branch2(config-isakmp)#encryption des
Branch2(config-isakmp)#exit
Branch2(config)#crypto isakmp key 0 A1s2# address 0.0.0.0 0.0.0.0
Branch2(config)#crypto ipsec transform-set esp-des esp-md5-hmac
Proposal with ESP is missing cipher
Branch2(config)#crypto ipsec transform-set beyond esp-des esp-md5-hmac
Branch2(cfg-crypto-trans)#mode transport
Branch2(cfg-crypto-trans)#exit
Branch2(config)#crypto ipsec profile dm***-profile
Branch2(ipsec-profile)#set transform-set beyond
Branch2(ipsec-profile)#exit
Branch2(config)#int tunnel 0
Branch2(config-if)#ip mtu 1400
Branch2(config-if)#tunnel protection ipsec profile dm***-profile
Branch2(config-if)#
八、查看DM×××狀態:
//查看Center上的IPSec SA狀態
Center#sh crypto ipsec sa
interface: Tunnel0
Crypto map tag: Tunnel0-head-0, local addr 202.100.1.100
protected vrf: (none) //下面是中心站點Center和分支站點Branch1之間的IPSec SA
local ident (addr/mask/prot/port): (202.100.1.100/255.255.255.255/47/0)
remote ident (addr/mask/prot/port): (202.100.1.1/255.255.255.255/47/0)
current_peer 202.100.1.1 port 500
PERMIT, flags={origin_is_acl,}
#pkts encaps: 1053, #pkts encrypt: 1053, #pkts digest: 1053
#pkts decaps: 1047, #pkts decrypt: 1047, #pkts verify: 1047
#pkts compressed: 0, #pkts decompressed: 0
#pkts not compressed: 0, #pkts compr. failed: 0
#pkts not decompressed: 0, #pkts decompress failed: 0
#send errors 0, #recv errors 0
local crypto endpt.: 202.100.1.100, remote crypto endpt.: 202.100.1.1
path mtu 1500, ip mtu 1500, ip mtu idb Ethernet0/0
current outbound spi: 0xCB899A35(3414792757)
PFS (Y/N): Y, DH group: none
inbound esp sas:
spi: 0xCC487620(3427300896)
transform: esp-des esp-md5-hmac ,
in use settings ={Transport, }
conn id: 1, flow_id: SW:1, sibling_flags 80000000, crypto map: Tunnel0-head-0
sa timing: remaining key lifetime (k/sec): (4327025/1208)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE(ACTIVE)
inbound ah sas:
inbound pcp sas:
outbound esp sas:
spi: 0xCB899A35(3414792757)
transform: esp-des esp-md5-hmac ,
in use settings ={Transport, }
conn id: 2, flow_id: SW:2, sibling_flags 80000000, crypto map: Tunnel0-head-0
sa timing: remaining key lifetime (k/sec): (4327024/1208)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE(ACTIVE)
outbound ah sas:
outbound pcp sas:
protected vrf: (none) //下面是中心站點Center和分支站點Branch2之間的IPSec SA
local ident (addr/mask/prot/port): (202.100.1.100/255.255.255.255/47/0)
remote ident (addr/mask/prot/port): (202.100.1.2/255.255.255.255/47/0)
current_peer 202.100.1.2 port 500
PERMIT, flags={origin_is_acl,}
#pkts encaps: 395, #pkts encrypt: 395, #pkts digest: 395
#pkts decaps: 785, #pkts decrypt: 785, #pkts verify: 785
#pkts compressed: 0, #pkts decompressed: 0
#pkts not compressed: 0, #pkts compr. failed: 0
#pkts not decompressed: 0, #pkts decompress failed: 0
#send errors 0, #recv errors 0
local crypto endpt.: 202.100.1.100, remote crypto endpt.: 202.100.1.2
path mtu 1500, ip mtu 1500, ip mtu idb Ethernet0/0
current outbound spi: 0xA384E40A(2743395338)
PFS (Y/N): Y, DH group: none
inbound esp sas:
spi: 0xA89C29E8(2828806632)
transform: esp-des esp-md5-hmac ,
in use settings ={Transport, }
conn id: 3, flow_id: SW:3, sibling_flags 80000000, crypto map: Tunnel0-head-0
sa timing: remaining key lifetime (k/sec): (4198641/1812)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE(ACTIVE)
inbound ah sas:
inbound pcp sas:
outbound esp sas:
spi: 0xA384E40A(2743395338)
transform: esp-des esp-md5-hmac ,
in use settings ={Transport, }
conn id: 4, flow_id: SW:4, sibling_flags 80000000, crypto map: Tunnel0-head-0
sa timing: remaining key lifetime (k/sec): (4198686/1812)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE(ACTIVE)
outbound ah sas:
outbound pcp sas:
Center#
由上可知,中心站點Center和分支站點之間的隧道是永恆創建的,只要分支站點在線隧道就存在!
//查看Branch1上的IPSec SA狀態
Branch1#sh crypto ipsec sa
interface: Tunnel0
Crypto map tag: Tunnel0-head-0, local addr 202.100.1.1
protected vrf: (none) //正常狀況分支站點只有與中心站點創建的永恆隧道!
local ident (addr/mask/prot/port): (202.100.1.1/255.255.255.255/47/0)
remote ident (addr/mask/prot/port): (202.100.1.100/255.255.255.255/47/0)
current_peer 202.100.1.100 port 500
PERMIT, flags={origin_is_acl,}
#pkts encaps: 2615, #pkts encrypt: 2615, #pkts digest: 2615
#pkts decaps: 2625, #pkts decrypt: 2625, #pkts verify: 2625
#pkts compressed: 0, #pkts decompressed: 0
#pkts not compressed: 0, #pkts compr. failed: 0
#pkts not decompressed: 0, #pkts decompress failed: 0
#send errors 0, #recv errors 0
local crypto endpt.: 202.100.1.1, remote crypto endpt.: 202.100.1.100
path mtu 1500, ip mtu 1500, ip mtu idb Ethernet0/1
current outbound spi: 0xA5B32F71(2779983729)
PFS (Y/N): Y, DH group: none
inbound esp sas:
spi: 0xCED2B7A0(3469916064)
transform: esp-des esp-md5-hmac ,
in use settings ={Transport, }
conn id: 5, flow_id: SW:5, sibling_flags 80000000, crypto map: Tunnel0-head-0
sa timing: remaining key lifetime (k/sec): (4191198/1058)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE(ACTIVE)
inbound ah sas:
inbound pcp sas:
outbound esp sas:
spi: 0xA5B32F71(2779983729)
transform: esp-des esp-md5-hmac ,
in use settings ={Transport, }
conn id: 6, flow_id: SW:6, sibling_flags 80000000, crypto map: Tunnel0-head-0
sa timing: remaining key lifetime (k/sec): (4191199/1058)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE(ACTIVE)
outbound ah sas:
outbound pcp sas:
Branch1#
//在Branch1上ping Branch2的內部網絡IP地址,來觸發分支站點間的流量
Branch1#ping 192.168.2.1 source 192.168.1.1 repeat 100
Type escape sequence to abort.
Sending 100, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 3/9/41 ms
Branch1#
//查看Branch1上的IPSec SA狀態
Branch1#sh cry ipsec sa
interface: Tunnel0
Crypto map tag: Tunnel0-head-0, local addr 202.100.1.1
protected vrf: (none) //下面沒有分支站點和中心站點間IPSec SA信息
local ident (addr/mask/prot/port): (202.100.1.1/255.255.255.255/47/0)
remote ident (addr/mask/prot/port): (202.100.1.2/255.255.255.255/47/0)
current_peer 202.100.1.2 port 500
PERMIT, flags={origin_is_acl,} //下面2行是加密解密的數量不足100個,代表DM×××的零丟包特性,前幾個包是由中心代轉
#pkts encaps: 90, #pkts encrypt: 90, #pkts digest: 90
#pkts decaps: 91, #pkts decrypt: 91, #pkts verify: 91
#pkts compressed: 0, #pkts decompressed: 0
#pkts not compressed: 0, #pkts compr. failed: 0
#pkts not decompressed: 0, #pkts decompress failed: 0
#send errors 0, #recv errors 0
local crypto endpt.: 202.100.1.1, remote crypto endpt.: 202.100.1.2
path mtu 1500, ip mtu 1500, ip mtu idb Ethernet0/1
current outbound spi: 0xA68B326(174633766)
PFS (Y/N): Y, DH group: none
inbound esp sas:
spi: 0x7214CBE5(1913965541)
transform: esp-des esp-md5-hmac ,
in use settings ={Transport, }
conn id: 7, flow_id: SW:7, sibling_flags 80000000, crypto map: Tunnel0-head-0
sa timing: remaining key lifetime (k/sec): (4162868/3447)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE(ACTIVE)
spi: 0xA5B3AB0F(2780015375)
transform: esp-des esp-md5-hmac ,
in use settings ={Transport, }
conn id: 9, flow_id: SW:9, sibling_flags 80000000, crypto map: Tunnel0-head-0
sa timing: remaining key lifetime (k/sec): (4195477/3447)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE(ACTIVE)
inbound ah sas:
inbound pcp sas:
outbound esp sas:
spi: 0xA68B326(174633766)
transform: esp-des esp-md5-hmac ,
in use settings ={Transport, }
conn id: 8, flow_id: SW:8, sibling_flags 80000000, crypto map: Tunnel0-head-0
sa timing: remaining key lifetime (k/sec): (4162854/3447)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE(ACTIVE)
spi: 0x7F7AFDE3(2138766819)
transform: esp-des esp-md5-hmac ,
in use settings ={Transport, }
conn id: 10, flow_id: SW:10, sibling_flags 80000000, crypto map: Tunnel0-head-0
sa timing: remaining key lifetime (k/sec): (4195491/3447)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE(ACTIVE)
outbound ah sas:
outbound pcp sas:
九、DM×××配置過程當中易出現的問題:
DM×××配置徹底正確,而測試結果異常。此時請依下面操做之:
1)關閉全部站點的隧道端口(注:從中心站點開始!)
Center(config)#int tunnel 0
Center(config-if)#shutdown
Branch1(config)#int tunnel 0
Branch1(config-if)#shutdown
Branch2(config)#int tunnel 0
Branch2(config-if)#shutdown
2)打開全部站點的隧道端口(注:從中心站點開始!)
Center(config)#int tunnel 0
Center(config-if)#no shutdown
Branch1(config)#int tunnel 0
Branch1(config-if)#no shutdown
Branch2(config)#int tunnel 0 Branch2(config-if)#no shutdown