DMVPN – Part 2, BGP with dyanmic neighbors

Oh man… BGP Dynamic Neighbors. This is a freaking cool way of setting up BGP on a device like a Hub router where you’re expecting numerous BGP neighbors. Before dynamic neighbors, I remember configuring my hub router with peer-groups and having an insane amount of syntax since we had ~30-40 spokes. No more my friends, in this post we’ll not only look at how to configure iBGP for DMVPN routing, but also using dynamic neighbors to dramatically reduce the amount of configuration on the hub.

Before I jump into the config, you might wonder “why use BGP for DMVPN routing?” Simple answer my friend, it’s awesome. So, since most moderately sized organizations have BGP running anyway (think about your MPLS, unless you’re super cool and have a full on VPLS… you’re peering with your MPLS provider, and more than likely using BGP) using BGP for DMVPN allows a relatively seamless integration of the DMVPN cloud into your organization. I used to preach about “consistent BGP information”, because that model sincerely does allow you to build more stable and scalable networks. Also, per Cisco, distance vector routing protocols just play nicer with DMVPN’s hub and spoke model. SO enough with the sales pitch, let’s get into it. Here’s our topology:

We’ll configure the spokes first, since there’s nothing too exciting happening there. *This post assumes you already have DMVPN up and running, see DMVPN Part 1 for that*


conf t
router bgp 65000
 neighbor remote-as 65000
 neighbor send-community
 network mask

 That’s it… rinse and repeat on Spokes 2 and 3 (just change your network statement). Now here’s the magic, configuring the Hub. Dynamic neighbors aside, there’s one key feature we’re really concerned with on the Hub… route-reflector-client. Specifically telling the hub that all DMVPN peers are RR clients. Why? Well young padawans, what’s the rule about iBGP? BGP expects that internal peerings are configured in a full mesh, and to prevent routing loops, it will not advertised iBGP learned prefixes to other iBGP peers… think of this like BGP’s split horizon. Well, that’s not going to work for us at all, so we’re effectively going to turn it off by telling the hub our DMVPN peers are RR clients. Also note the bgp listen syntax… we’ll talk about that bit next.


conf t
router bgp 65000
 neighbor DMVPN peer-group
 neighbor DMVPN remote-as 65000
 neighbor DMVPN route-reflector-client
 bgp listen range peer-group DMVPN
 network mask

That’s it! Calling “bgp listen range x.x.x.x/x peer-group abcd” is the entire configuration of dynamic neighbors. Now the default behavior allows for 100 dynamic peers, but this can be increased to 5000 with “bgp listen limit 5000”. Check out the bgp summary table on the hub, so informative:

HUB#show ip bgp summary | b ^Neighbor
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
*   4        65000      30      30       11    0    0 00:22:24        1
*   4        65000      29      34       11    0    0 00:22:22        1
*   4        65000      29      34       11    0    0 00:22:24        1
* Dynamically created based on a listen range command
Dynamically created neighbors: 3, Subnet ranges: 1

BGP peergroup DMVPN listen range group members:

Total dynamically created neighbors: 3/(5000 max), Subnet ranges: 1

So you can see “Total dynamically created neighbors: 3/(5000 max)” I did bump up the maximum allowed dynamic neighbors to 5000. Also note the “*” next to our neighbors indicating that they were learned dynamically. Alright, the last thing we should look at is a couple pings showing spoke to spoke communication, our routing tables (since iBGP does not update next hop information), and our dmvpn neighbor table after said pings. We’ll test between Spoke 2 and Spoke 3.

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to, timeout is 2 seconds:

SPOKE2#show ip route bgp | b ^Gateway
Gateway of last resort is not set is subnetted, 4 subnets
B [200/0] via, 00:28:58
B [200/0] via, 00:28:58
B [200/0] via, 00:28:58

SPOKE2#show dmvpn | b ^ # Ent
 # Ent  Peer NBMA Addr Peer Tunnel Add State  UpDn Tm Attrb
 —– ————— ————— —– ——– —–
     1       UP 00:38:05     S
     1     UP 00:28:34     D
     1     UP 00:00:05     D

Well that’s all there is too it! See the linked video for a walk through of this post, and a quick blurb on design considerations.

0 Comments on “DMVPN – Part 2, BGP with dyanmic neighbors

  1. Shahed,

    So, in reply to me posting about BGP dynamic neighbors over DMVPN… you're saying "If you don't know anything about DMVPN". Dude, you can see how that comes off a little insulting right?

  2. Hi Jon,

    I've deployed DMVPN over BGP and I am running into a strange issue: At my HQ the hub is connected to the Internet at the speed of 150Mbps and at the branch site the spoke is connected to the Internet at the speed of 60Mpbs. However, when I try to copy files although the size of these files are really small ".img" the average speed between hub and spoke is about 2Mbps. I've tried and modified the MTU and MSS on the tunnel interface without any luck, any advise?

  3. Oh man, I do not envy you at all lol. I'd start by getting a baseline with something like iperf between those machines (eliminate potential SMB issues). What kind of routers are you using for HQ and Spoke?

Leave a Reply