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. 

 

 

 

 

 

 

    • Related Articles

    • How to configure BGP

      BGP (Border Gateway Protocol) Objective BGP (Border Gateway Protocol) is the protocol that enables the global routing system of the internet. It manages how packets get routed from network to network by exchanging routing and reachability information ...
    • How to Configure BGP (Border Gateway Protocol)

      BGP (Border Gateway Protocol) Objective This document explains how to configure Border Gateway Protocol (BGP) on [device or platform name]. BGP is the protocol that enables the global routing system by exchanging routing information between ...
    • How to Configure MC-LAG (Multi-Chassis Link Aggregation)

      MC-LAG (Multi-Chassis Link Aggregation) Objective This document explains how to configure MC-LAG (Multi-Chassis Link Aggregation) between two switches and a host. MC-LAG provides link redundancy and load balancing by allowing two physical switches to ...
    • How to config bfd

      BFD (Bidirectional Forwarding Detection): Bidirectional Forwarding Detection (BFD) is a lightweight network protocol designed to detect link failures rapidly between two forwarding engines (e.g., routers or switches). BFD operates independently of ...
    • How to configure subinterface

      Sub-Interface: Sub interfaces divide the parent interface into two or more virtual interfaces on which you can assign unique Layer 3 parameters such as IP addresses and dynamic routing protocols. The IP address for each sub interface should be in a ...