BGP Peer Groups on Cisco IOS

When you configure BGP on a router it’s possible that some of the BGP neighbors share the exact same configuration. This can be annoying since you have to type in the exact same commands for each of these neighbors. Also, when BGP prepares updates it does this separately for each neighbor. This means that it has to use CPU resources to prepare the update for each neighbor.

To simplify the configuration of BGP and to reduce the number of updates BGP has to create, we can use peer groups. We can add neighbors to a peer group and then apply all our configurations to the peer group. BGP will prepare the updates for the peer group which requires less CPU resources than preparing them for each neighbor separately.

Configuration

Let’s take a look at two examples so you can see the difference between using peer groups or not. I’ll use the following topology to demonstrate this:

R1 R2 R3 R4 eBGP Topology

Above we have 4 routers in different autonomous systems. R1 is connected to R2, R3 and R4. Let’s say that we have the following requirements for these eBGP neighbors:

Let’s start with the example without the peer group…

I am using loopback interfaces for the neighbor adjacency so don’t forget to add some static routes:

R1(config)#ip route 2.2.2.2 255.255.255.255 192.168.12.2
R1(config)#ip route 3.3.3.3 255.255.255.255 192.168.13.3
R1(config)#ip route 4.4.4.4 255.255.255.255 192.168.14.4
R2(config)#ip route 1.1.1.1 255.255.255.255 192.168.12.1
R3(config)#ip route 1.1.1.1 255.255.255.255 192.168.13.1
R4(config)#ip route 1.1.1.1 255.255.255.255 192.168.14.1

And here s the route-map to set the MED:

R1(config)#route-map SET_MED permit 10
R1(config-route-map)#set metric 2323

Without BGP Peer Group

Here’s what our BGP configuration on R1 would look like:

R1(config)#router bgp 1
R1(config-router)#neighbor 2.2.2.2 remote-as 2
R1(config-router)#neighbor 3.3.3.3 remote-as 3
R1(config-router)#neighbor 4.4.4.4 remote-as 4
R1(config-router)#neighbor 2.2.2.2 update-source loopback 0
R1(config-router)#neighbor 3.3.3.3 update-source loopback 0
R1(config-router)#neighbor 4.4.4.4 update-source loopback 0
R1(config-router)#neighbor 2.2.2.2 ebgp-multihop 2
R1(config-router)#neighbor 3.3.3.3 ebgp-multihop 2
R1(config-router)#neighbor 4.4.4.4 ebgp-multihop 2
R1(config-router)#neighbor 2.2.2.2 route-map SET_MED out
R1(config-router)#neighbor 3.3.3.3 route-map SET_MED out
R1(config-router)#neighbor 4.4.4.4 route-map SET_MED out

In the configuration of R1 above the only difference is the AS number for each neighbor. The update-source, ebgp-multihop and route-map are the same. This works but we have to repeat the same commands over and over again.

With BGP Peer Group

Let’s simplify the configuration of R1 with our peer group. I will start with a fresh BGP configuration on R1.

First we have to configure the AS number for each eBGP neighbor separately:

R1(config)#router bgp 1
R1(config-router)#neighbor 2.2.2.2 remote-as 2
R1(config-router)#neighbor 3.3.3.3 remote-as 3
R1(config-router)#neighbor 4.4.4.4 remote-as 4

Now we can create the peer group. If you look at the neighbor command you will see some options:

R1(config-router)#neighbor ?
  A.B.C.D     Neighbor address
  WORD        Neighbor tag
  X:X:X:X::X  Neighbor IPv6 address

We can specify an IPv4 or IPv6 address for the neighbor or we can use a tag. That’s what we need to use for the peer group, let’s try that:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You've Ever Spent on Your Cisco Career!
  • Full Access to our 655 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

535 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Forum Replies

  1. Hi,

    I have a problem in R1 he doesn’t create any neighbor relationship:

    These are the logs:

    *Jul  9 17:58:35.187: BGP: ses global 3.3.3.3 (0x655EF9CC:0) act Reset (Active open failed).
    *Jul  9 17:58:35.199: BGP: 3.3.3.3 active went from Active to Idle
    *Jul  9 17:58:35.199: BGP: nbr global 3.3.3.3 Active open failed - open timer running
    *Jul  9 17:58:35.203: BGP: nbr global 3.3.3.3 Active open failed - open timer running
    

    Example for R3 but it’s the same for R2 and R4:

    router bgp 1
     bgp log-neighbor-changes
     neighbor R2_R3_R4 peer-group
     neighbor
    ... Continue reading in our forum

  2. Hello sales2161

    The courses on Networklessons are organized by either certification or topic. All the courses that are organized by topic include all of the information for that particular topic that is needed for certifications up to and including CCIE.

    If you’re studying specifically for a particular certification, it’s best to use the course of that particular certification. If you just want to learn about a particular topic in depth, then go for the topical courses.

    For this particular case, the BGP course goes beyond what is needed for CCNP. If you’re f

    ... Continue reading in our forum

  3. Thanks you Laz,
    Now it is much more clear to me the difference as I also read it few times online but wasn’t sure about those explanations.

33 more replies! Ask a question or join the discussion by visiting our Community Forum