设为首页收藏本站language 语言切换
查看: 1971|回复: 5
收起左侧

[原创] DMVPN【 by.FLY 】

[复制链接]
发表于 2014-9-16 13:54:39 | 显示全部楼层 |阅读模式
DMVPN
一、       概述
在现实生活中,总公司要和许多门店建立VPN,这样如果采用原本的VPN,则VPN的peer会不断增加。所以,为了方便配置,可以采用dynamic lan-to-lan vpn,这样就保证,即使门店的IP地址是动态的不固定的地址,也不用更改总公司VPN路由器配置。
虽然dynamic lan-to-lan vpn满足了一些需求,能够在总公司vpn路由器拥有大量vpn peer的情况下,将vpn变得易于维护和管理,但是对于总公司与门店的vpn之间运行动态路由协议来交换双方内网网段信息,这对于dynamic lan-to-lan vpn来说是办不到的,这时就需要用dynamic multipoint VPN(DMVPN)来解决。

案例:
苏果公司总部地址是固定的,分店的地址都是通过PPPOE拨号:
第一个问题,客户端地址是未知的。
第二个问题,如果配置点到点隧道的话,那么总部的配置量就很大。
第三个问题,如果分店去访问分店的话,采用点到点隧道的,流量是先到总部,然后再到分店,总部的压力很大,网络通讯的延时很大。

解决方案:DMVPN
DMVPN 不是点到点,类似于NBMAspokehub间不能自动发现邻居。DMVPN是所有的分支是知道总部的。
1.每个分支和总部之间建立了永久的隧道,每个分支和分支之间不建立隧道。
所有的分支会通过NHRP协议,会向hub端注册。hub端相当于NHRP的服务器,NHRP是下一跳解析协议。
2.每个分支有两个地址,一个是公网地址,一个是隧道接口地址。隧道接口地址是固定的,公网地址是动态的。
分支会通过NHRP协议告诉hub端,比如我是202.101.23.3,我对应的隧道地址是172.16.1.3。形成了公网地址和隧道地址的映射。而公网地址相当于帧中继的DLCI号。
3.当分支需要发送数据包时,要向NHRP进行查询真实的公网地址。
4.当知道了对端spoke的地址,我就会进行初始化一个动态的IPsec隧道。
5.建立的在多点GRE隧道基础上。
6.spoke间流量转发的时候,可以绕过hub。
7.加密选项是可选的,即使不加密也可以。

二、       DMVPN的四大协议
(一)   Multiple GRE ( MGRE ) ——动态多点GRE
GRE是点对点的,MGRE是一种特殊的GRE技术,类似于多点帧中继技术,是一个典型的NBMA网络。任何一个分支站点不仅仅能够和中心站点进行通讯,而且还能够直接和其它分支站点进行通讯。这保证了DMVPN的一个优点,虚拟网状连通性。
每一个spoke端和hub端是建立的永久的IPsec隧道,而spoke端和spoke端之间是虚链路。
(二)   Next Hop ResolutionProtocol ( NHRP )——下一跳解析协议
仅仅配置MGRE隧道,是无法保证所有站点都能够直接进行通讯的。
原因一:类似于以太网。IP地址是逻辑地址,MAC地址是物理地址。如果一台设备只知道对方的逻辑地址,是不能通讯的。还需要知道对方的物理地址,才能发送数据包。所以,会使用ARP技术完成以太网内动态或手动的映射逻辑地址到物理地址上。
原因二:类似于多点帧中继网络。每个帧中继接口都有一个逻辑的IP地址,但要访问对方的逻辑IP必须要知道他的物理地址。在帧中继中物理地址就是DLCI,我们通过手动帧中继映射,或者动态反向ARP技术,映射IP地址到DLCI。同样在MGRE网络中,也需要映射逻辑地址到物理地址,MGRE隧道的虚拟地址就是逻辑地址,站点获取的公网IP地址,就是物理地址。
NHRP就是为了实现这个映射而设计的。
首先,每个分支站点都需要手动映射中心站点的虚拟IP到公网IP,所以中心站点必须拥有固定IP地址。分支站点有了这个手动映射就能够和中心站点取得联系,并且通过NHRP协议,注册这个分支站点的隧道虚拟IP到动态获取的公网IP。一旦注册成功,中心站点就有所有分支站点的NHRP映射。这样中心站点也能够访问所有注册后的分支站点。因为注册时动态的,所以分支站点支持动态获取地址。
当某一分支站点希望访问另外一个分支站点时,它首先会使用NHRP协议询问中心站点(NHRP服务器),目的分支站点隧道虚拟IP所对应的公网IP,中心站点回送NHRP映射给发起方,发起方有了目的站点的NHRP映射以后,就能通过MGRE直接发起隧道访问目的站点。这个流量是两个分支站点间直接发起的,并不占用中心站点资源。
(三)   动态路由协议:RIPv2、EIGRP、OSPF、BGP、ODR
动态路由协议主要目的:宣告隧道接口网路和站点身后私有网络。
绝大部分动态路由协议都使用组播来传输路由更新信息。但是MGRE隧道是NBMA网络,这种网络不支持直接承载组播流量,所以要配置组播映射,把组播转化成单播。
由于只有中心站点是固定IP地址,所以默认只能够配置分支站点和中心站点间的组播映射。所以动态路由协议的邻居关系也只会出现在分支站点和中心站点之间。
(四)   IPSec技术
DMVPN也可以理解为MGREover IPSec。IPSec对MGRE流量进行加密。MGRE虽然是特殊的GRE技术,但和GRE技术是同一个协议号47。所以和配置GRE over IPSec一样。
IPSec加密是自动开始的。IPSec利用ACL来决定哪些数据是需要加密的。当数据包匹配所定义的ACL时,IPSec加密隧道会自动建立。

一、       DMVPN基础实验
实验一:

R3和R4从R2的DHCP服务器动态获得地址,R1作为hub端,不改变地址。

DMVPN流程:
第一步,测试公网地址的通讯
第二步,配置隧道的hub端
第三步,配置隧道的spoke端
第四步,测试spoke与hub端的通讯
第五步,配置eigrp协议
       隧道的优化
第六步,配置IPsec的IKE的第一阶段
第七步,配置IPsec的IKE的第二阶段
第八步,配置profile应用到隧道
第九步,测试隧道的协议和是否通讯

第一步,测试公网地址通讯
(DHCP)
R1(HUB):
int f0/0
no sh
ip add 202.101.12.1 255.255.255.0
ip route 0.0.0.0 0.0.0.0 202.101.12.2
R2:
int f0/0
no sh
ip add 202.101.12.2 255.255.255.0
int f1/0
no sh
ip add 202.101.23.1 255.255.255.0
int f1/1
no sh
ip add 202.101.24.1 255.255.255.0
ip dhcp pool R3
network 202.101.23.0 255.255.255.0
default-router 202.101.23.1
ip dhcp excluded-address 202.101.23.1
ip dhcp pool R4
network 202.101.24.0 255.255.255.0
default-router 202.101.24.1
ip dhcp excluded-address 202.101.24.1
router os 1
net 202.101.12.2 0.0.0.0
net 202.101.23.1 0.0.0.0
net 202.101.24.1 0.0.0.0
R3:
int f0/0
no sh
ip add dhcp
R4:
int f0/0
no sh
ip add dhcp
第二步,配置隧道的hub端
interface Tunnel134
ip address 172.16.134.1255.255.255.0
no ip redirects   //自动生成
<---------MGRE配置--------->
tunnel source 202.101.12.1
tunnel mode gremultipoint   //配置隧道模式为多点GRE
tunnel key 12345   //配置隧道密钥12345,用于简单密钥认证
<--------NHRP配置----------->
ip nhrp network-id 134  //激活NHRP,所有站点的“network-id”建议相同
ip nhrp authentication abc134   //可选配置:激活NHRP认证,认证密码abc134
ip nhrp map multicast dynamic  //动态接收NHRP的组播映射
第三步,配置隧道的spoke端
R3/R4:
interface Tunnel134
ip address 172.16.134.3255.255.255.0
no ip redirects       //默认关闭ICMP的重定向功能,为了防止重定向攻击,建议也是关闭
<--------MGRE配置----------->
tunnel source FastEthernet0/0
tunnel mode gre multipoint
tunnel key 12345
<--------NHRP配置----------->
ip nhrp network-id 134
ip nhrp authentication abc134
ip nhrp map 172.16.134.1202.101.12.1   //手动NHRP映射,映射中心站点的隧道虚拟IP到中心站点的公网IP。有了这个映射,分支站点才能访问中心站点。
ip nhrp map multicast202.101.12.1    //MGRE是NBMA网络,分支站点要和中心站点建立动态路由协议的邻居关系, 必须在每一个分支站点,映射组播到中心站点的公网IP。这样才能够把分支站点的组播送到中心站点。并且可以看到分支站点间设有组播,所以分支站点间没有动态路由协议的邻居关系。
ip nhrp nhs 172.16.134.1   //NHS就是NHRP服务器,这个配置定义了NHRP服务器地址为中心站点的隧道接口虚拟地址
第四步,测试spoke与hub端的通讯
HUB的NHRP信息:
R1#showip nhrp
172.16.134.3/32via 172.16.134.3
   Tunnel134 created 00:08:53, expire 01:51:06
   Type:dynamic, Flags: unique registered
<由于注册动态获取的映射信息>
   NBMA address: 202.101.23.2
<映射Spoke1的虚拟IP地址172.16.134.3到公网202.101.23.2>
172.16.134.4/32via 172.16.134.4
   Tunnel134 created 00:00:18, expire 01:59:41
   Type: dynamic, Flags: unique registered used
<由于注册动态获取的映射信息>
   NBMA address:202.101.24.2
<映射Spoke2的虚拟IP地址172.16.134.4到公网202.101.24.2>

Spoke1的NHRP信息:
R3#showip nhrp
172.16.134.1/32via 172.16.134.1
   Tunnel134 created 00:39:56, never expire
   Type: static, Flags: used
<静态NHRP映射>
   NBMA address:202.101.12.1
<映射Hub的虚拟IP地址172.16.134.1到公网IP地址202.101.12.1>

Spoke1 ping 测试Spoke2
R3#ping172.16.134.4

Type escapesequence to abort.
Sending5, 100-byte ICMP Echos to 172.16.134.4, timeout is 2 seconds:
!!!!!
Successrate is 100 percent (5/5), round-trip min/avg/max = 40/117/208 ms

DMVPN为了实现零丢包特性,在还没有给分支站点做NHRP解析前,会帮分支站点代传几个包,但是这几个包延时会大。也就是这个包是由中心抵达目的站点的,但是NHRP解析以后,分支站点有能力直接建立隧道和目的站点进行通讯。如果站点间没有ARP解析,可能会丢一个ARP的解析包。

再次查看Spoke1的NHRP:
R3#showip nhrp     
172.16.134.1/32via 172.16.134.1
   Tunnel134 created 00:43:56, never expire
   Type: static, Flags: used
   NBMA address: 202.101.12.1
172.16.134.3/32via 172.16.134.3
   Tunnel134 created 00:00:24, expire 01:59:35
   Type:dynamic, Flags: router unique local
   NBMA address: 202.101.23.2
    (no-socket)
172.16.134.4/32via 172.16.134.4
   Tunnel134 created 00:00:25, expire 01:59:35
   Type:dynamic, Flags: router used
   NBMA address:202.101.24.2
   <NHRP服务器动态解析Spoke2的虚拟地址到公网地址>

第五步,配置eigrp协议
R1:
int lo0
ip add 1.1.1.1 255.255.255.0
router ei 100
net 1.1.1.1 0.0.0.0
net 172.16.134.1 0.0.0.0
R3:
int lo0
ip add 3.3.3.3 255.255.255.0
router ei 100
net 3.3.3.3 0.0.0.0
net 172.16.134.3 0.0.0.0
R4:
int lo0
ip add 4.4.4.4 255.255.255.0
router ei 100
net 4.4.4.4 0.0.0.0
net 172.16.134.4 0.0.0.0

