As we know, configuring the BGP neighbor is not too difficult, but when we are going to configure 100 or more Number of neighbors, then it becomes pretty tedious activity.
BGP Peering
To minimize this configuration overhead, we use the concept of BGP peer Group, where we can group the BGP Neighbors who are sharing the same outbound policies. But first, we need to manually configure 100 Peers and then add to the peer group. Hence the problem is still not resolved.
Related – BGP Neighbor States
Let’s verify BGP peer Group configuration
1 Example: Configuration step of iBGP Peer Group.
2 Example: Configuration step of eBGP peer Group.
Related – iBGP vs eBGP
With the Dynamic BGP peering feature, BGP router dynamically establishes peering with a group of remote neighbors that are configured using a range of IP addresses and BGP peer group. After a subnet range is configured for a BGP peer group and a TCP session is initiated by another router for an IP address in the subnet range, a new BGP neighbor is dynamically created as a member of that group.
So in this scenario, we will discuss how to configure Dynamic BGP peer.
(Diagram- BGP Peering)
As per diagram R1 wants dynamic peering with R2 and R3, so let’s verify the configuration steps;
Step 1. Define BGP peer group name
Step 2. Create a global limit of BGP dynamic subnet range neighbors. The value ranges from 1 to 5000.
Step 3. Define the IP Subnet Range and associate it with a peer group. Multiple subnets can be added to the same peer group.
Step 4. Define the remote-as for the peer group. Optionally, define the list of AS numbers that can be accepted to form neighborship with. The max limit of alternate-as numbers is 5.
Step 5. Activate the peer group under ipv4 address-family
R1(config-router-af)# neighbor Dynamic-peer activate.
Router1#show run | section router bgp
bgp log-neighbor-changes
bgp listen range 172.16.0.0/16 peer-group Dynamic-peer
neighbor Dynamic-peer peer-group
neighbor Dynamic-peer remote-as 65002 alternate-as 65003 65004
!
address-family ipv4
neighbor Dynamic-peer activate
exit-address-family
Router2#show run | section bgp
bgp log-neighbor-changes
neighbor 172.16.1.1 remote-as 65001
Router3#show run | section router bgp
bgp log-neighbor-changes
neighbor 172.16.2.1 remote-as 65001
Router1#show ip bgp summary
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
*172.16.1.2 4 65002 4 4 1 0 0 00:00:38 0
*172.16.2.2 4 65003 4 2 1 0 0 00:00:29 0
* Dynamically created based on a listen range command
Dynamically created neighbors: 2, Subnet ranges: 1
BGP peer group Dynamic-peer listen range group members:
172.16.0.0/16
Total dynamically created neighbors: 2/(100 max), Subnet ranges: 1
Router1#show tcp brief all
A2B61B90 172.16.1.1.179 172.16.1.2.64321 ESTAB
A2B62F48 172.16.2.1.179 172.16.2.2.17764 ESTAB
A2B19B20 0.0.0.0.179 *.* LISTEN
The output illustrates that the router is listening on port 179 but with foreign address of *.*
Related- BGP Interview Questions
ABOUT THE AUTHOR
I am here to share my knowledge and experience in the field of networking with the goal being – “The more you share, the more you learn.”
I am a biotechnologist by qualification and a Network Enthusiast by interest. I developed interest in networking being in the company of a passionate Network Professional, my husband.
I am a strong believer of the fact that “learning is a constant process of discovering yourself.”
– Rashmi Bhardwaj (Author/Editor)