Duplicate BGP Router-IDs: From Broken Sessions to Silently Lost Routes
How Duplicates Happen and the Rules They Break
Nobody plans a duplicate Router-ID. It arrives through a template. An engineer builds a new branch router by copying the configuration of an existing one, changes the hostname, the interface addresses and the neighbours, and forgets one line under the BGP process: "#bgp router-id 9.9.9.9". Now two routers in the network claim the same identity.
Sometimes the network complains loudly and the session never comes up. Sometimes it says nothing at all and routes simply vanish from one router. The difference depends on who peers with whom, and understanding that difference is exactly the kind of reasoning the CCIE lab expects. This post builds both failures in a small lab and shows how to prove the cause from Cisco output.
Before building the lab, it helps to restate what the Router-ID is and which rules apply to it. The BGP Router-ID, which the protocol calls the BGP Identifier, is a 32-bit value written like an IPv4 address. Each router sends it in the OPEN message when a session starts. On Cisco IOS and IOS XE it comes from "#bgp router-id" if configured, otherwise from the highest up loopback address, otherwise from the highest up physical address.
The rules about uniqueness are simple once stated clearly. The identifier must be non-zero. It must be unique inside an autonomous system. Since RFC 6286, it no longer needs to be unique between different autonomous systems, so an eBGP neighbour may legally use the same value as the local router. Whether a given Cisco release accepts that eBGP case depends on the release, which is the first thing this lab tests.
Three Failures in the Lab
The lab uses four routers. R1 is a route reflector in AS 65000 with Router-ID 1.1.1.1. R2 and R3 are route reflector clients in AS 65000, and both were built from the same template, so both carry "#bgp router-id 9.9.9.9". R4 is in AS 65004 and is used for the eBGP case. All iBGP sessions use loopbacks as update source, and OSPF provides loopback reachability.
R1(config)#router bgp 65000
R1(config-router)#bgp router-id 1.1.1.1
R1(config-router)#neighbor 2.2.2.2 remote-as 65000
R1(config-router)#neighbor 2.2.2.2 update-source Loopback0
R1(config-router)#neighbor 2.2.2.2 route-reflector-client
R1(config-router)#neighbor 3.3.3.3 remote-as 65000
R1(config-router)#neighbor 3.3.3.3 update-source Loopback0
R1(config-router)#neighbor 3.3.3.3 route-reflector-client
R2(config)#router bgp 65000
R2(config-router)#bgp router-id 9.9.9.9
R2(config-router)#neighbor 1.1.1.1 remote-as 65000
R2(config-router)#neighbor 1.1.1.1 update-source Loopback0
R2(config-router)#network 192.0.2.0 mask 255.255.255.0
R3 has the same configuration, with its own loopback but the same Router-ID.
The first failure is the loud one. Imagine someone adds a direct iBGP session between R2 and R3, for example to carry a few prefixes between two sites. Both routers send 9.9.9.9 in the OPEN. Each one sees its own identifier coming back from an internal peer and treats it as an error. The session is closed with an OPEN Message Error, subcode Bad BGP Identifier, and it never reaches Established.
R2#
%BGP-3-NOTIFICATION: sent to neighbor 3.3.3.3 passive 2/3 (BGP identifier wrong) 4 bytes 09090909
The bytes 09090909 are the identifier in hex, which is 9.9.9.9. The session sits in Active or Idle and keeps retrying.
R2#show ip bgp summary
BGP router identifier 9.9.9.9, local AS number 65000
BGP table version is 3, main routing table version 3
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.1 4 65000 22 20 3 0 0 00:16:45 0
3.3.3.3 4 65000 0 0 1 0 0 never Active
This failure is the easy one. The session is down, the log tells you why, and the fix is obvious.
The second failure is far harder to spot. Now remove the direct session and go back to the design as built: R2 and R3 talk only to the reflector. Both sessions to R1 come up, because R1 has a different identifier from each of them, and R1 does not check whether two of its own peers share a value.
R1#show ip bgp summary
BGP router identifier 1.1.1.1, local AS number 65000
BGP table version is 4, main routing table version 4
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2.2.2.2 4 65000 31 29 4 0 0 00:24:10 1
3.3.3.3 4 65000 30 30 4 0 0 00:24:02 0
R2 originates 192.0.2.0/24. R1 receives it, sets ORIGINATOR_ID to the Router-ID of the router it learned it from, which is 9.9.9.9, adds its cluster ID to the CLUSTER_LIST, and reflects it to R3.
R1#show ip bgp 192.0.2.0
BGP routing table entry for 192.0.2.0/24, version 4
Paths: (1 available, best #1, table default)
Advertised to update-groups:
1
Refresh Epoch 1
Local, (Received from a RR-client)
2.2.2.2 (metric 2) from 2.2.2.2 (9.9.9.9)
Origin IGP, metric 0, localpref 100, valid, internal, best
Here is the trap. R3 receives a route whose ORIGINATOR_ID is 9.9.9.9, which is its own Router-ID. To R3 this looks exactly like its own route coming back to it, which is the loop that ORIGINATOR_ID exists to stop. R3 drops the route without a log message, a notification or a session reset.
R3#show ip bgp 192.0.2.0
% Network not in table
The session is up, the reflector says the route was advertised, and the client does not have it. This is the silent failure.
Because nothing is logged, the evidence has to come from counters. On R3, Cisco keeps a count of prefixes denied by inbound loop checks under Local Policy Denied Prefixes.
R3#show ip bgp neighbors 1.1.1.1 | section Local Policy
Outbound Inbound
Local Policy Denied Prefixes: -------- -------
ORIGINATOR loop: n/a 1
Total: n/a 1
One prefix denied for ORIGINATOR loop on a router that originated nothing is the signature of a duplicate Router-ID inside the AS. Confirm it by comparing identifiers.
R2#show ip bgp summary | include identifier
BGP router identifier 9.9.9.9, local AS number 65000
R3#show ip bgp summary | include identifier
BGP router identifier 9.9.9.9, local AS number 65000
The same failure hides in larger designs too. Routes from R3 to R2 vanish the same way, so the problem is symmetric. With hierarchical reflectors, a duplicate between clients in different clusters still breaks reachability, because the ORIGINATOR_ID is carried end to end through the AS.
The last case crosses an AS boundary. Configure R4 in AS 65004 with "#bgp router-id 9.9.9.9" and peer it with R2. On releases that follow the original rule, R2 rejects the OPEN in the same way as in failure one.
R2#
%BGP-3-NOTIFICATION: sent to neighbor 10.24.0.4 passive 2/3 (BGP identifier wrong) 4 bytes 09090909
On releases that implement RFC 6286, the session comes up, because the identifier only has to be unique inside an AS and R4 is in a different one. Lab this on the exact release you run in production or on the exam image, rather than assuming either behaviour. The safe design never depends on it: give every router a globally sensible identifier, normally its own loopback address, and the question never comes up.
The Fix and the Audit
The fix in every case is to give each router its own value, which resets that router's BGP sessions, so do it in a window.
R3(config)#router bgp 65000
R3(config-router)#bgp router-id 3.3.3.3
R3#show ip bgp 192.0.2.0
BGP routing table entry for 192.0.2.0/24, version 6
Paths: (1 available, best #1, table default)
Not advertised to any peer
Refresh Epoch 1
Local
2.2.2.2 (metric 3) from 1.1.1.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, internal, best
Originator: 9.9.9.9, Cluster list: 1.1.1.1
To stop it happening again, two habits help. First, remove "#bgp router-id" from shared templates and replace it with a variable that is filled from the router's own Loopback0 address. Second, collect the output of "#show ip bgp summary | include identifier" from every router as part of a regular audit and flag duplicates automatically. A duplicate that causes a session failure gets noticed in minutes. A duplicate between two route reflector clients can sit unnoticed until the one prefix that matters goes missing.