查看hub端EIGRP邻居:
R1(config-router)#do sh ip ei nei
IP-EIGRP neighbors for process 100
H   Address              Interface       Hold Uptime   SRTT  RTO  Q  Seq
                                       (sec)         (ms)       Cnt Num
1   172.16.134.4          Tu134             11 00:02:41  124  1428  0  5
0   172.16.134.3          Tu134             10 00:03:00   93 1428  0  5
<中心站点跟所有的分支站点都有邻居关系>
    R1#sh ip route eigrp  
D    3.0.0.0/8 [90/27008000]via 172.16.134.3, 00:29:12, Tunnel134
        4.0.0.0/24 is subnetted, 1 subnets
D       4.4.4.0 [90/27008000]via 172.16.134.4, 00:28:52, Tunnel134
<中心站点通过动态路由协议可以学习到所有分支站点内部网络的路由>
查看spoke1端EIGRP邻居:
R3#show ip eigrpneighbors
IP-EIGRPneighbors for process 100
H   Address                 Interface       Hold Uptime   SRTT  RTO  Q  Seq
                                           (sec)         (ms)      Cnt Num
0   172.16.134.1            Tu134             10 00:32:08 1039  5000 0  7
<分支站点只会和中心站点建立动态路由协议的邻居关系,分支站点间没有邻居关系>
查看Spoke1通过EIGRP学习的路由:
R3#show ip routeeigrp
     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/27008000] via 172.16.134.1,00:33:35, Tunnel134
     3.0.0.0/8 is variably subnetted, 2subnets, 2 masks
D       3.0.0.0/8 is a summary, 00:33:34, Null0
     172.16.0.0/16 is variably subnetted, 2subnets, 2 masks
D       172.16.0.0/16 is a summary, 00:33:34,Null0
<由于动态路由协议水平分割特性,分支站点只能够学习到中心站点内部网络的路由>

为了解决默认情况下,分支站点通过动态路由协议,只能够学习到中心站点内部网络路由的问题,需要在中心站点的隧道接口上关闭水平分割的特性。
R1:
int tunnel 134
no ipsplit-horizen eigrp 100

中心站点关闭水分割后,查看spoke1通过EIGRP学习的路由:
R3#show ip routeei
     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/27008000] via 172.16.134.1,00:37:00, Tunnel134
     3.0.0.0/8 is variably subnetted, 2subnets, 2 masks
D       3.0.0.0/8 is a summary, 00:01:06, Null0
     4.0.0.0/24 is subnetted, 1 subnets
D       4.4.4.0[90/28288000] via 172.16.134.1, 00:01:06, Tunnel134
     172.16.0.0/16 is variably subnetted, 2subnets, 2 masks
D       172.16.0.0/16 is a summary, 00:36:59,Null0
<Spoke1虽然学习到了Spoke2内部网络4.4.4.0/24的路由,但是路由的下一跳却是中心站点。很明显为了实现,DMVPN分支站点间直接建立隧道的特性,我们希望4.4.4.0/24的下一跳应该为172.16.134.4(Spoke2隧道虚拟IP地址)。>

hub端配置优化路由:
R1:
int tunnel 134
no ipnext-hop-self eigrp 100

hub路由优化后,查看spoke1通过EIGRP学习到的路由:
R3#show ip routeeigrp
     1.0.0.0/24 is subnetted, 1 subnets
D       1.1.1.0 [90/27008000] via 172.16.134.1,00:00:33, Tunnel134
     3.0.0.0/8 is variably subnetted, 2subnets, 2 masks
D       3.0.0.0/8 is a summary, 00:00:33, Null0
     4.0.0.0/24 is subnetted, 1 subnets
D       4.4.4.0[90/28288000] via 172.16.134.4, 00:00:33, Tunnel134
     172.16.0.0/16 is variably subnetted, 2subnets, 2 masks
D       172.16.0.0/16 is a summary, 00:40:18,Null0
第六步,配置IPsec的IKE的第一阶段
crypto isakmp policy 10
    authentication pre-share
crypto isakmp key 0 cisco address0.0.0.0 0.0.0.0
<由于分支站点间是直接建立隧道,所以共享秘密的地址应该0.0.0.0 0.0.0.0>
第七步,配置IPsec的IKE的第二阶段
crypto ipsec transform-set abc esp-des esp-md5-hmac
mode transport         
第八步,配置profile应用到隧道
crypto ipsec profiletest
set transform-set abc
int tunnel 134
ip mtu 1400    //调整MTU,防止IPSec分片
tunnel protectionipsec profile test
第九步,测试隧道的协议和是否通讯
PS:一些查看命令
show ip nhrp :查看NHRP映射
show cryptoipsec sa :查看IPSec SA


二、       单云双hub案例

一、配置公网
R2:
int e1/0
no sh
ip add 202.101.27.1255.255.255.0
ip route 0.0.0.0 0.0.0.0202.101.27.2
R3:
int e1/0
no sh
ip add 202.101.37.1255.255.255.0
ip route 0.0.0.0 0.0.0.0202.101.37.2
R7:
int e1/2
no sh
ip add 202.101.27.2255.255.255.0
int e1/3
no sh
ip add 202.101.37.2255.255.255.0
int e1/4
no sh
ip add 202.101.47.1255.255.255.0
int e1/5
no sh
ip add 202.101.57.1255.255.255.0
ip dhcp pool R4
network 202.101.47.0255.255.255.0
default-router202.101.47.1
ip dhcp exclude202.101.47.1
ip dhcp pool R5
network 202.101.57.0255.255.255.0
default-router202.101.57.1
ip dhcp exclude202.101.57.1
R4:
int e1/0
ip add dhcp client-ide1/0 host R4
no sh
R5:
int e1/0
ip add dhcp client-ide1/0 host R5
no sh

二、配置DMVPN
Hub1配置:
crypto isakmp policy 10
authenticationpre-share
crypto isakmp key ciscoaddress 0.0.0.0 0.0.0.0
crypto ipsectransform-set cisco esp-des esp-md5-hmac
modetransport
crypto ipsec profiledmvpn-profile
settransform-set cisco
interfaceTunnel0
ip address 172.16.1.100 255.255.255.0
no ip redirects
ip nhrp map multicast dynamic
ip nhrp map 172.16.1.101 202.101.37.1  //中心站点要彼此映射
ip nhrp map multicast 202.101.37.1     //中心站点要彼此映射
ipnhrp network-id 2345
tunnelsource 202.101.27.1
tunnelmode gre multipoint
tunnelprotection ipsec profile dmvpn-profile
<优化配置>
bandwidth1000   //默认100
delay1000   //设置delay为10000,默认50000
ipmtu 1400  //将mtu设置为1400,防止IPsec分片,默认1476
ipnhrp holdtime 360
iptcp adjust-mss 1360
Hub2配置:
crypto isakmp policy 10
authenticationpre-share
crypto isakmp key ciscoaddress 0.0.0.0 0.0.0.0
crypto ipsectransform-set cisco esp-des esp-md5-hmac
modetransport
crypto ipsec profiledmvpn-profile
settransform-set cisco
interfaceTunnel0
bandwidth 1000
ip address 172.16.1.101 255.255.255.0
no ip redirects
ip mtu 1400
ip nhrp map multicast dynamic
ip nhrp map 172.16.1.100 202.101.27.1
ip nhrp map multicast 202.101.27.1
ip nhrp network-id 2345
ip nhrp holdtime 360
ip tcp adjust-mss 1360
delay 1000
tunnel source 202.101.37.1
tunnel mode gre multipoint
tunnel protection ipsec profiledmvpn-profile

