bgp router-id [ip]
Statically assigns the BGP router ID to avoid ID changes when interface states change.
bgp router-id <ip-address>When to Use This Command
- Preventing BGP session resets caused by router ID changes when interfaces go up or down.
- Ensuring a predictable, stable router ID in production environments.
- Resolving router ID conflicts in complex BGP topologies.
- Best practice in any BGP deployment — always set it explicitly.
Command Examples
Set the router ID to a loopback address
R1(config)# router bgp 65001
R1(config-router)# bgp router-id 10.0.0.1R1(config-router)# %BGP-5-ADJCHANGE: neighbor 203.0.113.1 Down Router ID changed %BGP-5-ADJCHANGE: neighbor 203.0.113.1 Up
Changing the router ID resets all BGP sessions — expect a brief outage. For this reason, set it before establishing any sessions. After the reset, the new router ID 10.0.0.1 is used permanently.
Verify router ID
R1# show ip bgp summaryBGP router identifier 10.0.0.1, local AS number 65001
The first line of 'show ip bgp summary' confirms the active router ID.
Understanding the Output
If BGP sessions are already established when you set the router ID, IOS resets all sessions — you'll see ADJCHANGE syslog messages. The router ID is shown at the top of 'show ip bgp summary' and 'show ip bgp'. Best practice: always use the primary loopback IP as the router ID.
CCNA Exam Tips
CCNA exam tip: If not configured manually, BGP selects the highest loopback IP; if no loopback, the highest active physical interface IP.
CCNA exam tip: Changing the router ID resets ALL BGP sessions — this is a traffic-impacting event.
CCNA exam tip: The router ID does not need to be a routable IP — it's just an identifier, similar to OSPF router ID.
CCNA exam tip: A router ID conflict (two routers with the same ID) can cause BGP instability.
Common Mistakes
Mistake 1: Changing the router ID on a live router — this resets all BGP sessions and causes a routing outage.
Mistake 2: Using a physical interface IP instead of a loopback — if that interface goes down, the router ID changes and sessions reset.
Mistake 3: Not setting the router ID at all — if the highest IP interface flaps, the ID changes and sessions drop.
Related Commands
neighbor [ip] remote-as [asn]
Defines a BGP neighbor (peer) by specifying its IP address and AS number. If the remote AS matches the local AS, this creates an iBGP session; if different, it creates an eBGP session.
router bgp [asn]
Enters BGP router configuration mode and creates a BGP process with the specified autonomous system (AS) number. This is the first command required to configure BGP on a Cisco router.
show ip bgp summary
Displays a summary of the BGP neighbor status and prefix counts, used to quickly verify BGP peering and routing table health.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions