2.3 Configure and verify a single-hub DMVPN
ENARSI 300-410 v1.1 · 2.0 VPN Technologies
DMVPN builds a full mesh of encrypted tunnels from one hub configuration. Every router has one multipoint GRE tunnel interface; NHRP maps each tunnel address to the router's real (NBMA) address; IPsec protects the traffic; a routing protocol runs over the tunnel; and in phase 3, spokes build direct spoke-to-spoke tunnels on demand.
What you must know
- Compare point-to-point GRE and mGRE, and configure the tunnel interface.
- Explain NHRP registration, resolution, redirect and shortcut.
- Protect the tunnels with an IPsec profile.
- Run EIGRP or OSPF over DMVPN with dynamic neighbours.
- Describe phases 1, 2 and 3 and verify spoke-to-spoke tunnels.
GRE and multipoint GRE
A point-to-point GRE tunnel has one tunnel destination; ten sites in a mesh need 45 tunnels. A multipoint GRE tunnel has none: tunnel mode gre multipoint, and the destination for each packet comes from NHRP. The hub has one mGRE interface for every spoke; spokes can be point-to-point (phase 1) or mGRE (phases 2 and 3).
interface Tunnel0
ip address 172.16.0.1 255.255.255.0
ip mtu 1400
ip tcp adjust-mss 1360
tunnel source GigabitEthernet0/0
tunnel mode gre multipoint
tunnel key 100GRE adds 24 bytes and IPsec up to about 70 more, so lower the tunnel's IP MTU to 1400 and the TCP MSS to 1360, or large packets are fragmented or dropped.
NHRP
| Message | Who sends it | What it does |
|---|---|---|
| Registration request | Spoke → hub (NHS) | "Tunnel 172.16.0.11 is at NBMA 198.51.100.11" |
| Resolution request | Spoke → hub (forwarded) | "Where is the router behind 172.16.0.12?" |
| Redirect (phase 3) | Hub → spoke | "You sent this through me; ask the other spoke directly" |
| Resolution reply | Target spoke → asking spoke | The NBMA address, so a direct tunnel can be built |
! Hub
interface Tunnel0
ip nhrp network-id 1
ip nhrp authentication DMVPN1
ip nhrp map multicast dynamic
ip nhrp redirect
!
! Spoke
interface Tunnel0
ip address 172.16.0.11 255.255.255.0
ip nhrp network-id 1
ip nhrp authentication DMVPN1
ip nhrp nhs 172.16.0.1 nbma 203.0.113.1 multicast
ip nhrp shortcut
tunnel source GigabitEthernet0/0
tunnel mode gre multipoint
tunnel key 100IPsec protection
crypto isakmp policy 10
encryption aes 256
hash sha256
authentication pre-share
group 14
crypto isakmp key DMVPN-KEY address 0.0.0.0
!
crypto ipsec transform-set TS esp-aes 256 esp-sha256-hmac
mode transport
crypto ipsec profile DMVPN-PROF
set transform-set TS
!
interface Tunnel0
tunnel protection ipsec profile DMVPN-PROFtunnel protection encrypts whatever the tunnel sends; no crypto ACL is needed. Transport mode saves 20 bytes because GRE already adds an outer IP header. A mismatched ISAKMP policy or key leaves NHRP registration failing, so the spoke never appears on the hub.
Dynamic neighbours
The hub needs no per-spoke configuration: a spoke registers, the hub learns its NBMA address, and routing hellos sent to the multicast mapping reach it. That gives dynamic neighbours.
| Protocol | On the hub's tunnel | Why |
|---|---|---|
| EIGRP | no ip split-horizon eigrp 100 (phase 1/2), no ip next-hop-self eigrp 100 (phase 2) | Spokes must learn each other's routes, with the other spoke as next hop in phase 2 |
| OSPF | ip ospf network point-to-multipoint (phase 1/3) or broadcast with the hub as DR and spokes priority 0 (phase 2) | One subnet, many neighbours; spokes must never become DR |
| BGP | bgp listen range 172.16.0.0/24 peer-group SPOKES | The hub accepts spokes without a neighbor line each |
Spoke-to-spoke tunnels
| Phase | Spoke tunnel | Routing | Spoke-to-spoke |
|---|---|---|---|
| 1 | Point-to-point GRE | Hub can summarize | No: always through the hub |
| 2 | mGRE | Hub must keep the other spoke as next hop (no summary) | Yes, triggered by the routing table |
| 3 | mGRE + ip nhrp shortcut | Hub can summarize; NHRP overrides the next hop | Yes, triggered by NHRP redirect |
The first packets go through the hub (1); the hub's redirect makes SPOKE1 resolve SPOKE2, and the next packets take the direct tunnel (2). In show ip route the shortcut appears as an H (NHRP) route, or as a % next-hop override.
SPOKE1# show dmvpn
Interface: Tunnel0, IPv4 NHRP Details
Type:Spoke, NHRP Peers:2,
# Ent Peer NBMA Addr Peer Tunnel Add State UpDn Tm Attrb
----- --------------- --------------- ----- -------- -----
1 203.0.113.1 172.16.0.1 UP 00:12:01 S
1 198.51.100.12 172.16.0.12 UP 00:00:09 DCommands
show dmvpn [detail] | Peers per tunnel: NBMA and tunnel addresses, state, static or dynamic. |
show ip nhrp [brief] | The NHRP cache: mappings, expiry, flags. |
show crypto isakmp sa / show crypto ipsec sa | Phase 1 and phase 2 security associations and their counters. |
show ip route nhrp | Shortcut routes installed by NHRP (phase 3). |
debug nhrp packet | Registration, resolution and redirect messages. |
Exam traps
tunnel keyandip nhrp network-idmust match the cloud; the NHRP authentication string too.- Without
ip nhrp map multicast dynamicon the hub, routing hellos never reach the spokes. - EIGRP split horizon on the hub stops spokes learning each other's routes in phases 1 and 2.
- In phase 2, a summary on the hub breaks spoke-to-spoke; phase 3 allows it.
- OSPF broadcast on DMVPN needs the hub as DR and every spoke at priority 0.
- A tunnel whose source route goes through the tunnel itself flaps (recursive routing).
Check yourself
- What does a spoke register with the hub?
- Its tunnel address and its NBMA (real) address.
- Which two commands enable phase 3?
ip nhrp redirecton the hub,ip nhrp shortcuton the spokes.- Why is
mode transportused in the transform set? - GRE already provides the outer IP header, so tunnel mode would add 20 bytes for nothing.
- Spokes see the hub as an EIGRP neighbour but not each other's routes. Fix?
no ip split-horizon eigrp <as>on the hub's tunnel.- What do the S and D attributes mean in
show dmvpn? - Static mapping (the NHS) and dynamic mapping (learned by NHRP).
Labs
- DMVPN: one hub, two spokes, IPsec and spoke-to-spoke shortcuts
- iBGP over DMVPN: dynamic neighbours and a route reflector on the hub
Try it live: DMVPN: one hub, two spokes, IPsec and spoke-to-spoke shortcuts