Spoke1配置:
crypto isakmp policy 10
authenticationpre-share
crypto isakmp key ciscoaddress 0.0.0.0 0.0.0.0
crypto ipsectransform-set cisco esp-des esp-md5-hmac
modetransport
crypto ipsec profiledmvpn-profile
settransform-set cisco
interfaceTunnel0
bandwidth 1000
ip address 172.16.1.1 255.255.255.0
no ip redirects
ip mtu 1400
ip nhrp map 172.16.1.100 202.101.27.1
ip nhrp map 172.16.1.101 202.101.37.1
ip nhrp map multicast 202.101.27.1
ip nhrp map multicast 202.101.37.1
<每一个分支站点需要静态配置两个中心站点的NHRP映射>
ip nhrp network-id 2345
ip nhrp holdtime 360
ip nhrp nhs 172.16.1.101
ip nhrp nhs 172.16.1.100
  <配置两个NHRP服务器>
ip tcp adjust-mss 1360
delay 1000
tunnel source Ethernet1/0
tunnel mode gre multipoint
tunnel protection ipsec profile dmvpn-profile

Spoke2配置:
crypto isakmp policy 10
authenticationpre-share
crypto isakmp key ciscoaddress 0.0.0.0 0.0.0.0
crypto ipsectransform-set cisco esp-des esp-md5-hmac
modetransport
crypto ipsec profiledmvpn-profile
settransform-set cisco
interfaceTunnel0
bandwidth 1000
ip address 172.16.1.2 255.255.255.0
no ip redirects
ip mtu 1400
ip nhrp map 172.16.1.100 202.101.27.1
ip nhrp map 172.16.1.101 202.101.37.1
ip nhrp map multicast 202.101.27.1
ip nhrp map multicast 202.101.37.1
ip nhrp network-id 2345
ip nhrp holdtime 360
ip nhrp nhs 172.16.1.101
ip nhrp nhs 172.16.1.100
ip tcp adjust-mss 1360
delay 1000
tunnel source Ethernet1/0
tunnel mode gre multipoint
tunnel protection ipsec profile dmvpn-profile

三、配置通讯网路
R2:
int f0/0
no sh
ip add 192.168.100.100255.255.255.0
router os 1
net 192.168.100.100 0.0.0.0 a 0
net 172.16.1.100 0.0.0.0 a 0
int tun 0
ip ospf network broadcast   //tunnel接口的ospf默认类型为point-to-point
R1:
int f0/0
no sh
ip add 192.168.100.1255.255.255.0
router os 1
net 192.168.100.1 0.0.0.0 a 0
R3:
int f0/0
no sh
ip add 192.168.100.101255.255.255.0
router os 1
net 192.168.100.101 0.0.0.0 a 0
net 172.16.1.101 0.0.0.0 a 0
int tun 0
ip ospf network broadcast
R4:
int lo0
ip add 192.168.1.1 255.255.255.0
router os 1
net 192.168.1.1 0.0.0.0 a 0
net 172.16.1.1 0.0.0.0 a 0
int tun 0
ip ospf network broadcast
R5:
int lo0
ip add 192.168.2.1 255.255.255.0
router os 1
net 192.168.2.1 0.0.0.0 a 0
net 172.16.1.2 0.0.0.0 a 0
int tun 0
ip ospf network broadcast
内网的优化:
R2:
int tun 0
ip ospf priority 2    //R2,R3进行DRBDR的选举
ip ospf cost 100    //路径优选R2
R3:
int tun 0
ip ospf priority 2
ipospf cost 105
R4:
int tun 0
ip ospf priority 0  //R4R5放弃DRBDR的选举
R5:
int tun 0
ip ospf priority 0
三、       双云双hub案例

