How to Configure eBGP and iBGP with Peer-Groups

How to Configure eBGP and iBGP with Peer-Groups

BGP (Border Gateway Protocol) with peer-group configurations 

Objective 

This document explains how to configure eBGP (External BGP) and iBGP (Internal BGP) using peer-groups on routers. Peer-groups help simplify BGP configuration by grouping neighbors with common policies, reducing repetitive commands and improving scalability. 

Prerequisites 

Hardware: 

  • Switches or routers that support VLANs 
    (e.g., edgecore, ufispace) 

Software: 

  • Network operating systems that support VLAN configuration 
    (e.g., SONiC-OS-4.4.0-Enterprise_Base, SONiC-OS-4.4.2-Enterprise_Base) 

Access: 

  • Administrative or privileged CLI access 

Network: 

  • Established IP connectivity between BGP neighbors. 

  • Public or private AS numbers, IP addresses for peerings, and agreed routing policies. 

 

Topology Diagram 

Picture, Picture 
 

Example: 

Two routers configured as BGP neighbors exchanging route information. 

Basic Configuration Steps 

1. Define Local and Remote AS 

  • For eBGP, set the local AS and the neighbor’s external AS. 

  • For iBGP, set both neighbors with the same AS number. 

 

2. Configure Peer-Group 

Create a peer-group to group neighbors sharing the same configuration (timers, route policies, etc.) 

 

3. Assign Neighbors to Peer-Group 

Add neighbor IP addresses under the peer-group to inherit common settings. 

4. Advertise Networks 

 

Specify local networks to announce into BGP. 

 

5. Apply BGP Policies (Optional) 

Configure route-maps, prefix-lists, or filters to control route advertisement and acceptance. 

 

 

Example Configuration (DUT_1 and DUT_2) 

 

DUT_1 

 

configure terminal 

ip prefix-list ALLOW seq 10 permit 192.168.1.1/24 

route-map ALLOW_LOCAL_NET permit 10 

 match ip address prefix-list ALLOW 

 

router bgp 65100 

 router-id 11.11.11.11 

 log-neighbor-changes 

 timers 60 180 

 ! 

 peer-group INTERNAL 

  remote-as internal 

  timers connect 30 

  advertisement-interval 0 

  ! 

  address-family ipv4 unicast 

   activate 

   route-map ALLOW_LOCAL_NET in 

   send-community both 

 ! 

 neighbor 10.0.0.2 

  peer-group INTERNAL 

 

 

 

DUT_2 

router bgp 65100 

 router-id 22.22.22.22 

 log-neighbor-changes 

 timers 60 180 

 ! 

 peer-group INTERNAL 

  remote-as internal 

  timers connect 30 

  advertisement-interval 0 

  ! 

  address-family ipv4 unicast 

   activate 

   route-map ALLOW_LOCAL_NET in 

   send-community both 

 ! 

 neighbor 10.0.0.1 

  peer-group INTERNAL 

 

Verification 

show ip bgp summary #shows bgp neighbors  

show bgp ipv4 unicast summary #show bgp neighbor status 

show bgp ipv4 unicast neighbor <neighbor_ip> advertised-routes 

 #check the advertise routes are correct 

Troubleshooting Tips 

  • Ensure both sides have matching AS numbers (iBGP: same, eBGP: different). 

  • Verify IP connectivity between BGP peers. 

  • Confirm peer-group settings are properly applied. 

  • Check for BGP session establishment issues using show ip bgp neighbors. 

  • Review route policies or filters if routes are missing.