Dynamic Multipoint VPN (DMVPN) 动态多点虚拟私人网络

前言

用 Tunnel 来连接不同 Site 并建立 Virtual Private Network (VPN) 的传统做法是使用 Generic Routing Encapsulation (GRE)。但如果大家已经看过本网关於 GRE 的文章,就知道用 GRE 来建立 Spoke-to-spoke Topology 所要设定的 Tunnel 数量相当庞大,比较理想的方法是使用 Dynamic Multipoint VPN (DMVPN)。阅读本文前读者必需深入了解 GRE Tunnel 与 Routing Protocol 的运作,例如:EIGRP 和 OSPF 等。

DMVPN 的优点

使用 DMVPN 比传统的 Point-to-point GRE Tunnel 有以下优势:

Tunnel Interface 数量大幅减少

比起 GRE 需要为每只 Hub Router 与 Spoke Router 之间的 VPN 设定独立的 Tunnel Interface,DMVPN 只需要在每只 Router 设定一个 mGRE (Multipoint GRE) Interface (不论 VPN Tunnel 数目有多少) 即可实现 Fully Mesh Topology,设定所需时间与复杂性大减。网管人员生活质素大幅提高!

Spoke Router 不需有 Static Public IP

除了 Hub Router 之外,所有 Spoke Router 不再需要 Static IP Address。因为 Spoke Router 透过 Next Hop Resolution Protocol (NHRP) 向 Hub Router 注册 (Register) 自己的 IP Address。而 Spoke Router 亦可使用 NHRP 向 Hub Router 查询其他 Spoke Router 的 IP Address。

Spoke Router 设定指令大致相同

所有 Spoke Router 的 Tunnel Interface 设定 99% 相同,只要有一只 Spoke Router 成功与 Hub Router 建立 Tunnel,基本上其他的 Spoke Router 都可以使用相同的 Tunnel Interface 设定,只需改改 IP Address 便可以了。每有新 Spoke Site 建立,VPN 设定可以极速完成,省下不少时间,网管人员生活质素又再大幅提高!

Next Hop Resolution Protocol (NHRP)

Next Hop Resolution Protocol (NHRP) 是实现 DMVPN 的重要角色。其实并不复杂,说穿了有点像 ARP。ARP 是用作 IP 与 MAC Address 之间的转换,而 NHRP 则用作 Physical IP 与 Tunnel IP 之间的转换。话说每只 Spoke Router 都会把自己的 Physical IP Address (在 NHRP 里又称作 Non-broadcast Multi Access (NBMA) Address) 和 Tunnel Address 传送给 Hub Router (又称作 NHS),Hub Router 收到这些资讯後,就会建立一个 NHRP Table 储存起来,当有 Spoke Router 要查询某 Tunnel Address 的位置时,Hub Router 即可回覆其 NBMA Address 让 Spoke Router 们能够直接联系。

留意 NHRP 只帮忙把 Tunnel Interface 连接起来,而每个 Spoke Site 里 Private Network 之间的互通,仍需依赖 Routing Protocol。

DMVPN 分为 Phase 1丶2 和 3,每个 Phase 的设定只有少许不同,但结果却有着很大的差异。本文现在由 Phase 1 开始解释 DMVPN 的设定及其原理。

DMVPN Phase 1

DMVPN Phase 1 只能提供 Hub-to-spoke Topology,即所有 Spoke-to-spoke Data Traffic 都要经过 Hub 来传送。请看下图,现在要为 Hong Kong丶Taiwan 和 Beijing 三地建立 DMVPN Phase 1。假设 R1 e1/0丶R2 e1/0 和 R3 e1/0 已经能够互相 Ping 通。

dmvpn

以下为 R1 (Hub) 的 Tunnel Interface 设定。

R1(config)#interface Tunnel0
R1(config-if)#ip address 172.16.123.1 255.255.255.0
R1(config-if)#tunnel source Ethernet1/0
R1(config-if)# ! 把 Tunnel 设成 Multipoint Mode
R1(config-if)#tunnel mode gre multipoint
R1(config-if)# ! Network-id 有点像 VLAN 的原理,用来识别不同的 GRE Tunnel,
R1(config-if)# ! 各 Router Network-id 设定必需相同才能互通。
R1(config-if)#ip nhrp network-id 1
R1(config-if)# ! 由於 Routing Protocol 依赖 Multicast 沟通,在此预先设定把 Multicast
R1(config-if)# ! 设定为传送到所有用 NHRP Dynamic Learn 的 Spoke Router。
R1(config-if)#ip nhrp map multicast dynamic