一、配置公网
R2:
int e1/0
no sh
ip add 202.101.27.1255.255.255.0
ip route 0.0.0.0 0.0.0.0202.101.27.2
R3:
int e1/0
no sh
ip add 202.101.38.1255.255.255.0
ip route 0.0.0.0 0.0.0.0202.101.38.2
R7:
int e1/2
no sh
ip add 202.101.27.2255.255.255.0
int e1/4
no sh
ip add 202.101.47.1255.255.255.0
int e1/5
no sh
ip add 202.101.57.1255.255.255.0
ip dhcp pool R4
network 202.101.47.0255.255.255.0
default-router202.101.47.1
ip dhcp exclude202.101.47.1
ip dhcp pool R5
network 202.101.57.0255.255.255.0
default-router202.101.57.1
ip dhcp exclude202.101.57.1
R8:
int e1/3
no sh
ip add 202.101.38.2255.255.255.0
int e1/4
no sh
ip add 202.101.48.1255.255.255.0
int e1/5
no sh
ip add 202.101.58.1255.255.255.0
ip dhcp pool R4
network 202.101.48.0255.255.255.0
default-router202.101.48.1
ip dhcp exclude202.101.48.1
ip dhcp pool R5
network 202.101.58.0255.255.255.0
default-router 202.101.58.1
ip dhcp exclude202.101.58.1
R4:
int e1/0
ip add dhcp client-ide1/0 host R4
no sh
int e1/1
ip add dhcp client-ide1/1 host R4
no sh
R5:
int e1/0
ip add dhcp client-ide1/0 host R5
no sh
int e1/1
ip add dhcp client-ide1/1 host R4
no sh
二、配置DMVPN
Hub1配置:
crypto isakmp policy 10
authenticationpre-share
crypto isakmp key ciscoaddress 0.0.0.0 0.0.0.0
crypto ipsectransform-set cisco esp-des esp-md5-hmac
modetransport
crypto ipsec profiledmvpn-profile
settransform-set cisco
interfaceTunnel0
ip address 172.16.1.100 255.255.255.0
no ip redirects
ip nhrp map multicast dynamic
ipnhrp network-id 245
tunnelsource 202.101.27.1
tunnelmode gre multipoint
tunnelprotection ipsec profile dmvpn-profile
<优化配置>
bandwidth1000   //默认100
delay1000   //设置delay为10000,默认50000
ipmtu 1400  //将mtu设置为1400,防止IPsec分片,默认1476
ipnhrp holdtime 360
iptcp adjust-mss 1360
Hub2配置:
crypto isakmp policy 10
authenticationpre-share
crypto isakmp key ciscoaddress 0.0.0.0 0.0.0.0
crypto ipsectransform-set cisco esp-des esp-md5-hmac
modetransport
crypto ipsec profiledmvpn-profile
settransform-set cisco
interfaceTunnel0
bandwidth 1000
ip address 172.16.2.100 255.255.255.0
no ip redirects
ip mtu 1400
ip nhrp map multicast dynamic
ip nhrp network-id 345
ip nhrp holdtime 360
ip tcp adjust-mss 1360
delay 1000
tunnel source 202.101.38.1
tunnel mode gre multipoint
tunnel protection ipsec profiledmvpn-profile

Spoke1配置:
crypto isakmp policy 10
authenticationpre-share
crypto isakmp key ciscoaddress 0.0.0.0 0.0.0.0
crypto ipsectransform-set cisco esp-des esp-md5-hmac
modetransport
crypto ipsec profiledmvpn-profile
settransform-set cisco
interfaceTunnel0
<隧道口一,在这隧道网络中,中心站点一为NHRP服务器>
bandwidth 1000
ip address 172.16.1.1 255.255.255.0
no ip redirects
ip mtu 1400
ip nhrp map 172.16.1.100 202.101.27.1
ip nhrp map multicast 202.101.27.1
ip nhrp nhs 172.16.1.100
<只配置中心站点一的NHRP映射>
ip nhrp network-id 245
ip nhrp holdtime 360
ip tcp adjust-mss 1360
delay 1000
tunnel source Ethernet1/0
tunnel mode gre multipoint
tunnel protection ipsec profile dmvpn-profile shared
<加上shared关键字,这样一个profile就能同时运用两个不同隧道>
interfaceTunnel1
<隧道口二,在这隧道网络中,中心站点二为NHRP服务器>
bandwidth 1000
ip address 172.16.2.1 255.255.255.0
no ip redirects
ip mtu 1400
ip nhrp map 172.16.2.100 202.101.38.1
ip nhrp map multicast 202.101.38.1
ip nhrp nhs 172.16.2.100
<只配置中心站点二的NHRP映射>
ip nhrp network-id 345
ip nhrp holdtime 360
ip tcp adjust-mss 1360
delay 1000
tunnel source Ethernet1/1
tunnel mode gre multipoint
tunnel protection ipsec profile dmvpn-profile shared
<加上shared关键字,这样一个profile就能同时运用两个不同隧道>

