掌握聚合最新动态了解行业最新趋势
API接口,开发服务,免费咨询服务

企业中DMVPN配置

背景

由于企业快速发展,逐渐形成多中心多分支的办公职场,增加分支也带来了以下的问题:

  • 1、企业部署域架构,PC终端通过域控进行管理;方便账号管理,内部系统由AD账号进行身份验证。分支登陆内部系统,需要通过AD进行身份验证。
  • 2、企业中的共享文件资源,分支需要访问共享资源。
  • 3、企业中基于安全因素不发布在公网的系统资源(比如OA系统、财务系统等),分支需要访问OA、财务等系统。
  • 4、每个分支大多不会配置IT专业人员,所以需要由中心IT远程管理分支内部的网络设备和服务器。
  • 5、由于分支越来越多,为了保证每个分支的网络运行,需要对每个分支网络设备进行监控,出现故障及时进行报警。
  • 6、总部业务部门需要了解分支的运行状态,通过视频监控查看分支办公室的运行情况。
  • 7、满足增加中心或者分支,不改变原有的中心和分支的配置。
  • 8、当两个分支需要互联,流量尽量不需要通过中心。

为了解决以上问题,企业希望通过公网安全地将各地的分支与中心联系起来,构成星形拓扑结构网络,并通过IPsec隧道来保证内部通讯的安全。但大多数企业的数据集中在一个或者多个中心,如果采用IPsecVPN星形拓扑,如果两个分支通信,流量则要通过中心,这样就造成了较大的网络时延,增加中心的带宽压力。尤其在视频、语音通信中,这种时延影响了企业网络的正常运行。

DMVPN技术的出现,为企业解决了这方面的难题,DMVPN是一种基于mGRE的集高速高扩展性的IPsec VPN技术。 

IPsec VPN 与DMVPN对比:

IPSec VPN星形拓扑

DMVPN

星形拓扑

简单的星形拓扑配置,提供了虚拟网状连通性

中心站点配置量大,增加分支,需要更改中心配置

增加新的分支站点,无需更改中心站点配置

分支站点间流量延时较大、占用中心带宽

分支站点间流量,通过动态产生站点间隧道进行封装,隧道生成后,流量无需经过中心

每个分支站点都需固定的公网IP地址

分支站点支持动态IP地址

DMVPN由四大协议组成

1) mGRE(多点GRE):

它是一种特殊的GRE技术,这种技术与多点帧中继技术很相似,也是典型的NBMA网络。所有站点的mGRE隧道接口都处于同一网段,进入mGRE网络的任何一个分支站点不仅能和中心站点进行通信,而且还能直接和其他分支站点进行通信,这显示了DMVPN的第一个有点“虚拟网状连通性“。

2) NHRP(下一跳地址解析协议):

它和以太网中的ARP协议非常相似,NHRP是实现mGRE隧道虚拟地址(即逻辑地址)到每一站固定配置或动态获取的公网IP地址(即物理地址)之间的映射。

分支站点通过NHRP协议向中心站点注册分支站点的隧道虚拟IP到动态获取的公网IP,因为注册是动态的,所以分支站点支持动态获取IP地址。

3) 动态路由协议:

动态路由协议的主要目的是宣告隧道网络和 站点身后的私有网络,让每一个站点都能学习到其他站点身后的网络的路由。

4) IPSEC技术:

IPSEC对mGRE的流量进行加密保护。其实可以理解为DMVPN就是mGRE OVER IPSEC,IPSEC VPN的配置和GRE OVER IPSEC中的IPSEC VPN配置一样。DMVPN也使用传输模式。  


DMVPN配置实例

中心和分支DMVPN路由器都位于防火墙外面,直接连接公网。DMVPN只做分支与中心之间的网络连接,对访问资源安全通过防火墙进行控制。此图为双中心多分支,以下为简要配置

1)  配置IPsec VPN

Hub1配置(Hub2 与Hub1配置类似)

cryptoisakmp policy 10

 encr 3des

 hash md5

 authentication pre-share

 group 2

 lifetime 3600

cryptoisakmp key cisco address 0.0.0.0 0.0.0.0

!

cryptoipsec transform-set test1 esp-3des esp-md5-hmac

!

cryptoipsec profile test1-pro

 set transform-set test1


spoke1配置(spoke2与spoke配置类似)

cryptoisakmp policy 10

 encr 3des

 hash md5

 authentication pre-share

 group 2

 lifetime 3600

!

cryptoisakmp policy 20

 encr aes

 authentication pre-share

 group 2

 lifetime 3600

cryptoisakmp key cisco address 123.124.250.1

cryptoisakmp key class address 123.124.250.2

!

cryptoipsec transform-set test1 esp-3des esp-md5-hmac

cryptoipsec transform-set test2 esp-aes esp-sha-hmac

 mode transport

!

cryptoipsec profile test1-pro

 set transform-set test1

!

cryptoipsec profile test2-pro

 set transform-set test2

2)  配置mGRE和NHRP

Hub1配置(Hub2与Hub1配置类似)

 interface Tunnel1

 ip address 10.10.1.1 255.255.255.0

 no ip redirects

 ip mtu 1400

 no ip next-hop-selfeigrp 100

 ip nhrp authentication cisco

 ip nhrp map multicast dynamic

 ip nhrp network-id 1

 ip nhrp holdtime 600

 ip nhrp server-only

 no ip split-horizoneigrp 100

 tunnel source FastEthernet0/0

 tunnel mode gre multipoint

 tunnel key 1000

 tunnel protection ipsecprofile test1-pro

Spoke1配置(spoke2与spoke1配置类似)

 interface Tunnel1

 ip address 10.10.1.3 255.255.255.0

 ip mtu 1400

 ip nhrp authentication cisco

 ip nhrp map multicast 123.124.250.1

 ip nhrp map 10.10.1.1 123.124.250.1

 ip nhrp network-id 1

 ip nhrp holdtime 600

 ip nhrp nhs 10.10.1.1

 tunnel source FastEthernet0/0

 tunnel destination 123.124.250.1

 tunnel key 1000

 tunnel protectionipsec profile test1-pro

!

interfaceTunnel2

 ip address 10.10.2.3 255.255.255.0

 ip mtu 1400

 ip nhrp authentication class

 ip nhrp map multicast 123.124.250.2

 ip nhrp map 10.10.2.1 123.124.250.2

 ip nhrp network-id 2

 ip nhrp holdtime 600

 ip nhrp nhs 10.10.2.1

 tunnel source FastEthernet0/0

 tunnel destination 123.124.250.2

 tunnel key 1000

 tunnel protectionipsec profile test2-pro

!

3)  配置动态路由协议(本次采用EIGRP)

Hub1配置(Hub2与Hub1类似)

routereigrp 100

 network 10.10.2.0 0.0.0.255

 network 172.16.2.0 0.0.0.255

 no auto-summary

Hub1的eigrp邻居为spoke1和spoke2,同样Hub2的eigrp邻居为spoke1和spoke2。

R1#showip eigrp neighbors

IP-EIGRPneighbors for process 100

H   Address                 Interface       Hold Uptime   SRTT  RTO  Q  Seq

                                           (sec)         (ms)       Cnt Num

1   10.10.1.4               Tu1               11 00:17:01   48  5000  0  4

0   10.10.1.3              Tu1               10 00:37:07  348 5000  0  16

################################################################

R1#showip route

Codes: 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 - OSPFexternal type 2

       i - IS-IS, su - IS-IS summary, L1 -IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidatedefault, U - per-user static route

       o - ODR, P - periodic downloaded staticroute

Gatewayof last resort is not set

     172.16.0.0/24 is subnetted, 4 subnets

D       172.16.4.0 [90/297372416] via 10.10.1.4,00:16:22, Tunnel1

C       172.16.1.0 is directly connected,Loopback0

D       172.16.2.0[90/310172416] via 10.10.1.4, 00:16:25, Tunnel1

                  [90/310172416] via 10.10.1.3, 00:16:25, Tunnel1

D       172.16.3.0 [90/297372416] via 10.10.1.3,00:16:24, Tunnel1

     10.0.0.0/24 is subnetted, 2 subnets

C       10.10.1.0 is directly connected, Tunnel1

D       10.10.2.0 [90/310044416] via 10.10.1.4,00:16:25, Tunnel1

                  [90/310044416] via 10.10.1.3,00:16:27, Tunnel1

     123.0.0.0/24 is subnetted, 1 subnets

C       123.124.250.0 is directly connected,FastEthernet0/0

从路由表可以看出Hub1(R1)和 Hub2(R2)的邻居分别是Spoke1(R3)和Spoke2(R4),如果R1到R2有两条等价路由加表,都是通过Spoke两个Hub才能建立连接。如果需要Hub1和Hub2通信不需通过spoke,我们在Hub1和Hub2建立点到点的VPN或者使用专线,让他们直接互通。为了保证中心服务的网络安全,再防火墙上配置安全策略,允许安全的spoke访问中心的资源。

Spoke1配置(spoke2与spoke1类似)

routereigrp 100

 network 10.10.1.0 0.0.0.255

 network 10.10.2.0 0.0.0.255

 network 172.16.3.0 0.0.0.255

 no auto-summary

spoke1分别与Hub1和Hub2建立eigrp邻居。同样,spoke2分别与Hub1和Hub2建立eigrp邻居。

R3#showip eigrp neighbors

IP-EIGRPneighbors for process 100

H   Address                 Interface       Hold Uptime   SRTT  RTO  Q  Seq

                                           (sec)         (ms)       Cnt Num

1   10.10.2.1               Tu2               13 00:30:17  597  5000  0  8

0   10.10.1.1               Tu1               13 00:42:30   80 5000  0  12

##################################################################

R3#showip route

Codes: 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 - OSPFexternal type 2

       i - IS-IS, su - IS-IS summary, L1 -IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidatedefault, U - per-user static route

       o - ODR, P - periodic downloaded staticroute

Gatewayof last resort is not set

     172.16.0.0/24 is subnetted, 4 subnets

D       172.16.4.0[90/310172416] via 10.10.2.4, 00:26:29, Tunnel2

                  [90/310172416] via 10.10.1.3, 00:26:29, Tunnel1

D       172.16.1.0 [90/297372416] via 10.10.1.1,00:35:09, Tunnel1

D       172.16.2.0 [90/297372416] via 10.10.2.1,00:35:10, Tunnel2

C       172.16.3.0 is directly connected,Loopback0

     10.0.0.0/24 is subnetted, 2 subnets

C       10.10.1.0 is directly connected, Tunnel1

C       10.10.2.0 is directly connected, Tunnel2

     123.0.0.0/24 is subnetted, 1 subnets

C       123.124.250.0 is directly connected,FastEthernet0/0

从spoke1路由表看出,spoke1到Hub1和Hub2会分别走各自的VPN;spoke1访问spoke2流量不会穿越hub。


原文来自:点融黑帮

声明:所有来源为“聚合数据”的内容信息,未经本网许可,不得转载!如对内容有异议或投诉,请与我们联系。邮箱:marketing@think-land.com

0512-88869195
数 据 驱 动 未 来
Data Drives The Future