以下为 R2 (Spoke) 的 Tunnel Interface 设定。

R2(config)#interface Tunnel0
R2(config-if)#ip address 172.16.123.2 255.255.255.0
R2(config-if)#tunnel source Ethernet1/0
R1(config-if)# ! 在 DMVPN Phase 1 只要求所有 Spoke 用传统 GRE 与 Hub 连线
R2(config-if)#tunnel destination 10.0.14.1
R2(config-if)#ip nhrp network-id 1
R1(config-if)# ! NHS (即 Hub) 的位置
R2(config-if)#ip nhrp nhs 172.16.123.1
R1(config-if)# ! Static 设定 Hub 的 NBMA,只需设定 Hub 而不用设定其他 Spoke 是因为
R1(config-if)# ! Spoke Router 未来会用 NHRP 向 Hub 查询其他 Spoke Router 的位置
R2(config-if)#ip nhrp map 172.16.123.1 10.0.14.1
R1(config-if)# ! 用作 Routing Protocol 沟通的 Multicast Traffic 全部传到 Hub
R2(config-if)#ip nhrp map multicast 10.0.14.1

设定完成後,在 R1 用指令 show dmvpn 可以看到 R2 已向 R1 注册自己的 NBMA 和 Tunnel Address,R1 亦已把这些资料记录起来。

R1#show dmvpn
Legend: Attrb --> S - Static, D - Dynamic, I - Incomplete
        N - NATed, L - Local, X - No Socket
        # Ent --> Number of NHRP entries with same NBMA peer
        NHS Status: E --> Expecting Replies, R --> Responding
        UpDn Time --> Up or Down Time for a Tunnel
==========================================================================

Interface: Tunnel0, IPv4 NHRP Details
Type:Hub, NHRP Peers:1,

 # Ent  Peer NBMA Addr Peer Tunnel Add State  UpDn Tm Attrb
 ----- --------------- --------------- ----- -------- -----
     1       10.0.24.2    172.16.123.2    UP 00:01:36     D

另一个可以用来确认的指令是 show ip nhrp

R1#show ip nhrp
172.16.123.2/32 via 172.16.123.2
   Tunnel0 created 00:02:06, expire 01:57:53
   Type: dynamic, Flags: unique registered
   NBMA address: 10.0.24.2

所以 R1 和 R2 的 Tunnel Interface 已经可以 ping 通了。

R2#ping 172.16.123.1 source 172.16.123.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.123.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/40/72 ms

确认没问题的话,只需把 R2 的设定,稍微更改一下 Tunnel IP Address,然後直接放进 R3 便可。

R3(config)#interface Tunnel0
R3(config-if)#ip address 172.16.123.3 255.255.255.0
R3(config-if)#tunnel source Ethernet1/0
R3(config-if)#tunnel destination 10.0.14.1
R3(config-if)#ip nhrp network-id 1
R3(config-if)#ip nhrp nhs 172.16.123.1
R3(config-if)#ip nhrp map 172.16.123.1 10.0.14.1
R3(config-if)#ip nhrp map multicast 10.0.14.1

如此一来,就算有 100 个丶1000 个 Spoke Site,设定都变得轻松了。

R3#ping 172.16.123.2 source 172.16.123.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.123.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/128/356 ms
R3#
R3#ping 172.16.123.1 source 172.16.123.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.123.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/26/40 ms

设定 Routing Protocol

Tunnel Interface 能够互通後,便可以设定 Routing Protocol 以交换各 Spoke Site 的 Route。以 EIGRP 为例子,只需简单设定几个 Network 指令,唯一要注意的是 R1 的 Tunnel 0 interface 要做多一点工夫。由於 R2 把 Route 传给 R1 的 Tunnel 0,预设情况下,基於 Split Horizon 规则,R1 无法把 Route 回传给 R3,反之亦然。因此要在 Tunnel 0 把 Split Horizon 关掉。

R1(config)#router eigrp 1
R1(config-router)#no auto-summary
R1(config-router)#network 172.16.123.0 0.0.0.255
R1(config-router)#network 192.168.1.0 0.0.0.255
R1(config-router)#exit
R1(config)#interface tunnel 0
R1(config-if)#no ip split-horizon eigrp 1
R2(config)#router eigrp 1
R2(config-router)#no auto-summary
R2(config-router)#network 172.16.123.0 0.0.0.255
R2(config-router)#network 192.168.2.0 0.0.0.255
R3(config)#router eigrp 1
R3(config-router)#no auto-summary
R3(config-router)#network 172.16.123.0 0.0.0.255
R3(config-router)#network 192.168.3.0 0.0.0.255

