VPN Technologies · Topic 3 of 3
DMVPN with a Single Hub
Configure and verify a single hub DMVPN on IOS XE using mGRE, NHRP, IPsec, dynamic routing neighbours and spoke to spoke tunnels in phases 1 to 3.
- 6 min
- Includes a diagram
- DMVPN is mGRE, NHRP, IPsec and a routing protocol.
- The hub is the NHS. Spokes register with it.
ip nhrp map multicast dynamicon the hub lets routing neighbours form.
What it is
DMVPN builds a hub and spoke VPN where spokes can also create direct tunnels to each other on demand.
It combines four things.
- mGRE gives one tunnel interface that reaches many peers.
- NHRP maps tunnel addresses to public addresses.
- IPsec protects the tunnels.
- A routing protocol shares the networks.
The result scales well, because a new spoke needs only its own configuration and the hub needs no change.
How it works
The hub learns each spoke's public address through NHRP, and spokes ask the hub where to find each other.
GRE, mGRE and NHRP
A normal GRE tunnel has one fixed destination. An mGRE tunnel has no fixed destination, so one interface can send to many peers.
NHRP works like ARP for tunnels. Each spoke registers its tunnel address and public (NBMA) address with the hub, which is the next hop server (NHS). The hub keeps the mapping table.
Hub configuration
Hub(config)# interface Tunnel0
Hub(config-if)# ip address 172.16.0.1 255.255.255.0
Hub(config-if)# ip nhrp network-id 1
Hub(config-if)# ip nhrp map multicast dynamic
Hub(config-if)# tunnel source GigabitEthernet0/0
Hub(config-if)# tunnel mode gre multipoint
Hub(config-if)# tunnel protection ipsec profile DMVPN-PROF
The ip nhrp map multicast dynamic line makes the hub send multicast, such as routing hellos, to every spoke that registers. This is how routing neighbours form dynamically.
Spoke configuration
Spoke1(config)# interface Tunnel0
Spoke1(config-if)# ip address 172.16.0.2 255.255.255.0
Spoke1(config-if)# ip nhrp network-id 1
Spoke1(config-if)# ip nhrp nhs 172.16.0.1
Spoke1(config-if)# ip nhrp map 172.16.0.1 203.0.113.1
Spoke1(config-if)# ip nhrp map multicast 203.0.113.1
Spoke1(config-if)# tunnel source GigabitEthernet0/0
Spoke1(config-if)# tunnel mode gre multipoint
Spoke1(config-if)# tunnel protection ipsec profile DMVPN-PROF
The spoke maps the hub tunnel address to the hub public address, here 203.0.113.1. It also sends multicast to the hub. A spoke that only talks to the hub, as in phase 1, can use a point to point GRE tunnel with a tunnel destination instead.
IPsec protection
The profile is applied to the tunnel interface, and it needs an IKE policy, a key and a transform set.
Hub(config)# crypto isakmp policy 10
Hub(config-isakmp)# encryption aes
Hub(config-isakmp)# authentication pre-share
Hub(config)# crypto isakmp key MYKEY address 0.0.0.0 0.0.0.0
Hub(config)# crypto ipsec transform-set TS esp-aes esp-sha-hmac
Hub(cfg-crypto-trans)# mode transport
Hub(config)# crypto ipsec profile DMVPN-PROF
Hub(ipsec-profile)# set transform-set TS
The key is matched against any peer address, because spoke public addresses may be unknown or change. Both ends must have the same policy and key.
Dynamic routing and the phases
A routing protocol runs across the tunnel. The hub learns spoke networks, and passes them on to the other spokes.
| Phase | Spoke tunnel | Routing behaviour | Spoke to spoke |
|---|---|---|---|
| 1 | Point to point GRE | Hub summarizes or sends a default | No, all traffic goes through the hub |
| 2 | mGRE | Hub passes specific routes and keeps the original next hop | Yes, by resolving the next hop with NHRP |
| 3 | mGRE | Hub can summarize or send a default | Yes, after an NHRP redirect and shortcut |
For phase 3, the hub gets ip nhrp redirect and the spokes get ip nhrp shortcut. The hub tells a spoke that a better path exists, and the spokes then build a direct tunnel and install an NHRP route.
With EIGRP on the hub, split horizon must be off, and for phase 2 the next hop must not be changed.
Hub(config-if)# no ip split-horizon eigrp 100
Hub(config-if)# no ip next-hop-self eigrp 100
With OSPF, the tunnel is usually set to the broadcast network type. The hub must be the DR, so spokes use priority 0. With BGP, the hub can accept spokes without listing each one by using a bgp listen range peer group, a form of dynamic neighbour.
Verifying
Hub# show dmvpn
Hub# show ip nhrp
Hub# show crypto isakmp sa
Hub# show crypto ipsec sa
show dmvpn lists each peer, its NBMA address and the state. A state of UP means the tunnel is working. Other states, such as IKE or NHRP, mean the peer has not yet reached UP, so check the IPsec and NHRP steps.
Troubleshoot DMVPN in order: underlay ping, IPsec, NHRP registration, then routing.
What to remember for the exam
Eight facts cover most questions on this topic.
- DMVPN is mGRE, NHRP, IPsec and a routing protocol.
- The hub is the NHS. Spokes register with it.
ip nhrp map multicast dynamicon the hub lets routing neighbours form.- Spokes need the NHS mapping to the hub public address.
tunnel protection ipsec profileapplies IPsec to the tunnel.- Phase 1 has no direct spoke to spoke tunnels.
- Phase 3 uses
ip nhrp redirecton the hub andip nhrp shortcuton spokes. show dmvpnshows peers and states.
If the underlay cannot reach the hub public address, nothing else in DMVPN will work.
Common mistakes
These five mistakes appear often.
Wrong NHS mapping on a spoke. The spoke cannot register, because it has the wrong hub public address.
Forgetting multicast mapping. Routing hellos do not cross and no neighbour forms.
Leaving split horizon on at the hub. Spokes do not learn each other's networks.
Mismatched IPsec policy or key. The tunnel stays at the IKE state.
Mixing phases. A phase 3 summary at the hub breaks phase 2 behaviour.
Check yourself
Work through these three questions.
What does a spoke register with the hub?
It registers its tunnel address mapped to its public NBMA address using NHRP.
Which two commands enable phase 3 spoke to spoke shortcuts?
ip nhrp redirecton the hub andip nhrp shortcuton the spokes.Why is
ip nhrp map multicast dynamicconfigured on the hub?It makes the hub replicate multicast to every registered spoke, so routing neighbours form.
Topic 3 of 3 in VPN Technologies
Test yourself on VPN Technologies
The full Cisco CCNP 300-410 ENARSI question bank has 857 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Cisco. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.