拓扑图:

一、理论篇:

   动态多点×××(DM×××)是一个高扩展性的IPSec ×××技术。适合企业级的大规模部署,例如:一个大型连锁企业有上百个连锁店是很正常的!为何传统技术的2种IPSec ×××(1.星形拓扑 2. 网状模型)不适合呢?

1. 星形拓扑IPSec ×××缺点:

(1)中心站点配置量大

    不管是经典配置,还是GRE Over IPSec或者SVI,多一个分支站点,则多一份配置,如果有很多分支站点,那么配置就会成为沉重的负担,并且管理也成为问题。

(2)分支站点间流量延时较大

    一个分支站点的数据到另外一个分支站点,首先加密再送往中心,数据在中心站点被第1次解密,查看路由判断出隧道,然后在中心站点被第2次加密,并且送往目的站点。目的站点收到数据后,再进行第2次解密。归纳:2次加密,2次解密!

(3)分支站点间流量占用中心带宽

    星形拓扑的分支站点间的所有流量,都要经过中心站点来进行转发!若分支站点间的流量过大时,会大大消耗掉中心站点的带宽。

    由上可知,星形拓扑的传统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支持的路由协议有:RIPEIGRPOSPFODRBGP

(4)IPSec技术

    也可以把DM×××理解为MGRE Over IPSec ,IPSec实质是对MGRE流量加密。MGRE是一种特殊的GRE技术,但是协议号依然是GRE的47 。配置和GRE Over IPSec一样!

    DM×××和GRE Over IPSec一样也就是传输模式封装。

二、实战篇:

1、基本配置:

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

2、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

3、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

4、测试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#

5、动态路由协议的配置:

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

6、测试与调整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.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路由优化后,达到了预期效果!

7、配置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)#

8、查看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:

9、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