确认一下大家都收到 EIGRP 传来的 Route。

R1#show ip route eigrp 1
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, + - replicated route

Gateway of last resort is not set

D     192.168.2.0/24 [90/27008000] via 172.16.123.2, 00:49:55, Tunnel0
D     192.168.3.0/24 [90/27008000] via 172.16.123.3, 00:49:54, Tunnel0
R2#show ip route eigrp 1
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, + - replicated route

Gateway of last resort is not set

D     192.168.1.0/24 [90/27008000] via 172.16.123.1, 00:48:54, Tunnel0
D     192.168.3.0/24 [90/28288000] via 172.16.123.1, 00:04:11, Tunnel0
R3#show ip route eigrp 1
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, + - replicated route

Gateway of last resort is not set

D     192.168.1.0/24 [90/27008000] via 172.16.123.1, 00:49:37, Tunnel0
D     192.168.2.0/24 [90/28288000] via 172.16.123.1, 00:04:55, Tunnel0

留意各 Route 的 Next Hop, R2 需要经 R1 才能到达 R3,同样地 R3 需要经 R1 才能到达 R2。

R2#traceroute 192.168.3.3 source 192.168.2.2

Type escape sequence to abort.
Tracing the route to 192.168.3.3

  1 172.16.123.1 12 msec 36 msec 44 msec
  2 172.16.123.3 72 msec 68 msec 64 msec
 
R2#
R2#show ip cef 192.168.3.0/24
192.168.3.0/24
  nexthop 172.16.123.1 Tunnel0

Summary Route

在 DMVPN Phase 1,由於我们知道所有 Spoke-to-spoke Traffic 都必先经 Hub 才能到达,Spoke Router 收到由其他 Spoke Router 传来的 Route 变得意义不大,反正都要先经 Hub,我们大可以在 Hub 发布 Summary Route 来减少 Spoke Router 的 Route 数量。

R1(config-if)#ip summary-address eigrp 1 192.168.0.0 255.255.252.0

於是,所有 Spoke Router 只会收到一条 Summary Route 指向 Hub。

R2#show 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, + - replicated route

Gateway of last resort is not set

D     192.168.0.0/22 [90/27008000] via 172.16.123.1, 00:00:44, Tunnel0
R3#show ip route eigrp 1
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, + - replicated route

Gateway of last resort is not set

D     192.168.0.0/22 [90/27008000] via 172.16.123.1, 00:01:36, Tunnel0

留意这招在 RIP 和 EIGRP 等 Distance Vector 特性的 Routing Protocol 中使用比较方便,如果要在 OSPF 中使用则变得困难,因为 OSPF 只能在 ABR 或 ASBR 发布 Summary Route。

DMVPN Phase 2

很明显,DMVPN Phase 1 的缺点在於所有 Spoke-to-spoke 的 Data Traffic 必先经过 Hub,因为 Spoke Router 只与 Hub Router 建立 Tunnel。升级至 Phase 2 则可建立 Spoke-to-spoke Tunnel (Fully Mesh) 让 Data Traffic 直接由 Spoke Router 到达另一只 Spoke Router。

R2(config)#interface tunnel 0
R2(config-if)#no tunnel destination
R2(config-if)# ! 把 Tunnel 改成 Multipoint Mode
R2(config-if)#tunnel mode gre multipoint
R3(config)#interface tunnel 0
R3(config-if)#no tunnel destination
R3(config-if)# ! 把 Tunnel 改成 Multipoint Mode
R3(config-if)#tunnel mode gre multipoint

然後必需把所有 Tunnel Interface Shutdown,先重开 Hub Router 的 Tunnel Interface,再重开各 Spoke Router 的 Tunnel Interface,设定才会生效。完成设定之後再做一次 Traceroute。

R2#traceroute 172.16.123.3

Type escape sequence to abort.
Tracing the route to 172.16.123.3

  1 172.16.123.1 36 msec 12 msec
    172.16.123.3 44 msec

为什麽仍然要经过 Hub?再做一次看看。发现 CEF Table 的指向已经被直接更新了,这当然是拜 NHRP 所赐。

