一.DMVPN的四大组成部分▸
1.mGRE (Multipoint Generic Routing Encapsulation) 多点通用路由封装
2.NHRP (Next Hop Resolution Protocol)下一跳解析协议 一个二层的客户-服务器解析协议,用于映射地址(虚拟)到一个NBMA
地址(物理)。
3.Dynamic Routing Protocol 动态路由协议 支持的动态路由协议有OSPF
、EIGRP
、BGP
、RIP
、ODR
(已淘汰) 路由比邻只在hub-to-spoke
隧道上建立,spoke-to-spoke
的路由逻辑由NHRP
来执行,路由协议并不监控spoke-to-spoke
的状态。
4.IPsec DMVPN依然是一种GRE over IPSEC
技术,也是典型的传输模式。
二.DMVPN的配置▸
1.MGRE▸
①配置各个接口的物理地址并no shutdown
接口 ②mGRE上将E0/1划入Vlan10,E0/2-3划入VLAN20,并配置VLAN10和20的SVI接口,SVI.vlan10
的地址是61.128.1.254,SVI.VLAN20
的地址是202.100.1.254( 要保证公网IP之间的连通性,因为这是前提
mGRE(config)#int e0/1 |
③使用BGP
完成公网可达(HubAS为100,SpokeAS为200,ISPAS为6666)
HUB-1#sh run s bgp |
▸
④配置隧道接口 在HUB和SPOKE上:
interface Tunnel0 |
2.NHRP:将私网地址mapping成NBMA地址▸
HUB-1:
interface Tunnel0 |
Spoke:(两个spoke除了接口地址不同外,其他配置均相同)
interface Tunnel0 |
3.动态路由协议 使用EIGRP▸
配置:
router eigrp 90 |
现象:
HUB-1#p 192.168.1.1 source lo0 |
会发现,现在hub-spoke
之间建立起了邻居,而 spoke-spoke
之间却没有邻居(自然也没有路由) 解决方案:关闭水平分割
,使spoke1通告到Hub后通告出去发给spoke2
HUB-1(config)#int tunnel 0 |
(注意:直接no ip split-horizon
也是可以敲上去的,不过这样是针对BGP
和RIP
针对EIGPR
要加上eigrp [AS]
)
``` |
crypto isakmp policy 10
authentication pre-share —-预共享密钥认证
crypto isakmp key QYT address 0.0.0.0 —–因为是MA网络 所以地址0.0.0.0
crypto ipsec transform-set Trans esp-des esp-md5-hmac —–转换集
mode transport —配置为传输模式,默认是隧道模式
crypto ipsec profile DMVPN —profile模板做汇总
set transform-set Trans —调用转换集
interface tunnel 0
tunnel protection ipsec profile DMVPN —tunnel接口下调用模板
|
Spoke-2#traceroute 192.168.1.1
Type escape sequence to abort.
Tracing the route to 192.168.1.1
VRF info: (vrf in name/id, vrf out name/id)
1 172.16.1.100 [AS 6666] 7 msec 6 msec 7 msec
2 172.16.1.1 [AS 6666] 6 msec
|
interface Tunnel0
no ip next-hop-self eigrp 90
|
Spoke-2#traceroute 192.168.1.1
Type escape sequence to abort.
Tracing the route to 192.168.1.1
VRF info: (vrf in name/id, vrf out name/id)
1 172.16.1.1 [AS 6666] 7 msec —-一跳抵达
|
ip nhrp redirect
ip summary-address eigrp 90 192.168.0.0 255.255.0.0 —汇总EIGRP
Spoke-1#sh ip route eigrp
D 192.168.0.0/16 [90/27008000] via 172.16.1.100, 02:33:51, Tunnel0
|
interface Tunnel0
ip nhrp shortcut
|
Spoke-1# ping 192.168.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 5/5/7 ms
Spoke-1#sh ip route nhrp
H 192.168.2.0/24 [250/1] via 172.16.1.2, 00:24:22, Tunnel0
Spoke-1#traceroute 192.168.2.1
Type escape sequence to abort.
Tracing the route to 192.168.2.1
VRF info: (vrf in name/id, vrf out name/id)
1 172.16.1.2 [AS 6666] 4 msec * 6 msec 一跳抵达