BGP Basic Configuration Commands

BGP Basic Configuration Commands

 

1. Enable BGP
               Activates BGP on the device with a specified Autonomous System number.

      Command: router bgp <AS-number>

2. Configure BGP Router ID
            Sets a unique identifier for the BGP router, usually an IP address to ensure consistent identification.
  
      Command: router-id <router-id>

3. Configure BGP Neighbor
         
      Defines a BGP neighbor by specifying its IP address and AS number.

  •   Command for Neighbor Configuration:

neighbor <IP-address>

remote-as <AS-number>

  • Command to Disable a Neighbor:

no neighbor <IP-address>

4. Set BGP Keep-alive and Hold Time
            Configures the BGP hold time to detect when a neighbor becomes unreachable.
  Command:

neighbor <IP-address>

timers <keepalive> <hold-time>

5. BGP Maximum Path Configuration
            Sets the maximum number of parallel paths that BGP should consider for load balancing.
  
      Command:

maximum-paths <number>

6. Clear BGP Sessions
            Clears or resets BGP sessions, useful for applying new configurations immediately.

  • Command to Clear All BGP Sessions

clear bgp all

  • Command to Clear Specific Neighbor Session

clear bgp  all <neighbor-IP>

7. Display BGP Information
            Shows bgp information for all address families.
  Command:

            show bgp all   

8. Display BGP Route Information
            Displays the BGP routing table with details of routes learned through BGP.
  Command:

show bgp ipv4

show bgp ipv6

9. BGP Add Path Configuration
            Add Path allows BGP to advertise multiple paths to a destination.

·               Command to Advertise All Paths:

                  addpath-tx-all-paths

This command enables BGP to advertise all paths to a neighbor.

·               Command to Advertise Best Path Per AS:

                  addpath-tx-bestpath-per-as

This command configures BGP to advertise only the best path per AS to a neighbor.

10. BGP Address Family Configuration
Defines the address families (IPv4, IPv6) for BGP.

  • Configure IPv4 Unicast Address Family
    Command:

address-family ipv4 unicast

  • Configure IPv6 Unicast Address Family
    Command:

address-family ipv6 unicast 



    • Related Articles

    • What are the Basic Configuration commands ?

      config hostname: Configures the system hostname. config platform firmware install: Installs platform component firmware. config platform firmware update: Updates a platform component firmware from the current/next SONiC image. config set_timezone: ...
    • What are the basic system health and diagnostics check commands for Broadcom SONiC?

      Health Checks: To monitor the health of the SONiC environment, several commands can be utilized: 1. System Health Summary: show system-health summary provides an overview of any critical issues. 2. Power Supply Status: show platform psusummary ...
    • What are some Basic Monitoring commands ?

      show timezone-list: Displays the full list of available timezones. show boot: Shows the current OS image, the image to be loaded on the next reboot, and lists all available images installed on the device. show clock: Displays the current date and ...
    • Where can I get the Configuration guide for SONiC

      Attached document provides the details about the Configuration of SONiC
    • Interface Configuration in SONiC

      To manage interface settings in SONiC, use the following commands. Change Interface Speed To modify the speed of an interface, use the command: sudo config interface speed <interface> <speed_in_Mbps> Example: sudo config interface speed ethernet10 ...