R2#traceroute 172.16.123.3

Type escape sequence to abort.
Tracing the route to 172.16.123.3

  1 172.16.123.3 32 msec 20 msec 20 msec
R2#
R2#show ip cef 172.16.123.3
172.16.123.3/32
  attached to Tunnel0

由於 Spoke 已经可以直接到达其他 Spoke,刚才我们设的那条 Summary Route 已经不合时,赶快把它拿掉。另一方面,我们不再希望 Data Traffic 跑到 Hub 这边来了,所以要关掉 next-hop-self。

R1(config-if)#no ip summary-address eigrp 1 192.168.0.0 255.255.252.0
R1(config-if)#no ip next-hop-self eigrp 1

现在 Spoke Router 里 Route 的 Next Hop 都会直接指向目的地。

R2#show ip route eigrp 1
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, + - replicated route

Gateway of last resort is not set

D     192.168.1.0/24 [90/27008000] via 172.16.123.1, 00:00:18, Tunnel0
D     192.168.3.0/24 [90/28288000] via 172.16.123.3, 00:00:18, Tunnel0
R3#show ip route eigrp 1
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, + - replicated route

Gateway of last resort is not set

D     192.168.1.0/24 [90/27008000] via 172.16.123.1, 00:00:54, Tunnel0
D     192.168.2.0/24 [90/28288000] via 172.16.123.2, 00:00:52, Tunnel0

Traceroute 一下便可确认 Spoke-to-spoke Connection 达成!

R2#traceroute 192.168.3.3 source 192.168.2.2

Type escape sequence to abort.
Tracing the route to 192.168.3.3

  1 172.16.123.3 8 msec 40 msec 32 msec
R3#traceroute 192.168.2.2 source 192.168.3.3

Type escape sequence to abort.
Tracing the route to 192.168.2.2

  1 172.16.123.2 16 msec 36 msec 40 msec

DMVPN Phase 3

DMVPN Phase 2 的优点是能够实现 Spoke-to-spoke 连线,可惜却不能使用 Summary Route。这是因为当我们在 Hub 发布 Summary Route,所有 Traffic 又跑回来 Hub 了。所以鱼与熊掌,不可兼得吗?答案是可以的,就是使用 DMVPN Phase 3。

R1(config)#interface tunnel 0
R1(config-if)# ! 首先在 Hub 设定 Summary Route 和 next-hop-self 把 Data Traffic 抢回来
R1(config-if)#ip summary-address eigrp 1 192.168.0.0 255.255.252.0
R1(config-if)#ip next-hop-self eigrp 1
R1(config-if)# ! 加入这个指令便完成设定 Phase 3,一会再解说
R1(config-if)#ip nhrp redirect

而所有 Spoke 则加入 ip nhrp shortcut 指令,记得要重启所有 Tunnel Interface。

R2(config)#interface tunnel 0
R2(config-if)#ip nhrp shortcut
R3(config)#interface tunnel 0
R3(config-if)#ip nhrp shortcut

看 R2 的 Route Table,指向 Hub 了。

R2#show ip route eigrp 1
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, + - replicated route

Gateway of last resort is not set

D     192.168.0.0/22 [90/27008000] via 172.16.123.1, 00:00:14, Tunnel0
R2#
R2#show ip cef 192.168.3.0/24
192.168.3.0/24
  nexthop 172.16.123.1 Tunnel0

做一次 Traceroute 後,Traffic 果然去了 Hub。

R2#traceroute 192.168.3.3 source 192.168.2.2

Type escape sequence to abort.
Tracing the route to 192.168.3.3

  1 172.16.123.1 20 msec 36 msec 36 msec
  2 172.16.123.3 68 msec 64 msec 48 msec

但再做一次的话,发现结果已经不同了,Traffic 直接由 R2 到 R3。因为 NHRP 已经帮我们查询了 R3 的位置。Hub 的 ip nhrp redirect 指令帮我们更新 Spoke,而 Spoke 的 ip nhrp shortcut 指令则表示接受这更新。

R2#traceroute 192.168.3.3 source 192.168.2.2

Type escape sequence to abort.
Tracing the route to 192.168.3.3

  1 172.16.123.3 64 msec 60 msec 16 msec
R2#
R2#show ip nhrp
172.16.123.1/32 via 172.16.123.1
   Tunnel0 created 00:00:37, never expire
   Type: static, Flags: used
   NBMA address: 10.0.14.1
