Configuration Lesson · Site-to-Site VPNs: IPsec, DMVPN, FlexVPN & GETVPN
Implement Site-to-Site FlexVPN with Local AAA Authorization
Free Lesson All-Access unlocks every lesson in every course — $489/yr, with $647 of founders bonuses while the window is open, and it carries The Next Year Promise. Reserve founders bonuses →
Objective 1.3 is “Implement FlexVPN using local AAA”; 4.3 asks you to identify the VPN technology from configuration output. Walking out of this lesson, you can:
- Build a FlexVPN hub with a virtual template, an IKEv2 profile and per-branch authorization policies in local AAA
- Push a tunnel address and routes to each branch over IKEv2, with no routing protocol on the tunnel
- Read the IKEv2 debug that shows the identity, the AAA lookup and the config exchange
- Tell FlexVPN from DMVPN in configuration and session output
No additional IOS feature licence is needed for this lab on the CML IOSv 15.9(3)M12 image; other platforms and images differ.
Overview
FlexVPN is Cisco’s IKEv2-based framework for site-to-site and remote-access VPNs on IOS. In the design built here, the hub hands each branch an address and a set of routes inside the IKEv2 exchange itself, so the tunnel needs no routing protocol. The part that trips people up is authorization: get the policy lookup wrong and the branch fails with an authentication error while its key is correct. This lesson migrates the DMVPN branches from the previous lesson onto FlexVPN, with the policies held in the hub’s local AAA.
Terminology: The Four Pieces on the Hub
A FlexVPN hub rests on four key components, each with one job (the IKEv2 proposal, keyring, AAA method list and pools sit underneath them):
-
Virtual template — a tunnel interface that is never used directly. Each branch that connects gets a virtual-access interface cloned from it, with that branch’s outside (NBMA) address as the tunnel destination.
-
IKEv2 profile — the rules for accepting a peer: which identities match, how they authenticate, and which virtual template to clone.
-
Name mangler — Cisco’s FlexVPN guide says it is “used to derive the username for IKEv2 authorization … from the peer IKE identity.” It trims an identity such as
branch-1.example.comdown to a username such asbranch-1. It reads whatever identity type the peer sends:fqdn {all | domain | hostname},email {all | domain | username}, a field of a certificate’s distinguished name (dn common-name,dn organization-unitand so on), or an EAP identity. -
IKEv2 authorization policy — what a peer gets once it is authorized: an address pool, and the routes to push. With local AAA, these policies live on the hub, named by the username the mangler produces. The profile can run two lookups.
aaa authorization groupis meant for the generic part of an identity, such as a domain shared by many peers.aaa authorization useris meant for the peer-specific part, such as one hostname.- When both run, their attributes merge, and
overrideon the group line lets the group win.
This lesson uses a group lookup keyed by the hostname, which gives one policy per branch with a single line. A policy can also pull per-session interface settings from an
aaa attribute list.
In the DMVPN lesson, NHRP registration and a routing protocol did the signalling. In this FlexVPN design, IKEv2 does all of it: authentication, address assignment and route exchange travel in the key-management protocol that already establishes the IPsec SAs. FlexVPN can also run a routing protocol, or NHRP for spoke-to-spoke; this lesson uses IKEv2 route exchange alone.
Engine Behavior: How a Branch Gets Its Address and Routes
IKEv2 has a configuration payload (RFC 7296, section 3.15) that carries attributes such as an internal address and internal subnets in IKE_AUTH. FlexVPN uses it for site-to-site routing, and adds a Cisco-specific step in which the branch advertises its own routes back. Here is one branch coming up, in the order an IKEv2 debug logs it:
- The branch sends an empty request (figure steps 1–2). Its
IKE_AUTHcarries its FQDN identity and a config request with blankipv4-addrandipv4-subnetattributes: “give me an address, tell me your networks.” - The hub authorizes it locally (steps 3–4). The mangler turns the identity into a username, and the local AAA list returns the authorization policy with that name.
- The hub replies with the policy’s contents (step 5). The
IKE_AUTHresponse carries a config reply: an address from the branch’s pool, plus the subnets in the policy’s route set. - The branch answers with its own networks (steps 6–7). Right after
IKE_AUTH, the branch sends a config set in anINFORMATIONALexchange listing its LAN, and the hub acknowledges it. TheCFG_SETandCFG_ACKmessage types are standard IKEv2 (RFC 7296, section 3.15); using them to advertise routes back to the hub is FlexVPN’s.
IOS on both sides installs what it received as static routes on the tunnel. No routing protocol runs over it.
Why does an authorization problem show up as AUTHENTICATION_FAILED?
Because IOS fails the whole IKE_AUTH exchange. Authentication and authorization both happen in that one exchange, IKEv2 defines no separate “authorization failed” notify, and on this lab’s IOSv 15.9 image a failed authorization came back as AUTHENTICATION_FAILED, the same notify as a wrong key. The key can be perfect; only the hub’s debug says which half failed.
Design Choice: FlexVPN or DMVPN
Both designs can run on IKEv2 and IPsec (DMVPN also works with IKEv1). What differs is who does the signalling, and it shows in the configuration:
| You see | It is |
|---|---|
tunnel mode gre multipoint, ip nhrp | DMVPN |
interface Virtual-Template ... type tunnel, virtual-template in an IKEv2 profile | FlexVPN hub |
ip address negotiated on a tunnel mode ipsec ipv4 interface, with an IKEv2 profile and authorization | FlexVPN spoke |
crypto ikev2 authorization policy with route set | FlexVPN routing over IKEv2 |
Choose FlexVPN when branches need to be treated differently: their own addresses, their own routes, their own access. In this design every branch session passes through an authorization lookup, from local AAA or, at scale, from RADIUS, and that lookup is the natural place to hang per-peer policy. (FlexVPN does not require one: a statically addressed VTI with an IKEv2 profile and ordinary routing runs without AAA at all.) DMVPN can differentiate peers too, but through profiles, credentials and routing policy spread across the config. Choose DMVPN when you need direct spoke-to-spoke paths across a large cloud today and the branches are alike: Phase 3 builds those shortcuts as part of its design (ip nhrp redirect and ip nhrp shortcut), where FlexVPN needs NHRP added to do the same.
💬 Real Talk: The most common way to lose a router in this lesson has nothing to do with IKEv2. aaa new-model in Step 1 moves login handling to AAA method lists, and on a router you reach over SSH with no login method configured, the next session can fail to log in. In a lab you walk to the console. In production that router is three hundred miles away. aaa authentication login is only accepted once aaa new-model is on, so the order that keeps you in is: a local username first, then aaa new-model and aaa authentication login default local in the same session, then a second SSH login to prove it works before you close the first.
🔬 Lab Starting State
This lesson starts from the end of Implement DMVPN: mGRE, NHRP & IPsec Protection Across the Phases:
- ✅
R-HUB-01,R-BRANCH-01andR-BRANCH-02run the protected Phase 3 DMVPN onTunnel0 - ✅ The IKEv2 proposal
PROP-DMVPN(group 19) and policyPOL-DMVPNare configured on all three - ✅
WS-BRANCH-01reachesWS-BRANCH-02and10.10.10.254over the DMVPN
Not all checkboxes green? Load the end-state configs from Implement DMVPN: mGRE, NHRP & IPsec Protection Across the Phases onto the three routers.
Lab Reference
This lesson uses the SVPN lab topology. All examples reference these specific devices and IP addresses.
| Device | Interface | Address | Role |
|---|---|---|---|
R-HUB-01 | GigabitEthernet0/0 | 198.51.100.10/24 | Hub outside |
R-HUB-01 | Loopback11 | 10.255.11.254/32 | Unnumbered source for the virtual template |
R-HUB-01 | Loopback10 | 10.10.10.254/24 | HQ servers prefix |
R-HUB-01 | Virtual-Access1, 2 | unnumbered to Loopback11 | One per connected branch |
R-BRANCH-01 | Tunnel11 | 10.255.11.1/32, negotiated | Spoke 1 FlexVPN tunnel |
R-BRANCH-02 | Tunnel11 | 10.255.11.2/32, negotiated | Spoke 2 FlexVPN tunnel |
WS-BRANCH-01 | ens2 | 10.20.1.10/24 | Branch 1 host |
WS-BRANCH-02 | eth0 | 10.20.2.10/24 | Branch 2 host |
Topology
The physical lab is unchanged from the DMVPN lesson. What changes is the overlay: two separate IPsec tunnels, each branch to the hub, instead of one multipoint cloud. Branch-to-branch traffic now crosses the hub.
Configuration
Scenario 1: Move Both Branches to FlexVPN With Per-Branch Policies
The network team wants each branch to get a fixed tunnel address and its routes from the hub, with the policy for every branch held in one place. DMVPN stays configured but shut, for rollback.
| Parameter | Value |
|---|---|
| Hub template | Virtual-Template11, unnumbered to Loopback11 (10.255.11.254) |
| Identities | FQDN r-branch-01.securitylessons.lab, r-branch-02.securitylessons.lab, r-hub-01.securitylessons.lab |
| Local AAA list | FLEX-LOCAL |
| Per-branch pools | POOL-BR1 = 10.255.11.1, POOL-BR2 = 10.255.11.2 |
| Hub route set | 10.10.10.0/24 (ACL ACL-HQ-ROUTES) plus the hub’s own address |
Step 1 — retire DMVPN and turn on local AAA. On all three routers:
! Step 1a: keep the DMVPN config, stop using it
interface Tunnel0
shutdown
! Step 1b: authorization comes from the local database
aaa new-model
aaa authorization network FLEX-LOCAL localStep 2 — the hub’s per-branch policies. On R-HUB-01:
! Step 2a: one single-address pool per branch, and what HQ offers
ip local pool POOL-BR1 10.255.11.1 10.255.11.1
ip local pool POOL-BR2 10.255.11.2 10.255.11.2
ip access-list standard ACL-HQ-ROUTES
permit 10.10.10.0 0.0.0.255! Step 2b: the mangler keeps the hostname part of the FQDN
crypto ikev2 name-mangler NM-HOST
fqdn hostname
! Step 2c: one policy per branch, named for the mangled username
crypto ikev2 authorization policy r-branch-01
pool POOL-BR1
route set interface
route set access-list ACL-HQ-ROUTES
crypto ikev2 authorization policy r-branch-02
pool POOL-BR2
route set interface
route set access-list ACL-HQ-ROUTESroute set interface pushes the hub’s own tunnel address, 10.255.11.254, so the branch has a route to the far end of its tunnel. route set access-list pushes every prefix the ACL permits.
Step 3 — the hub’s profile and template. On R-HUB-01:
! Step 3a: one key for the whole domain, and who matches
crypto ikev2 keyring KR-FLEX
peer BRANCHES
identity fqdn domain securitylessons.lab
pre-shared-key SVPN-lab-FLEX-psk
crypto ikev2 profile IKEV2-FLEX-HUB
match identity remote fqdn domain securitylessons.lab
identity local fqdn r-hub-01.securitylessons.lab
authentication remote pre-share
authentication local pre-share
keyring local KR-FLEX
aaa authorization group psk list FLEX-LOCAL name-mangler NM-HOST
virtual-template 11! Step 3b: IPsec in tunnel mode, and the template every branch clones
crypto ipsec transform-set TS-FLEX esp-aes 256 esp-sha256-hmac
mode tunnel
crypto ipsec profile IPSEC-FLEX
set transform-set TS-FLEX
set ikev2-profile IKEV2-FLEX-HUB
interface Loopback11
ip address 10.255.11.254 255.255.255.255
interface Virtual-Template11 type tunnel
description FlexVPN hub - one virtual-access per branch
ip unnumbered Loopback11
ip mtu 1400
ip tcp adjust-mss 1360
tunnel source GigabitEthernet0/0
tunnel mode ipsec ipv4
tunnel protection ipsec profile IPSEC-FLEXThis time the transform set uses tunnel mode, and it has to: Cisco’s VTI guide, in its IOS XE 17.x edition, states that “the IPsec transform set must be configured in tunnel mode only.” A virtual tunnel interface has no GRE underneath, so ESP tunnel mode is what encapsulates the original packet, and a new outer IP header carries the ESP packet.
Step 4 — a spoke. On R-BRANCH-01 (on R-BRANCH-02, use r-branch-02, ACL-BR2-LAN and 10.20.2.0):
! Step 4a: what this branch offers back, in the default local policy
ip access-list standard ACL-BR1-LAN
permit 10.20.1.0 0.0.0.255
crypto ikev2 authorization policy default
route set interface
route set access-list ACL-BR1-LAN! Step 4b: identify by FQDN, and ask local AAA for the default policy
crypto ikev2 keyring KR-FLEX
peer R-HUB-01
address 198.51.100.10
pre-shared-key SVPN-lab-FLEX-psk
crypto ikev2 profile IKEV2-FLEX-SPOKE
match identity remote fqdn r-hub-01.securitylessons.lab
identity local fqdn r-branch-01.securitylessons.lab
authentication remote pre-share
authentication local pre-share
keyring local KR-FLEX
aaa authorization group psk list FLEX-LOCAL default! Step 4c: the tunnel asks for its address instead of having one
crypto ipsec transform-set TS-FLEX esp-aes 256 esp-sha256-hmac
mode tunnel
crypto ipsec profile IPSEC-FLEX
set transform-set TS-FLEX
set ikev2-profile IKEV2-FLEX-SPOKE
interface Tunnel11
ip address negotiated
ip mtu 1400
ip tcp adjust-mss 1360
tunnel source GigabitEthernet0/0
tunnel mode ipsec ipv4
tunnel destination 198.51.100.10
tunnel protection ipsec profile IPSEC-FLEXVerify: Each Branch Got Its Own Address and the HQ Routes
R-BRANCH-01# show ip interface brief | include Tunnel11|Gigabit
GigabitEthernet0/0 192.0.2.2 YES TFTP up up
GigabitEthernet0/1 10.20.1.1 YES TFTP up up
Tunnel11 10.255.11.1 YES manual up up
R-BRANCH-01# show ip route | begin Gateway
Gateway of last resort is 192.0.2.1 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 192.0.2.1
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
S 10.10.10.0/24 is directly connected, Tunnel11
C 10.20.1.0/24 is directly connected, GigabitEthernet0/1
L 10.20.1.1/32 is directly connected, GigabitEthernet0/1
C 10.255.11.1/32 is directly connected, Tunnel11
S 10.255.11.254/32 is directly connected, Tunnel11R-BRANCH-01 holds 10.255.11.1, the one address in POOL-BR1, so the mangler matched it to policy r-branch-01. The two S routes on Tunnel11 are the hub’s route set. Nobody typed them, and no EIGRP neighbour exists any more.
Verify: The Hub Built One Virtual-Access per Branch
R-HUB-01# show ip interface brief | include Virtual|Loopback11|Tunnel0
Loopback11 10.255.11.254 YES manual up up
Tunnel0 10.255.10.254 YES manual administratively down down
Virtual-Access1 10.255.11.254 YES unset up up
Virtual-Access2 10.255.11.254 YES unset up up
Virtual-Template11 10.255.11.254 YES unset up down
R-HUB-01# show ip route static | begin Gateway
Gateway of last resort is 198.51.100.254 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 198.51.100.254
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
S 10.20.1.0/24 is directly connected, Virtual-Access1
S 10.20.2.0/24 is directly connected, Virtual-Access2
S 10.255.11.1/32 is directly connected, Virtual-Access1
S 10.255.11.2/32 is directly connected, Virtual-Access2Each branch landed on its own virtual-access interface, and each branch’s config set became a static route through it. The template itself stays up/down: it is a pattern, not a tunnel. Cloning is visible directly:
R-HUB-01# show interfaces virtual-access 1 configuration
Virtual-Access1 is in use, but purpose is unknown
Derived configuration : 322 bytes
!
interface Virtual-Access1
description FlexVPN hub - one virtual-access per branch
ip unnumbered Loopback11
ip mtu 1400
ip tcp adjust-mss 1360
tunnel source GigabitEthernet0/0
tunnel mode ipsec ipv4
tunnel destination 192.0.2.2
tunnel protection ipsec profile IPSEC-FLEX
no tunnel protection ipsec initiate
endThe template’s lines, plus two the hub added itself. tunnel destination is filled in with R-BRANCH-01’s outside (NBMA) address, not its tunnel address. no tunnel protection ipsec initiate tells the virtual-access never to start IKEv2 itself: the hub only answers, and branches always dial in.
Verify: The Policies Are the Ones You Wrote
R-HUB-01# show crypto ikev2 authorization policy
IKEv2 Authorization Policy : default
route set interface
route accept any tag : 1 distance : 1
IKEv2 Authorization Policy : r-branch-01
IPV4 Address Pool : POOL-BR1
route set interface
route set acl: ACL-HQ-ROUTES
route accept any tag : 1 distance : 1
IKEv2 Authorization Policy : r-branch-02
IPV4 Address Pool : POOL-BR2
route set interface
route set acl: ACL-HQ-ROUTES
route accept any tag : 1 distance : 1Two things here were never typed. The first is the policy named default: nothing in Step 2 creates it. It is one of IKEv2’s smart defaults, built-in objects IOS supplies so a minimal FlexVPN works without them (the same mechanism supplied the default proposal the DMVPN lesson replaced in its Step 3a). The hub never uses it here, because its group lookup always names a branch’s own policy.
The second is route accept any tag : 1 distance : 1 on every policy. It is why the hub installed each branch’s config set without being told to. The full form is route accept any [tag value] [distance value]: the tag marks the installed routes so you can match them in a route map, and the distance is their administrative distance, so a higher value lets another path, such as a primary circuit, win when both exist. This image shows distance 1; Cisco’s 15M&T guide shows the smart default with distance 2, so read your own output.
— Download
Captured on the R-ISP-01–R-BRANCH-01 link. Open it and apply isakmp || esp. Watch for:
- Packets 1–4 —
IKE_SA_INITandIKE_AUTH, request and response. The config request and reply ride insideIKE_AUTH, encrypted; the capture shows their size, not their contents. - Packets 5 and 6 — the
INFORMATIONALexchange right after: the branch’s config set and the hub’s acknowledgement. - Nothing at all between packet 6 and packet 7, four minutes later. With no routing protocol and no dead peer detection configured, this idle tunnel sent no packets; rekeys, DPD or NAT keepalives would add traffic in other configurations.
- Packets 7–16 — the
clear crypto sessionin Step 5 below: the old SAs deleted, then a fresh session 53 seconds later.
Scenario 2: Let the Branches Reach Each Other Through the Hub
Branch 1 now needs to reach branch 2. Each branch only knows HQ’s prefix, so traffic between them has nowhere to go:
R-BRANCH-01# ping 10.20.2.10 repeat 3
Sending 3, 100-byte ICMP Echos to 10.20.2.10, timeout is 2 seconds:
U.U
Success rate is 0 percent (0/3)U is an ICMP unreachable. With no route to 10.20.2.0/24, the branch followed its default route to R-ISP-01, which has no route to it either.
Step 5 — add the branch summary to the hub’s route set. One line on R-HUB-01, then renegotiate:
! Step 5: every branch LAN, pushed to every branch
ip access-list standard ACL-HQ-ROUTES
permit 10.20.0.0 0.0.255.255
end
clear crypto sessionRoute sets are sent only when a session forms, so existing branches see the change after the session is rebuilt. A bare clear crypto session clears every session on the router, and the spokes must then re-establish them; in production, clear only the affected peer (clear crypto session remote 192.0.2.2). On this lab the spokes took 53 seconds to dial back in, and a ping in that window fails.
Verify: The Summary Arrived, and Branch to Branch Works
R-BRANCH-01# show ip route static | begin Gateway
Gateway of last resort is 192.0.2.1 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 192.0.2.1
10.0.0.0/8 is variably subnetted, 6 subnets, 3 masks
S 10.10.10.0/24 is directly connected, Tunnel11
S 10.20.0.0/16 is directly connected, Tunnel11
S 10.255.11.254/32 is directly connected, Tunnel11WS-BRANCH-01:~$ traceroute -n -w 2 10.20.2.10
traceroute to 10.20.2.10 (10.20.2.10), 30 hops max, 46 byte packets
1 10.20.1.1 3.063 ms 4.011 ms 1.705 ms
2 10.255.11.254 9.400 ms 9.297 ms 10.292 ms
3 10.255.11.2 16.805 ms 18.617 ms 22.301 ms
4 10.20.2.10 21.539 ms 17.210 ms 14.614 msBranch 1 to branch 2 crosses the hub (10.255.11.254), then enters R-BRANCH-02’s tunnel (10.255.11.2). This is hub-and-spoke on purpose. FlexVPN can build spoke-to-spoke shortcuts with NHRP, but objective 1.3 asks for local AAA, and one variable at a time keeps it readable.
Verify: FlexVPN, Not DMVPN, From the Session Alone
R-BRANCH-01# show crypto session
Crypto session current status
Interface: Tunnel11
Profile: IKEV2-FLEX-SPOKE
Session status: UP-ACTIVE
Peer: 198.51.100.10 port 500
Session ID: 5
IKEv2 SA: local 192.0.2.2/500 remote 198.51.100.10/500 Active
IPSEC FLOW: permit ip 0.0.0.0/0.0.0.0 0.0.0.0/0.0.0.0
Active SAs: 2, origin: crypto mappermit ip 0.0.0.0/0.0.0.0 0.0.0.0/0.0.0.0 says this is a route-based virtual tunnel interface, which encrypts everything routed into it. The DMVPN lesson’s session read permit 47: GRE only. A plain static VTI shows the same any-to-any flow, so for objective 4.3 the FlexVPN tell is the pair: this flow, plus ip address negotiated on the spoke or a virtual template and an IKEv2 authorization policy on the hub.
Troubleshooting
Symptom: A spoke’s Tunnel11 stays up/down with no address, and the spoke logs NOTIFY(AUTHENTICATION_FAILED) although the key is right.
This was reproduced on the lab by changing R-BRANCH-02’s identity to r-branch-03.securitylessons.lab, a name with no policy on the hub.
-
show ip interface brief | include Tunnel11on the spoke. (Should show an address.)unassignedmeans the config reply never arrived. -
debug crypto ikev2on the hub for one retry, thenundebug all. (Should show the username you expect.) On a hub with many branches, send debug to the log buffer rather than the console. The lab’s hub printed:· text*Sep 26 03:15:17.943: IKEv2:Using mlist FLEX-LOCAL and username r-branch-03 for group author request *Sep 26 03:15:17.944: IKEv2:(SA ID = 1):[IKEv2 -> AAA] Authorisation request sent *Sep 26 03:15:18.090: IKEv2:(SA ID = 1):[AAA -> IKEv2] Received AAA authorisation response *Sep 26 03:15:18.091: IKEv2-ERROR:AAA authorization request failed *Sep 26 03:15:18.091: IKEv2-ERROR:(SESSION ID = 0,SA ID = 1):AAA group authorization failed *Sep 26 03:15:18.093: IKEv2:(SESSION ID = 34,SA ID = 1):Verification of peer's authentication data FAILED *Sep 26 03:15:18.093: IKEv2:(SESSION ID = 34,SA ID = 1):Sending authentication failure notifyIf the username has no policy of that name: that is the cause. Fix: create the policy, or correct the spoke’s identity.
-
show crypto ikev2 authorization policyon the hub. (Should list a policy named exactly as the mangled username.)
Symptom: Branches reach HQ but not each other.
show ip route staticon a branch. (Should show a route covering the other branch’s LAN viaTunnel11.) If not: the hub’s route set does not include it. Add it to the ACL andclear crypto session.show ip route staticon the hub. (Should show every branch LAN via a virtual-access interface.) If one is missing, that branch’sauthorization policy defaultis not sending its route set.
Symptom: A change to a route set or pool has no effect.
- Route sets and addresses travel only in the config exchange. (Existing sessions keep what they got.) Run
clear crypto sessionfor the affected peer, and expect the branch to be unreachable until it dials back in.
💾 Lab End State
Both branches now reach HQ and each other through FlexVPN on Tunnel11, authorized by per-branch policies in R-HUB-01’s local AAA, with routes carried in IKEv2. The DMVPN Tunnel0 is still configured on all three routers, shut down. Save each router: write memory.
configs/SVPN/svpn-flexvpn-local-aaa/r-hub-01-end-state.txtconfigs/SVPN/svpn-flexvpn-local-aaa/r-branch-01-end-state.txtconfigs/SVPN/svpn-flexvpn-local-aaa/r-branch-02-end-state.txt
R-ISP-01 is unchanged from Implement DMVPN: mGRE, NHRP & IPsec Protection Across the Phases.
🏢 Production Considerations
- Local AAA grows with the branch count in this design. With fixed per-branch addresses, each new branch is a new policy and a new pool on the hub. When that becomes a burden, move the attributes to RADIUS: that needs AAA server configuration and RADIUS authorization attributes as well as the profile’s
aaa authorizationline, but the VTI and IPsec design stays the same. - Use certificates in production. The domain-wide pre-shared key here lets any holder claim any branch name in the domain. Certificates close that only when each branch has its own key and certificate, and the hub binds the accepted IKE identity to authenticated certificate fields, for example with a constrained certificate map on the subject or SAN.
- An idle tunnel can be silent. With no routing protocol and no DPD there are no hellos, so a failed peer may go unnoticed until traffic, a rekey or another exchange needs an answer. Common cause of “the branch was down for an hour and nothing alarmed”: no dead peer detection. Fix: enable periodic IKEv2 dead peer detection under the profile, for example
dpd 30 5 periodic, and monitor the sessions. On-demand DPD only probes when there is traffic to send, so it does not catch a failed peer on an idle tunnel.
🎥 [Video: two routing tables from the same branch; FlexVPN as IKEv2 doing the signalling; the hub’s template, profile, mangler and local policies; building the hub and a spoke and reading the pushed routes; the debug walked line by line; the branch summary pushed and traced; the broken identity and its AUTHENTICATION_FAILED. Matches video.script_outline. Runtime: ~10 minutes]
Key Takeaways
- This FlexVPN design lets IKEv2 do the signalling. Authentication, the tunnel address and the routes all travel in IKEv2, so the tunnel needs no routing protocol.
- Local AAA means the policies live on the hub. The name mangler turns a branch’s identity into a username, and the authorization policy with that name decides its pool and route set.
- The hub pushes in the config reply; the branch answers in a config set. Both install what they receive as static routes on the tunnel.
Two things that save time when it breaks:
- AUTHENTICATION_FAILED can be an authorization failure. A missing policy name fails
IKE_AUTHeven with the right key; the hub’s debug says “AAA group authorization failed.” - Route set changes need a new session.
clear crypto session, and expect the branch to be gone until it dials back in.
Up next: Remote Access VPN & Cisco Secure Client Architecture — the next module moves from site-to-site to remote access, where the same IKEv2 profile and authorization ideas serve individual users instead of branches.
isakmp || esp Knowledge Check
No grade, no timer. Wrong picks turn coral — change your answer until everything's green.
1 · A branch authenticates with the FQDN r-branch-01.securitylessons.lab. The hub's IKEv2 profile uses aaa authorization group psk list FLEX-LOCAL name-mangler NM-HOST, and NM-HOST is fqdn hostname. Which authorization policy does the hub apply?
The mangler keeps only the hostname part of the FQDN, so the username is r-branch-01, and local AAA returns the authorization policy of that name. The hub's IKEv2 debug prints that username in its Using mlist FLEX-LOCAL and username ... line before the lookup.
2 · After the migration, R-BRANCH-01's routing table shows S 10.10.10.0/24 is directly connected, Tunnel11. Where did that route come from?
The spoke's debug shows the config reply carrying ipv4-subnet ... 10.10.10.0 255.255.255.0; IOS installs pushed subnets as static routes on the tunnel.
3 · You rename a spoke's IKE identity to r-branch-03, and no policy r-branch-03 exists on the hub. What does the spoke log?
The hub's AAA lookup fails and, on the lab's IOSv image, IOS answers IKE_AUTH with AUTHENTICATION_FAILED, even though the pre-shared key matched. Only the hub's debug names the real cause.
4 · In show crypto session, which IPsec flow separates this lab's FlexVPN tunnel from its DMVPN tunnel?
A virtual tunnel interface protects everything routed into it, so its selectors are any to any; DMVPN protects only the GRE between two NBMA addresses, which shows as permit 47. Any-to-any alone also fits a plain static VTI, so confirm FlexVPN from the IKEv2 profile and authorization policy.
You just proved the method works — the rest of the mountain is waiting. All-Access unlocks every lesson in every course — $489/yr, with $647 of founders bonuses while the window is open.
Reserve founders rate →Sat the exam and passed? Tell us on the day →
📚 Official Documentation — every source behind this page · verified 26 Sept 2026
Revision 17.x, current as published · accessed 29 Sept 2026
Revision Last updated 2014-09-02 · accessed 26 Sept 2026
Revision Last updated 2014-09-02 · accessed 26 Sept 2026
Revision October 2014 · accessed 26 Sept 2026