Spoke2配置:
crypto isakmp policy 10
authenticationpre-share
crypto isakmp key ciscoaddress 0.0.0.0 0.0.0.0
crypto ipsectransform-set cisco esp-des esp-md5-hmac
modetransport
crypto ipsec profiledmvpn-profile
settransform-set cisco
interfaceTunnel0
bandwidth 1000
ip address 172.16.1.2 255.255.255.0
no ip redirects
ip mtu 1400
ip nhrp map 172.16.2.100 202.101.27.1
ip nhrp map multicast202.101.27.1
ip nhrp network-id 245
ip nhrp holdtime 360
ip nhrp nhs172.16.1.100
ip tcp adjust-mss 1360
delay 1000
tunnel source Ethernet1/0
tunnel mode gre multipoint
tunnel protection ipsec profile dmvpn-profileshared
interfaceTunnel1
bandwidth 1000
ip address 172.16.2.2 255.255.255.0
no ip redirects
ip mtu 1400
ip nhrp map 172.16.2.100 202.101.38.1
ip nhrp map multicast 202.101.38.1
ip nhrp nhs 172.16.2.100
ip nhrp network-id 345
ip nhrp holdtime 360
ip tcp adjust-mss 1360
delay 1000
tunnel source Ethernet1/1
tunnel mode gre multipoint
tunnel protection ipsec profile dmvpn-profile shared

三、配置通讯网络
R2:
int f0/0
no sh
ip add 192.168.100.100 255.255.255.0
router os 1
net192.168.100.100 0.0.0.0 a 0
net172.16.1.100 0.0.0.0 a 0
int tun 0
ipospf network broadcast   //tunnel接口的ospf默认类型为point-to-point
R1:
int f0/0
no sh
ip add 192.168.100.1 255.255.255.0
router os 1
net192.168.100.1 0.0.0.0 a 0
R3:
int f0/0
no sh
ip add 192.168.100.101 255.255.255.0
router os 1
net192.168.100.101 0.0.0.0 a 0
net172.16.2.100 0.0.0.0 a 0
int tun 0
ipospf network broadcast
R4:
int lo0
ip add192.168.1.1 255.255.255.0
router os 1
net192.168.1.1 0.0.0.0 a 0
net172.16.1.1 0.0.0.0 a 0
net172.16.2.1 0.0.0.0 a 0
int tun 0
ipospf network broadcast
R5:
int lo0
ip add192.168.2.1 255.255.255.0
router os 1
net192.168.2.1 0.0.0.0 a 0
net172.16.1.2 0.0.0.0 a 0
net172.16.2.2 0.0.0.0 a 0
int tun 0
ipospf network broadcast
内网的优化:
R2:
int tun 0
ip ospf priority 2    //R2,R3进行DR、BDR的选举
ip ospf cost 100    //路径优选R2
R3:
int tun 0
ipospf priority 2
ipospf cost 105
R4:
int tun 0
ipospf priority 0  //R4,R5放弃DR、BDR的选举
R5:
int tun 0
ip ospf priority 0


 楼主| 发表于 2014-9-16 13:55:52 | 显示全部楼层
鸿鹄发帖相当的卡啊。。。
沙发 2014-9-16 13:55:52 回复 收起回复
回复 支持 反对

使用道具 举报

 楼主| 发表于 2014-9-16 13:57:17 | 显示全部楼层
图还被全吞了。。基础实验:
实验一.png

单云单hub实验:
实验二.png

双云双hub实验:
实验三.png

板凳 2014-9-16 13:57:17 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2014-9-27 18:03:08 | 显示全部楼层
沙发~支持楼主
地板 2014-9-27 18:03:08 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2014-10-20 14:38:03 | 显示全部楼层
感謝大大提供分享
5# 2014-10-20 14:38:03 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2016-3-15 14:25:07 | 显示全部楼层
学习了不少~~
6# 2016-3-15 14:25:07 回复 收起回复
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-2-10 11:45 , Processed in 0.062548 second(s), 15 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表