192.168.3.3/32 via 172.16.123.3
   Tunnel0 created 00:00:01, expire 01:59:58
   Type: dynamic, Flags: router used
   NBMA address: 10.0.34.3

DMVPN 与 OSPF

OSPF 与 DMVPN 的相容性较 EIGRP 和 RIP 低,不太建议使用,如果坚持使用 OSPF 的话,则需注意以下要点。

强制 Hub 成为 DR

由於 Spoke 与 Spoke 之间的 Multicast 不互通,所以 Spoke 之间无法成为 Neighbor,幸好 OSPF Router 只需和 DR 沟通即可同步 OSPF Database。因此,在 DMVPN 使用 OSPF 必需把 Hub 设定成 DR,最有效的方法是把 Spoke Router 的 priority 设成 0 使其无法参与 DR 选举。

R2(config)#interface tunnel 0
R2(config-if)#ip ospf priority 0

当然我们可以把 OSPF Network Type 改成 Multipoint Broadcast 去禁止 DR 选举,但这样就让 Spoke-to-spoke Topology 无法建立了。

Summary Route 有困难

DMVPN Phase 3 的精綷在於发布 Summary Route 让 Spoke Router 的 Route 数量减少,但 OSPF 只能在 ABR 和 ASBR 发布 Summary Route,所以当所有 Spoke 和 Hub 都在同一个 Area 里,Phase 3 是无法达成的,只能使用 Phase 2 了。当然我们可以故意把每一个 Spoke 放在不同 Area 使 Hub 成为 ABR,但设定相当复杂,与 DMVPN 简单设定的目标背道而驰。

Tunnel 认证

由於只要知道 NHRP 的 IP 便可与之建立 Tunnel,基於保安理由,我们可以在 Tunnel 加入一些认证,第一个方法是 Tunnel Key。设置相同 Tunnel Key 的 Tunnel 方可成功建立,设定如下。

R1(config)#int tunnel 0
R1(config-if)#tunnel key 1234
R2(config)#int tunnel 0
R2(config-if)#tunnel key 1234

另外,在 NHRP 也可以加 Key 去做认证,Spoke 必需知道 Key 才可以向 Hub 注册,设定 key 後需要重启 Tunnel Interface。

R1(config)#int tunnel 0
R1(config-if)#ip nhrp authentication ccie
R2(config)#int tunnel 0
R2(config-if)#ip nhrp authentication ccie

IPSec

最後,我们可以用 IPSec 加密去保护资讯。设定上跟 GRE Tunnel 的 IPSec 没大分别,但由於每一个 Spoke-to-spoke Connection 和 Hub-to-spoke Connection 都会建 IPSec,要留意 isakmp key 希望设定成全部一样,还是希望每一个 destination 皆不同 (将会是恶梦 😥 ),如果全部一样的话,destination address 可用 0.0.0.0 0.0.0.0。

首先在 R1丶R2 和 R3 都设定 IKE Phase 1 参数,详细说明请参考这里

R1(config)#crypto isakmp policy 10
R1(config-isakmp)#authentication pre-share

然後分别在 R1丶R2 和 R3 设定 Phase 2 参数,详细说明请参考这里

R1(config)#crypto ipsec transform-set TS esp-3des esp-sha-hmac
R1(cfg-crypto-trans)#exit

然後分别在 R1丶R2 和 R3 设定 Pre-share Key,假设全部 Connection 使用相同的 Key。

R1(config)#crypto isakmp key ccie address 0.0.0.0 0.0.0.0

跟着,分别在 R1丶R2 和 R3 定义 IPSec Profile。

R1(config)#crypto ipsec profile PF
R1(ipsec-profile)#set transform-set TS

最後在所有 Tunnel 都设定使用 IPSec Profile。

R1(config)#interface tunnel 0
R1(config-if)#tunnel protection ipsec PRofile PF

DMVPN 与 GETVPN 之比较

GETVPN 与 DMVPN 都有着简化 Remote Site 设定的效果,而 DMVPN 比 GETVPN 较好的地方是在 Internet 的支缓。对於 Internet 上的 VPN Router,GETVPN 是无能为力的,因为 GETVPN 的 Tunnel Mode 为 IP Header Preservation,而 Private IP Address 无法在 Internet 上被 Route。这情况便得使用 DMVPN 了。

相關主題

发表回复

2021-07-22

Posted In: 虚拟私人网路 VPN

Leave a Comment