Courseiva
BGPRouter Config

bgp router-id [ip]

Statically assigns the BGP router ID to avoid ID changes when interface states change.

Definition: bgp router-id [ip] is a Cisco IOS router config command. Manually sets the BGP router ID, overriding the automatic selection. The router ID is a 32-bit value (written as a dotted-decimal IP) used to uniquely identify the router in BGP.

Syntax·Router Config
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.1
R1(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 summary
BGP 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

1.

CCNA exam tip: If not configured manually, BGP selects the highest loopback IP; if no loopback, the highest active physical interface IP.

2.

CCNA exam tip: Changing the router ID resets ALL BGP sessions — this is a traffic-impacting event.

3.

CCNA exam tip: The router ID does not need to be a routable IP — it's just an identifier, similar to OSPF router ID.

4.

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.

bgp router-id [ip] vs router bgp [asn]

These two commands are often confused because both are required for BGP configuration and involve the router ID in some way, but they serve different purposes: one enters BGP configuration mode, the other manually sets the router ID within that mode.

Aspectbgp router-id [ip]router bgp [asn]
ScopeBGP router ID assignmentEntire BGP process configuration
Configuration modeRouter Config (bgp sub-mode)Global Config to enter bgp sub-mode
PersistenceSurvives reboot if savedSurvives reboot if saved
PrecedenceOverrides automatic router ID selectionMust be issued before other BGP commands
Typical useWhen a specific router ID is requiredTo start BGP configuration

Use bgp router-id [ip] when you need to manually set the BGP router ID to a specific IP address, overriding the automatic selection from the highest loopback or physical interface IP.

Use router bgp [asn] when you need to enter BGP configuration mode to configure BGP routing for a specific autonomous system.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions