Day 5 — BGP Finite-State Machine: States, Transitions and Session Troubleshooting

Learning objective

Use the BGP finite-state machine as a troubleshooting model: identify what a current state proves, what it does not prove, and which layer of evidence should be collected next.


BGP Finite-State Machine



1. Opening — a BGP state is evidence, not a diagnosis

BGP state = Active is one of the most misunderstood lines in routing operations.

The word *Active* sounds healthy. In BGP it is not the desired steady state. The desired operational state is Established. Active is part of the connection-establishment process and often appears when the speaker is repeatedly trying to create the underlying TCP session.

Likewise, Idle does not automatically mean “interface down,” and OpenSent does not mean “routes are being sent.” Each state represents a particular stage in the BGP finite-state machine (FSM). The state narrows the investigation, but the state alone is not the root cause.

The best BGP troubleshooters therefore ask two questions:

  1. What has already succeeded if the session reached this state?
  2. What is the next protocol event that must succeed before the state can advance?

That turns the FSM into a diagnostic map instead of a list to memorize.


2. Why BGP has a finite-state machine

BGP session establishment includes several independent mechanisms:

  • local configuration and administrative enablement;
  • TCP connection establishment;
  • BGP OPEN exchange;
  • version/ASN/hold-time/identifier/optional-parameter processing;
  • capability negotiation;
  • KEEPALIVE confirmation;
  • and, finally, ongoing UPDATE exchange.

An FSM gives the implementation a deterministic way to react to events such as:

  • start or stop;
  • successful or failed TCP connection;
  • TCP connection loss;
  • OPEN received;
  • KEEPALIVE received;
  • NOTIFICATION received;
  • timer expiry;
  • and protocol errors.

RFC 4271 defines the core BGP FSM. RFC 9687 later defines the SendHoldTimer and an associated FSM event to address cases where a BGP speaker is unable to send messages for too long even though the remote side has not closed the connection. That extension is useful standards context, but platform implementation/support must be verified before assuming a specific Cisco release exposes or implements it in a particular way.


3. The six core states

3.1 Idle

Idle is the starting/reset state of the BGP FSM.

Conceptually, in Idle the speaker is not in a usable BGP relationship with the peer. Depending on events and configuration, the implementation initializes resources and waits for a start event before attempting transport establishment.

Operational interpretation:

  • The session is not established.
  • Do not assume the cause is physical connectivity.
  • Check whether the neighbor is administratively configured/activated, whether the process is running, whether a reset just occurred, and what the last reset reason says.

3.2 Connect

In Connect, BGP is waiting for the TCP connection to complete.

What reaching Connect suggests:

  • the BGP process is attempting session establishment;
  • the transport connection is the immediate dependency.

What it does not prove:

  • that IP reachability is bidirectional;
  • that TCP/179 is permitted;
  • that the peer address is correct;
  • that the remote ASN matches;
  • or that BGP OPEN negotiation will succeed.

3.3 Active

In Active, the speaker is also working on transport establishment, generally after a connection attempt has failed or while retry behavior continues.

The crucial operational rule:

> Active does not mean Established and it does not mean routes are being exchanged.

If a session repeatedly appears in Connect/Active, focus first on transport and peer reachability rather than route policy.

Typical areas to check:

  • routing to the peer address;
  • return routing;
  • source address/update-source;
  • TCP/179 ACL/firewall handling;
  • multihop/TTL design;
  • peer availability;
  • duplicate or incorrect neighbor configuration.

3.4 OpenSent

OpenSent means the TCP transport has progressed far enough for BGP OPEN processing to be underway.

This is a major troubleshooting boundary. If you reliably reach OpenSent, the problem is no longer simply “TCP cannot connect.” Now inspect BGP session parameters and OPEN validation:

  • BGP version compatibility;
  • configured/received ASN;
  • BGP Identifier validity;
  • hold-time negotiation constraints;
  • optional parameters;
  • capability requirements;
  • and NOTIFICATION information.

An ASN mismatch frequently manifests around OPEN processing, although the exact visible state may be brief because the peer can immediately send a NOTIFICATION and reset.

3.5 OpenConfirm

OpenConfirm means OPEN negotiation has succeeded sufficiently for the speaker to wait for confirmation through KEEPALIVE processing.

At this point:

  • TCP has succeeded;
  • OPEN has been accepted;
  • the session is close to Established.

If a session repeatedly reaches OpenConfirm and fails, investigate KEEPALIVE/timer behavior, transport stability, protocol errors and any reset reason rather than basic neighbor IP configuration alone.

3.6 Established

Established is the operational state in which BGP peers can exchange UPDATE, KEEPALIVE and other negotiated/defined BGP messages as applicable.

But Established proves only that the session is operational.

It does not prove:

  • required prefixes were received;
  • received prefixes passed import policy;
  • the expected path became best;
  • the route entered the RIB;
  • the route entered the FIB;
  • or end-to-end forwarding works.

This distinction will appear throughout the entire series.


4. Troubleshooting map by state

| State | What to investigate first | Common evidence |
|---|---|---|
| Idle | configuration/start/reset cause | running config, logs, neighbor detail |
| Connect | TCP establishment | routing, ping, TCP capture, ACLs |
| Active | failed/retrying transport | route to peer, source address, TCP/179, TTL/multihop |
| OpenSent | OPEN parameters | remote AS, BGP Identifier, NOTIFICATION, capabilities |
| OpenConfirm | KEEPALIVE/transport stability | message counters, timers, resets |
| Established | route exchange and forwarding | received/accepted/best routes, RIB/FIB, traffic tests |

This table is a starting point, not a substitute for evidence. A fast state transition may never be visible in a periodic CLI poll. Logs or packet capture can reveal events that show ip bgp summary misses.


5. Scenario — RETICUX Lab FND-005

Two directly connected eBGP routers form a stable session. We then apply an interface ACL that blocks BGP TCP traffic between them while leaving ICMP permitted.

Topology


BGP Finite-State Machine: States, Transitions and Session Troubleshooting
BGP Finite-State Machine: States, Transitions and Session Troubleshooting


+----------------+      203.0.113.0/30      +----------------+
| EDGE-A AS64512 |---------------------------| EDGE-B AS64513 |
| 203.0.113.1    |          eBGP             | 203.0.113.2    |
+----------------+                           +----------------+

Success criteria before fault

  • Ping works both ways.
  • BGP is Established.
  • Neighbor detail shows normal message activity.

Fault objective

Demonstrate that IP reachability can remain healthy while TCP/BGP establishment fails, causing the FSM to remain outside Established.


6. Baseline configuration

EDGE-A

hostname EDGE-A
!
interface GigabitEthernet0/0
 ip address 203.0.113.1 255.255.255.252
 no shutdown
!
router bgp 64512
 bgp log-neighbor-changes
 neighbor 203.0.113.2 remote-as 64513
 address-family ipv4
  neighbor 203.0.113.2 activate
 exit-address-family

EDGE-B

hostname EDGE-B
!
interface GigabitEthernet0/0
 ip address 203.0.113.2 255.255.255.252
 no shutdown
!
router bgp 64513
 bgp log-neighbor-changes
 neighbor 203.0.113.1 remote-as 64512
 address-family ipv4
  neighbor 203.0.113.1 activate
 exit-address-family

7. Verification before modification

On both routers:

show ip bgp summary
show ip bgp neighbors

Expected relevant evidence:

  • state Established;
  • remote AS correct;
  • connection uptime increasing;
  • KEEPALIVE/OPEN message counters present;
  • no recent unexpected reset.

Verify IP connectivity:

ping 203.0.113.2

from EDGE-A and the reverse from EDGE-B.


8. Controlled modification — block only BGP TCP on EDGE-A inbound

Apply this ACL on EDGE-A:

configure terminal
ip access-list extended BLOCK-BGP-FSM-LAB
 deny tcp host 203.0.113.2 host 203.0.113.1 eq bgp
 deny tcp host 203.0.113.2 eq bgp host 203.0.113.1
 permit ip any any
!
interface GigabitEthernet0/0
 ip access-group BLOCK-BGP-FSM-LAB in
end

Then allow the existing session to fail naturally or, in a controlled lab only, perform a BGP reset to force immediate re-establishment testing.

Do not casually clear production BGP sessions merely to make a lab symptom appear faster.

Expected control-plane result

The session cannot complete/re-establish the TCP connection. The exact instantaneous FSM state can vary as the implementation retries, but the session should not remain Established while the ACL blocks the required TCP exchange.

Expected data-plane observation

ICMP can still pass because the ACL permits other IP traffic. This creates the important troubleshooting clue: ping succeeds but BGP transport fails.


9. Fault injection

Illustrative lab

BGP Finite-State Machine: States, Transitions and Session Troubleshooting
BGP Finite-State Machine: States, Transitions and Session Troubleshooting


Fault

An inbound ACL on EDGE-A blocks TCP traffic associated with BGP between the two peer addresses while permitting other IP traffic.

Symptoms

  • Ping succeeds.
  • BGP is not Established.
  • FSM may cycle through connection-establishment states.
  • Route exchange stops.
  • Logs can show neighbor down/reset events.

Why this fault is useful

It proves that “I can ping the neighbor” is necessary evidence for IP reachability but is not sufficient evidence for BGP transport.


10. Evidence-based troubleshooting

Step 1 — scope

show ip bgp summary

Confirm that the problem is the session, not merely a missing prefix.

Step 2 — confirm Layer 3

ping 203.0.113.2
show ip route 203.0.113.2

If ping succeeds and the route is connected, do not stop troubleshooting.

Step 3 — inspect FSM and reset reason

show ip bgp neighbors 203.0.113.2
show logging

Record the state and recent connection/reset information.

Step 4 — inspect interface policy

show ip interface GigabitEthernet0/0
show access-lists BLOCK-BGP-FSM-LAB

ACL counters can provide direct evidence that the BGP TCP packets are hitting the deny statements.

Step 5 — packet capture where available

A controlled capture can show repeated TCP SYN attempts without successful completion. Do not fabricate packet details if no capture was taken.

Step 6 — correct the proven layer

Remove the ACL or modify it to permit the authorized BGP transport. Do not change ASNs, timers or BGP path policy when the failure is clearly at transport filtering.


11. Root cause and correction

Root cause

The interface ACL blocked the TCP exchange required for BGP while permitting ICMP. IP reachability therefore looked healthy even though BGP could not complete transport/session establishment.

Correction

configure terminal
interface GigabitEthernet0/0
 no ip access-group BLOCK-BGP-FSM-LAB in
end

Or, in a production design, replace the test ACL with a deliberate control-plane policy that permits only authorized BGP peers rather than removing protection entirely.


12. Post-fix verification

show ip bgp summary
show ip bgp neighbors 203.0.113.2
show logging

Confirm:

  • state returns to Established;
  • uptime begins increasing;
  • message counters increment;
  • no recurring reset reason appears.

Then verify any expected routes and forwarding separately.


13. Rollback

The rollback for the fault is the ACL removal shown above.

If the ACL itself is part of a broader security policy, rollback should instead restore the previous known-good ACL version. Preserve:

  • the ACL before/after;
  • hit counters;
  • BGP neighbor detail;
  • syslog timestamps;
  • packet capture if taken.

Independent management access is mandatory when testing control-plane ACLs remotely.


14. Production lessons

Troubleshooting lesson

Use the FSM to identify the next dependency, not to guess the root cause.

Transport lesson

Ping success does not prove TCP/179 success.

Observability lesson

Fast FSM states may be missed by CLI polling. Logs, neighbor reset reasons and packet captures can show the actual sequence.

Change-management lesson

Control-plane ACL changes deserve the same rollback discipline as BGP policy changes because they can drop every route from a peer at once.

Standards lesson

The core FSM comes from RFC 4271, while later standards such as RFC 9687 can extend behavior. Always separate baseline protocol rules from implementation/version support.


15. Knowledge check

Q1

A BGP peer is repeatedly in Active. Should you first inspect LOCAL_PREF or TCP reachability?

Answer: TCP/peer reachability. LOCAL_PREF affects path selection after routes are exchanged; it does not establish the BGP transport session.

Q2

A peer reaches OpenSent and then resets. What category of configuration becomes more likely than a simple missing route to the peer?

Answer: OPEN/session-parameter problems such as ASN mismatch, BGP Identifier/OPEN validation, capability requirements or a received NOTIFICATION.

Q3

A peer is Established but receives zero expected routes. Is the FSM still the primary troubleshooting focus?

Answer: No. The session is operational. Move to route origination, received/accepted route state, policy, best path, next hop, RIB/FIB and forwarding.


16. Sources

  1. RFC 4271 — *A Border Gateway Protocol 4 (BGP-4)*, Section 8 FSM and related message processing.
  2. RFC 9687 — *Border Gateway Protocol 4 (BGP-4) Send Hold Timer*.
  3. Cisco — *BGP Command Reference: show ip bgp neighbors*.
  4. Cisco — *IP Routing Configuration Guide, Cisco IOS XE 17.x*.

Accessed: 2026-08-11.


Day 4 — BGP Transport Mechanics: TCP/179, Reachability, Update-Source and eBGP Multihop

Learning objective

Build and troubleshoot a BGP session whose peer addresses are loopbacks, explaining the separate roles of IP reachability, TCP/179, source-address selection, and the eBGP TTL/multihop constraint.



BGP Transport Mechanics



1. Opening — BGP can be correct while the transport underneath it is impossible

When show ip bgp summary displays Active, engineers often begin changing BGP commands. That can be the wrong layer.

BGP does not discover neighbors automatically in the classic configuration model. A BGP peer is configured explicitly, and the protocol rides over TCP. Before OPEN messages, capabilities, path attributes or policies can matter, packets must be able to reach the configured peer address and a TCP connection must be established.

That means BGP troubleshooting starts below BGP:

  • Is the destination peer address reachable?
  • Is the correct local source address being used?
  • Can the peer route back to that source?
  • Is TCP/179 permitted?
  • If eBGP peers are not directly connected, is the TTL/multihop design intentional?
  • Is the neighbor configured against the address the remote router actually uses as its source?

Loopback-based peering makes these dependencies visible and is therefore an ideal teaching lab.


2. Concept and standards behaviour

2.1 BGP relies on TCP

RFC 4271 specifies BGP operation over TCP. TCP provides reliable, ordered delivery, retransmission and connection state. BGP does not need to reinvent those transport functions.

The well-known BGP server port is TCP 179. During connection establishment, one side may initiate toward destination port 179 while the local ephemeral/source port is chosen by TCP. BGP implementations also contain connection-collision handling because both sides can attempt connections.

2.2 Reachability is bidirectional

For a configured BGP peer to work, the local router must be able to route packets to the peer address, and the remote router must be able to return traffic to the local source address.

A one-way static route can therefore create deceptive symptoms: the forward ping may fail, TCP may partially progress, or packets may arrive at the remote device with a source address that has no return route.

2.3 Direct-interface peering versus loopback peering

Direct eBGP commonly peers using the addresses on the shared point-to-point link. This is simple because each peer is directly connected.

Loopback peering is useful when the operator wants the BGP session identity to be independent of one physical link. The loopback remains logically up while individual transport paths can change, provided the underlay still routes to it.

But loopback peering introduces two explicit requirements:

  1. The BGP process must source the TCP connection from the intended loopback address.
  2. The network must route to the remote loopback address.

On Cisco IOS XE, neighbor <address> update-source <interface> selects the source interface/address for the BGP session.

2.4 Why eBGP multihop appears

Classic directly connected eBGP assumes a very small hop distance between external peers. When the configured eBGP neighbor address is a loopback or otherwise not directly connected, the operator must intentionally permit the greater hop distance.

On Cisco IOS XE, this is commonly done with:

neighbor <peer> ebgp-multihop <ttl>

The exact TTL should be chosen deliberately. Configuring an unnecessarily large value increases the set of possible source distances and weakens the natural adjacency constraint. Later security coverage will compare eBGP multihop with TTL Security/GTSM.

2.5 update-source and ebgp-multihop solve different problems

This distinction is crucial:

  • update-source controls the local source address/interface used for the BGP TCP session.
  • ebgp-multihop permits eBGP establishment across more than the directly connected hop model.
  • routing/static/IGP configuration provides reachability to the peer address.
  • ACL/firewall policy permits the transport.

One command cannot substitute for the others.


3. Scenario — RETICUX Lab FND-004

Two edge routers in different ASes have two parallel physical paths. They will peer using loopbacks so the BGP session is not tied to one interface address.

Topology


Loopback based eBGP transport
Loopback based eBGP transport




              Path A: 192.0.2.0/30
        +--------------------------------+
        |                                |
   +---------+                        +---------+
   | EDGE-A  |                        | EDGE-B  |
   | AS64512 |                        | AS64513 |
   +---------+                        +---------+
        |                                |
        +--------------------------------+
              Path B: 192.0.2.4/30

Loopback0 EDGE-A: 198.51.100.1/32
Loopback0 EDGE-B: 198.51.100.2/32
BGP peer addresses: the loopbacks

Underlay

  • EDGE-A Gi0/0 192.0.2.1/30 ↔ EDGE-B Gi0/0 192.0.2.2/30
  • EDGE-A Gi0/1 192.0.2.5/30 ↔ EDGE-B Gi0/1 192.0.2.6/30
  • Static routes provide reachability to the remote loopback through both links; the example uses one primary static and one floating backup for clarity.

Success criteria

  • Both routers can ping the remote loopback using the local loopback as source.
  • TCP/179 is reachable.
  • BGP establishes between 198.51.100.1 and 198.51.100.2.
  • Failure of the primary physical path does not require changing BGP neighbor addresses if the backup underlay route remains.

4. Baseline underlay configuration

EDGE-A

hostname EDGE-A
!
interface Loopback0
 ip address 198.51.100.1 255.255.255.255
!
interface GigabitEthernet0/0
 ip address 192.0.2.1 255.255.255.252
 no shutdown
!
interface GigabitEthernet0/1
 ip address 192.0.2.5 255.255.255.252
 no shutdown
!
ip route 198.51.100.2 255.255.255.255 192.0.2.2
ip route 198.51.100.2 255.255.255.255 192.0.2.6 10

EDGE-B

hostname EDGE-B
!
interface Loopback0
 ip address 198.51.100.2 255.255.255.255
!
interface GigabitEthernet0/0
 ip address 192.0.2.2 255.255.255.252
 no shutdown
!
interface GigabitEthernet0/1
 ip address 192.0.2.6 255.255.255.252
 no shutdown
!
ip route 198.51.100.1 255.255.255.255 192.0.2.1
ip route 198.51.100.1 255.255.255.255 192.0.2.5 10

Prove transport reachability before BGP

From EDGE-A:

ping 198.51.100.2 source 198.51.100.1
show ip route 198.51.100.2

From EDGE-B:

ping 198.51.100.1 source 198.51.100.2
show ip route 198.51.100.1

If these tests fail, do not begin by clearing BGP. Fix the underlay first.


5. BGP configuration

EDGE-A

router bgp 64512
 bgp log-neighbor-changes
 neighbor 198.51.100.2 remote-as 64513
 neighbor 198.51.100.2 update-source Loopback0
 neighbor 198.51.100.2 ebgp-multihop 2
 address-family ipv4
  neighbor 198.51.100.2 activate
 exit-address-family

EDGE-B

router bgp 64513
 bgp log-neighbor-changes
 neighbor 198.51.100.1 remote-as 64512
 neighbor 198.51.100.1 update-source Loopback0
 neighbor 198.51.100.1 ebgp-multihop 2
 address-family ipv4
  neighbor 198.51.100.1 activate
 exit-address-family

The TTL value of 2 is chosen because the configured peer is reached through one intermediate forwarding hop in the loopback-to-loopback model of this lab. Operators must calculate this based on the real topology rather than copying a high arbitrary value.


6. Verification before modification

Session summary

show ip bgp summary

Detailed neighbor state

show ip bgp neighbors 198.51.100.2

Relevant fields to inspect include:

  • remote AS;
  • external/internal link classification;
  • BGP FSM state;
  • uptime;
  • negotiated capabilities;
  • message counters;
  • local/foreign TCP endpoints where displayed;
  • last reset reason;
  • transport statistics.

Verify routing to the peer

show ip route 198.51.100.2
show ip cef 198.51.100.2 detail

The first command confirms the RIB path. The second can help verify forwarding resolution on platforms where the CEF detail is available and useful.


7. Controlled modification — remove update-source

On EDGE-A:

configure terminal
router bgp 64512
 no neighbor 198.51.100.2 update-source Loopback0
end

Expected behavior

EDGE-A may now source the connection using an address selected from the outgoing path rather than 198.51.100.1. EDGE-B, however, is configured to recognize 198.51.100.1 as its BGP neighbor.

The result is a peer-address/source mismatch. Underlay reachability to both loopbacks can remain perfectly healthy while BGP fails to establish as designed.


8. Fault injection

Illustrative lab — not a real incident.



Fault

Remove update-source Loopback0 from EDGE-A but leave both routers configured to peer with loopback addresses.

Symptoms

  • Ping between loopbacks can still succeed.
  • The BGP session drops or fails to establish.
  • The remote device may see connection attempts from an unexpected interface address.
  • Repeated BGP resets do not fix the configuration mismatch.

9. Troubleshooting sequence

Step 1 — confirm scope

Only the BGP session is down; interfaces and static routes remain present.

Step 2 — verify peer reachability

ping 198.51.100.2 source 198.51.100.1

Step 3 — inspect the route to the neighbor

show ip route 198.51.100.2

Step 4 — inspect BGP state and reset reason

show ip bgp summary
show ip bgp neighbors 198.51.100.2

Step 5 — inspect configured source

show running-config | section router bgp

Step 6 — confirm multihop configuration

Verify that both peers have a deliberately sufficient ebgp-multihop setting.

Step 7 — check transport policy

If source and route are correct but TCP still fails, check ACLs/firewalls/control-plane policies for TCP 179. On a lab platform, packet capture can confirm SYN/SYN-ACK behavior.

Step 8 — make the smallest correction

Restore the intended source interface rather than changing remote AS, timers or unrelated policy.


10. Root cause and correction

Root cause

The BGP session was designed between loopback addresses, but EDGE-A stopped sourcing the TCP session from its loopback after update-source was removed.

Correction

configure terminal
router bgp 64512
 neighbor 198.51.100.2 update-source Loopback0
end

Why it works

The outgoing TCP connection once again uses the address that EDGE-B is configured to recognize as its peer.


11. Post-fix verification and path failover

After the session re-establishes:

show ip bgp summary
show ip bgp neighbors 198.51.100.2

Then test the transport resilience by shutting the primary physical link on EDGE-A:

configure terminal
interface GigabitEthernet0/0
 shutdown
end

Verify that the floating static route to the remote loopback becomes active:

show ip route 198.51.100.2
ping 198.51.100.2 source 198.51.100.1

Depending on failure detection and TCP behavior, the existing BGP session may survive if the path changes without breaking transport, or it may reset and re-establish through the alternate path. The key architectural advantage is that the BGP neighbor identity does not need to change simply because the underlay path changes.

Do not claim a specific failover time without executing the exact image/platform and measuring it.


12. Rollback

Restore the primary link:

configure terminal
interface GigabitEthernet0/0
 no shutdown
end

Restore update-source if it was removed:

router bgp 64512
 neighbor 198.51.100.2 update-source Loopback0

Preserve:

show ip bgp summary
show ip bgp neighbors 198.51.100.2
show ip route 198.51.100.2
show logging

before clearing sessions during a production incident.


13. Production lessons

Layering lesson

BGP troubleshooting begins with IP and TCP. If the peer address is unreachable, BGP policy is irrelevant.

Design lesson

Loopback peering decouples session identity from a physical interface but requires an underlay that can reach the loopbacks.

Configuration lesson

update-source and ebgp-multihop address separate requirements. Copying only one of them is not a complete loopback-peering design.

Security lesson

Do not configure unnecessarily high eBGP multihop TTLs. Later we will use TTL Security/GTSM to constrain session origin more deliberately.

Operations lesson

Preserve transport evidence before clearing BGP. A reset destroys useful state and can hide the actual sequence of failure.


14. Knowledge check

Q1

Two eBGP routers can ping each other’s loopbacks, but the loopback-based BGP session fails because one router sources TCP from a physical interface. Which Cisco feature directly addresses the source selection?

Answer: neighbor <peer> update-source <interface>.

Q2

Why might update-source Loopback0 still be insufficient for an eBGP loopback session?

Answer: The peers also need routability to each other’s loopbacks, return reachability, and an eBGP hop/TTL design such as an appropriate ebgp-multihop setting; TCP/179 must also be permitted.

Q3

Why is ebgp-multihop 255 a poor default habit?

Answer: It permits a much broader hop distance than usually required, reducing the adjacency constraint. The TTL should be intentionally limited to the topology, with GTSM considered where appropriate.


15. Sources

  1. RFC 4271 — *A Border Gateway Protocol 4 (BGP-4)*.
  2. Cisco — *IP Routing Configuration Guide, Cisco IOS XE 17.x: Configuring a Basic BGP Network*.
  3. Cisco — *BGP Command Reference: show ip bgp neighbors*.
  4. Cisco — *IP Routing Configuration Guide: Connecting to a Service Provider Using External BGP*.

Accessed: 2026-08-11.


Day 3 — eBGP vs iBGP: Session Roles, Propagation Rules and Forwarding Implications

Learning objective

Explain how eBGP and iBGP serve different roles, predict how routes propagate between them, and diagnose the classic case where an iBGP-learned route stops at another iBGP speaker.



eBGP vs iBGP



1. Opening — “BGP is BGP” is true only at the protocol layer

BGP uses the same protocol machinery whether two peers belong to the same autonomous system or different autonomous systems, but the routing semantics are not identical.

That distinction matters because a design can contain perfectly healthy BGP sessions while still failing to distribute routes where the operator expects them to go.

A common example is an enterprise with an Internet edge router, an internal route-distribution router, and another internal router. The edge learns an Internet prefix over eBGP and sends it to an iBGP peer. The engineer then expects that peer to pass the route to a second iBGP peer. It does not. The sessions are all Established. No ACL is blocking TCP. The route is valid. Yet propagation stops.

The reason is one of the most important iBGP rules in the protocol: a route learned from an internal BGP peer is not normally advertised to another internal BGP peer. This rule prevents loops inside an AS because the AS_PATH is not modified for ordinary iBGP propagation in the same way it is across eBGP boundaries.

Understanding this single rule leads directly to later topics such as iBGP full mesh, route reflectors, confederations and Add-Path.


2. Concept and standards behaviour

2.1 External BGP

An eBGP session is a BGP peering relationship between speakers in different autonomous systems.

Typical uses include:

  • enterprise-to-ISP peering;
  • ISP-to-customer peering;
  • ISP-to-ISP transit;
  • settlement-free peering;
  • Internet exchange bilateral sessions;
  • inter-AS MPLS or service-provider designs;
  • and some data-centre underlays that intentionally use distinct ASNs per leaf or pod.

When a route crosses an ordinary eBGP boundary, the sending AS contributes to the AS path. That makes the AS_PATH a visible history of inter-AS traversal and provides loop prevention when a receiving AS sees its own ASN in the path.

2.2 Internal BGP

iBGP is BGP between speakers in the same autonomous system.

Its job is usually not to create a new interdomain boundary. Instead, it distributes BGP reachability and policy information inside the AS so multiple routers can make consistent decisions about external routes or BGP-carried services.

Examples include:

  • distributing Internet routes between enterprise edge routers;
  • carrying service-provider customer routes through a backbone;
  • carrying VPNv4/VPNv6 routes between provider-edge routers;
  • carrying EVPN routes in a data-centre fabric;
  • and distributing routes among route-reflector clients.

2.3 Why iBGP does not simply re-advertise iBGP-learned routes

In ordinary iBGP, a route learned from one iBGP peer is not advertised to another iBGP peer.

The operational consequence is the classic full-mesh requirement: if every iBGP speaker must directly exchange ordinary iBGP-learned routes with every other speaker, all speakers need direct iBGP peerings unless the architecture uses route reflection or confederations.

For n iBGP speakers, a full mesh requires:

n(n-1)/2

sessions.

This scales poorly as n grows, which is why route reflectors become a major design topic later in the series.

2.4 AS_PATH behavior

The inter-AS boundary and the AS path are tightly related.

At a high level:

  • ordinary eBGP propagation adds the local ASN to the AS path;
  • ordinary iBGP propagation inside the same AS does not add another copy of the local ASN for each internal hop.

If iBGP speakers were allowed to freely pass iBGP routes to one another without additional loop-control machinery, AS_PATH alone would not reveal those internal hops. The no-iBGP-to-iBGP propagation rule is therefore fundamental to loop prevention in classic iBGP.

2.5 Next-hop implications

Another important difference is next-hop handling.

When an external route is passed into iBGP, the internal routers must be able to resolve the BGP next hop. Depending on the topology and configuration, the original external next hop may not be reachable from internal routers.

A common Cisco design tool is next-hop-self, which causes the advertising iBGP speaker to make itself the next hop for the routes sent to a peer.

This lab uses next-hop-self deliberately so that the propagation lesson is not obscured by an unrelated next-hop reachability failure. Day 9 will treat NEXT_HOP in depth.

2.6 eBGP and iBGP are not “Internet BGP” and “private BGP”

The names describe the relationship between autonomous systems, not whether a route is public or private.

An internal BGP session may carry public Internet routes. An eBGP session may operate entirely inside a private data centre using private ASNs. The session classification comes from ASN relationship and design, not from whether the prefixes are globally routable.


3. Scenario — RETICUX Lab FND-003

AS 64512 has one Internet edge and two internal BGP speakers. The external provider is AS 64513.

Topology



Autonomous System Numbers


                       AS 64512

                 iBGP              iBGP
+--------+ 192.0.2.0/30 +-------+ 192.0.2.4/30 +-------+
| EDGE-A |--------------| CORE1 |---------------| CORE2 |
+--------+              +-------+               +-------+
    |
    | eBGP 203.0.113.0/30
    |
+--------+
| ISP-A  |
|AS64513 |
+--------+
    |
 198.51.100.0/24

Interfaces

  • EDGE-A Gi0/0: 203.0.113.1/30
  • ISP-A Gi0/0: 203.0.113.2/30
  • EDGE-A Gi0/1: 192.0.2.1/30
  • CORE1 Gi0/0: 192.0.2.2/30
  • CORE1 Gi0/1: 192.0.2.5/30
  • CORE2 Gi0/0: 192.0.2.6/30
  • ISP-A Loopback10: 198.51.100.1/24

BGP peerings

  • ISP-A ↔ EDGE-A: eBGP, AS 64513 ↔ AS 64512
  • EDGE-A ↔ CORE1: iBGP, both AS 64512
  • CORE1 ↔ CORE2: iBGP, both AS 64512

Expected behavior

  1. ISP-A originates 198.51.100.0/24.
  2. EDGE-A learns it over eBGP.
  3. EDGE-A advertises it to CORE1 over iBGP.
  4. CORE1 does not advertise that iBGP-learned route to CORE2 under classic iBGP rules.

This is the intended fault-demonstration state, not a platform bug.


4. Prerequisites

  • Four IOS XE virtual routers.
  • Basic IPv4 connectivity on all point-to-point links.
  • No route-reflector configuration.
  • No confederation configuration.
  • No IGP is required for this small directly connected demonstration.
  • next-hop-self is configured from EDGE-A toward CORE1 so CORE1 can resolve the external route through EDGE-A.

5. Baseline configuration

ISP-A — AS 64513

hostname ISP-A
!
interface GigabitEthernet0/0
 ip address 203.0.113.2 255.255.255.252
 no shutdown
!
interface Loopback10
 ip address 198.51.100.1 255.255.255.0
!
router bgp 64513
 bgp log-neighbor-changes
 neighbor 203.0.113.1 remote-as 64512
 address-family ipv4
  network 198.51.100.0 mask 255.255.255.0
  neighbor 203.0.113.1 activate
 exit-address-family

EDGE-A — AS 64512

hostname EDGE-A
!
interface GigabitEthernet0/0
 ip address 203.0.113.1 255.255.255.252
 no shutdown
!
interface GigabitEthernet0/1
 ip address 192.0.2.1 255.255.255.252
 no shutdown
!
router bgp 64512
 bgp log-neighbor-changes
 neighbor 203.0.113.2 remote-as 64513
 neighbor 192.0.2.2 remote-as 64512
 address-family ipv4
  neighbor 203.0.113.2 activate
  neighbor 192.0.2.2 activate
  neighbor 192.0.2.2 next-hop-self
 exit-address-family

CORE1 — AS 64512

hostname CORE1
!
interface GigabitEthernet0/0
 ip address 192.0.2.2 255.255.255.252
 no shutdown
!
interface GigabitEthernet0/1
 ip address 192.0.2.5 255.255.255.252
 no shutdown
!
router bgp 64512
 bgp log-neighbor-changes
 neighbor 192.0.2.1 remote-as 64512
 neighbor 192.0.2.6 remote-as 64512
 address-family ipv4
  neighbor 192.0.2.1 activate
  neighbor 192.0.2.6 activate
 exit-address-family

CORE2 — AS 64512

hostname CORE2
!
interface GigabitEthernet0/0
 ip address 192.0.2.6 255.255.255.252
 no shutdown
!
router bgp 64512
 bgp log-neighbor-changes
 neighbor 192.0.2.5 remote-as 64512
 address-family ipv4
  neighbor 192.0.2.5 activate
 exit-address-family

6. Verification before modification

On EDGE-A

show ip bgp summary
show ip bgp 198.51.100.0 255.255.255.0

Expected relevant evidence:

  • ISP-A is an external peer.
  • CORE1 is an internal peer.
  • 198.51.100.0/24 is learned from AS 64513.

On CORE1

show ip bgp summary
show ip bgp 198.51.100.0 255.255.255.0
show ip route 198.51.100.0 255.255.255.0

Expected:

  • the route is present in BGP;
  • the path still reflects external origin AS 64513;
  • the next hop is EDGE-A because next-hop-self was applied.

On CORE2

show ip bgp summary
show ip bgp 198.51.100.0 255.255.255.0

Expected:

  • the iBGP session to CORE1 is Established;
  • the external prefix is absent.

This is the key observation: session success does not imply route propagation is permitted by BGP rules.


7. Controlled modification — add the missing full-mesh session

Classic iBGP can solve the problem by peering CORE2 directly with EDGE-A, but because they are not directly connected in this topology, transport reachability would first need to be provided. For a focused lab, add a loopback on each internal BGP speaker and static routes or an IGP, then build a direct logical iBGP session between EDGE-A and CORE2.

For this day, the conceptual correction is:

EDGE-A <---------------- iBGP ----------------> CORE2

rather than expecting CORE1 to relay EDGE-A’s iBGP route.

In production networks with many routers, adding every pairwise session becomes operationally expensive. That is precisely why route reflectors exist; they will be covered in their own module rather than smuggled into this foundational lab.


8. Fault injection

Illustrative lab — not a real incident.

Lab name

FND-003-IBGP-NONTRANSIT

Fault

The operator assumes CORE1 will act as a BGP transit point between two ordinary iBGP sessions.

Symptoms

  • All three relevant BGP sessions can be Established.
  • CORE1 has the route.
  • CORE2 does not receive it.
  • There is no TCP failure.
  • There is no prefix-list or route-map denying it.

Expected forwarding impact

CORE2 has no BGP route to the provider prefix and cannot forward toward it unless another routing source supplies a route.


9. Troubleshooting

``text show ip bgp summary ``

``text show ip bgp 198.51.100.0 255.255.255.0 ``

``text show ip bgp neighbors 192.0.2.6 advertised-routes ``

``text show running-config | section router bgp ``

  1. Confirm all neighbor sessions.
  2. On CORE1, confirm the route exists.
  3. Confirm whether the route was learned via iBGP.
  4. On CORE1, inspect advertisements toward CORE2.
  5. Verify that no outbound route map or prefix list explains the absence.
  6. Recognize the protocol rule: an ordinary iBGP speaker does not re-advertise an iBGP-learned route to another ordinary iBGP peer.
  7. Correct the topology using full mesh, route reflection, or confederation according to scale and design requirements.

Do not repeatedly clear BGP sessions; the sessions are not the failed component.


10. Root cause and correction

Root cause

The iBGP topology is incomplete. CORE1 was incorrectly expected to relay an iBGP-learned route to CORE2.

Corrective design options

  • Small topology: Build full-mesh iBGP so CORE2 peers directly with EDGE-A.
  • Scaled topology: Introduce route reflectors.
  • Alternative architecture: Use confederations where justified.

The later scaling module will compare these approaches in detail.


11. Post-fix verification

After adding a valid direct or reflected control-plane path, verify on CORE2:

show ip bgp summary
show ip bgp 198.51.100.0 255.255.255.0
show ip route 198.51.100.0 255.255.255.0

Then perform a traffic test toward 198.51.100.1 using an appropriate source address whose return path is known.

The complete forwarding test must verify both directions; learning a destination route on CORE2 alone does not guarantee the provider has a return route to CORE2’s source.


12. Rollback

If the added full-mesh peering is only for the lab, remove it and restore the original topology after preserving outputs:

show ip bgp summary
show ip bgp 198.51.100.0 255.255.255.0
show ip bgp neighbors
show logging

In production, remove or alter iBGP topology only with independent management access and a documented rollback sequence, because losing internal BGP distribution can affect many external prefixes at once.


13. Production lessons

Architecture lesson

A chain of iBGP sessions is not equivalent to a chain of IGP adjacencies. Classic iBGP is not a hop-by-hop route-relay protocol.

Scale lesson

Full mesh is simple to reason about but scales as n(n-1)/2 sessions, which quickly motivates route-reflector architectures.

Forwarding lesson

Internal routers must also be able to resolve the BGP next hop. Route propagation and next-hop reachability are separate checks.

Troubleshooting lesson

When a route disappears between two healthy iBGP sessions, inspect where the route was learned before blaming filters or transport.

Security lesson

Do not treat eBGP as automatically untrusted and iBGP as automatically trusted. Both require deliberate policy and access controls appropriate to their role.


14. Knowledge check

Q1

CORE1 learns a route from EDGE-A over iBGP and has another ordinary iBGP session with CORE2. No route-reflector function is configured. Should CORE1 advertise that route to CORE2?

Answer: No. Classic iBGP does not normally advertise an iBGP-learned route to another iBGP peer.

Q2

Why does classic iBGP need full mesh or an alternative scaling mechanism?

Answer: Because iBGP-learned routes are not simply relayed between ordinary iBGP peers, so every speaker that needs direct exchange must peer with the others unless route reflection or confederations change the propagation architecture.

Q3

An eBGP route reaches an internal router but is not installed because the next hop is unreachable. Is that primarily a session-type problem or a next-hop reachability problem?

Answer: A next-hop reachability problem. The route can be successfully carried over iBGP yet still fail RIB installation or forwarding if the next hop cannot be resolved.


15. Sources

  1. RFC 4271 — *A Border Gateway Protocol 4 (BGP-4)*.
  2. Cisco — *IP Routing Configuration Guide, Cisco IOS XE 17.x: Configuring Internal BGP Features*.
  3. Cisco — *IP Routing Configuration Guide: Connecting to a Service Provider Using External BGP*.
  4. Cisco — *BGP Command Reference: show ip bgp neighbors*.

Accessed: 2026-08-11.


Day 2 — Autonomous System Numbers: 2-Byte, 4-Byte, Private Space and Operational Ownership

Learning objective

Distinguish public and private ASNs, understand 2-byte and 4-byte ASN operation and notation, and configure a safe lab using private ASNs without creating assumptions that would be unsafe on the public Internet.





1. Opening — an ASN is an administrative identity, not just a number in a command

The command router bgp 64512 looks simple. The operational meaning is not.

An Autonomous System Number identifies an autonomous system in interdomain routing. In production Internet routing, globally unique ASNs provide a way to describe routing-domain identity and construct the AS path used for policy and loop prevention. In private labs and some closed environments, private-use ASNs let engineers build BGP systems without consuming globally assigned numbers.

Treating the ASN as a random configuration value creates several risks:

  • using a private ASN where a globally unique ASN is required;
  • leaking private ASNs into the public Internet;
  • assuming 4-byte interoperability without checking peer support;
  • writing regular expressions that break when ASN display notation changes;
  • misunderstanding AS_TRANS during old/new speaker interoperability;
  • and confusing BGP ASN identity with IGP process IDs or OSPF area numbers.

This post establishes the numbering discipline used throughout the rest of the series.


2. Standards behaviour

2.1 The original 2-byte space

BGP originally encoded autonomous-system numbers in a two-octet field. That provides values from 0 through 65535, although not every value is available for ordinary assignment. Growth in the Internet made this number space insufficient.

2.2 Four-octet ASNs

RFC 6793 defines BGP support for four-octet ASNs and uses a BGP capability to signal support between speakers. A speaker that supports four-octet ASNs can exchange that capability during OPEN negotiation.

The key operational point is that 4-byte ASN support was designed for transition and interoperability, not as a flag day where every router had to be replaced at once.

RFC 6793 introduces mechanisms including the AS4_PATH and AS4_AGGREGATOR attributes so newer speakers can preserve four-octet information when communicating through environments that include older two-octet-only speakers.

2.3 AS_TRANS

When a new BGP speaker with a four-octet ASN must communicate with an old speaker that cannot represent the ASN directly, the special value AS_TRANS (23456) is used in relevant compatibility processing. Engineers should recognize 23456 as a transition mechanism rather than automatically treating it as the organization’s real ASN.

2.4 ASPLAIN representation

RFC 5396 defines decimal representation of the complete ASN value as the textual representation to be used. This is commonly called ASPLAIN. Cisco documentation notes that IOS/IOS XE moved to ASPLAIN as the default display/matching representation in later releases, while older software had used ASDOT-style forms.

For this series, canonical examples will use ASPLAIN unless a topic specifically discusses notation compatibility.

Example:

65551

rather than representing the same 32-bit value using dotted ASN notation.

2.5 Private-use ASN ranges

RFC 6996 reserves two ranges for private use:

  • 64512–65534
  • 4200000000–4294967294

These are appropriate for closed labs and certain private routing designs.

However, RFC 6996 gives an important operational requirement: private-use ASNs must not be allowed to remain in AS path information when prefixes using them are advertised to the global Internet. Operators must design removal/filtering appropriately at the public boundary.

2.6 Public ASN ownership

A production organization that needs a globally unique ASN obtains it through the applicable Internet number-resource process, usually via its Regional Internet Registry or an appropriate sponsoring/provider arrangement depending on policy and region.

Do not copy an ASN from a tutorial into production merely because the configuration works syntactically.


3. ASN versus other routing identifiers

An ASN is not equivalent to:

  • an OSPF process ID;
  • an OSPF area;
  • an IS-IS NET;
  • a router ID;
  • a VRF route distinguisher;
  • a BGP cluster ID;
  • a VLAN ID;
  • or a local policy tag.

The ASN participates directly in BGP protocol semantics. It can appear in AS_PATH, influence whether a peer is treated as internal or external, participate in loop prevention, and affect policy.


4. Scenario — RETICUX Lab FND-002

We will extend the two-router foundation lab with one design requirement: document why the chosen ASNs are safe for a closed environment and prove how each router classifies the peer.

ASN plan


Autonomous System Numbers

| Device | ASN | Type | Reason |
|---|---:|---|---|
| EDGE-A | 64512 | Private 16-bit range | Documentation-safe closed lab |
| EDGE-B | 4200000001 | Private 32-bit range | Demonstrates four-octet ASN operation |

Addressing

  • EDGE-A Gi0/0: 203.0.113.1/30
  • EDGE-B Gi0/0: 203.0.113.2/30
  • EDGE-A Loopback10: 192.0.2.1/24
  • EDGE-B Loopback10: 198.51.100.1/24

5. Baseline configuration

EDGE-A

hostname EDGE-A
!
interface GigabitEthernet0/0
 ip address 203.0.113.1 255.255.255.252
 no shutdown
!
interface Loopback10
 ip address 192.0.2.1 255.255.255.0
!
router bgp 64512
 bgp log-neighbor-changes
 neighbor 203.0.113.2 remote-as 4200000001
 address-family ipv4
  network 192.0.2.0 mask 255.255.255.0
  neighbor 203.0.113.2 activate
 exit-address-family

EDGE-B

hostname EDGE-B
!
interface GigabitEthernet0/0
 ip address 203.0.113.2 255.255.255.252
 no shutdown
!
interface Loopback10
 ip address 198.51.100.1 255.255.255.0
!
router bgp 4200000001
 bgp log-neighbor-changes
 neighbor 203.0.113.1 remote-as 64512
 address-family ipv4
  network 198.51.100.0 mask 255.255.255.0
  neighbor 203.0.113.1 activate
 exit-address-family

These examples intentionally combine one private ASN from each RFC 6996 private range.


6. Verification before modification

Verify the configured autonomous system and neighbor classification

show ip bgp summary
show ip bgp neighbors 203.0.113.2

On EDGE-A, expected relevant fields include:

  • local BGP process ASN 64512;
  • remote AS 4200000001;
  • neighbor shown as an external link when established/configured as a different AS.

On EDGE-B, the reverse should be true.

Verify AS_PATH

On EDGE-A:

show ip bgp 198.51.100.0 255.255.255.0

Expected relevant field:

Path: 4200000001

On EDGE-B:

show ip bgp 192.0.2.0 255.255.255.0

Expected relevant field:

Path: 64512

The exact formatting of command output is platform/release dependent; this post records only the fields that should be inspected rather than fabricating an executed transcript.


7. Controlled modification — create an ASN mismatch

On EDGE-B, intentionally configure the wrong remote ASN for EDGE-A:

configure terminal
router bgp 4200000001
 no neighbor 203.0.113.1 remote-as 64512
 neighbor 203.0.113.1 remote-as 64514
end

Expected result

The BGP session should not establish successfully because the peer identity expected by EDGE-B does not match the ASN announced by EDGE-A in the BGP OPEN process.

This is a configuration-layer identity problem, not a basic IP reachability problem.


8. Fault injection

Illustrative lab — not a real incident.

Lab name

FND-002-ASN-MISMATCH

Fault

EDGE-B expects remote AS 64514 while EDGE-A actually operates BGP AS 64512.

Symptoms

  • Layer-3 ping can still succeed.
  • TCP may be attempted.
  • BGP does not remain Established.
  • Logs/neighbor state should point toward an OPEN/peer-AS mismatch rather than loss of interface reachability.

9. Troubleshooting

``text show ip interface brief ``

``text ping 203.0.113.1 ``

``text show ip bgp summary ``

``text show running-config | section router bgp ``

``text show ip bgp neighbors 203.0.113.1 ``

  1. Confirm the physical/interface state.
  2. Confirm IP reachability.
  3. Check BGP summary.
  4. Inspect the neighbor configuration.
  5. Inspect neighbor details and recent resets.
  6. Compare the local ASN on the remote router with the configured remote-as value.
  7. Correct only the proven mismatch.

A hard reset is not a substitute for correcting incorrect identity configuration.


10. Root cause and correction

Incorrect configuration

neighbor 203.0.113.1 remote-as 64514

Correct configuration

configure terminal
router bgp 4200000001
 no neighbor 203.0.113.1 remote-as 64514
 neighbor 203.0.113.1 remote-as 64512
 address-family ipv4
  neighbor 203.0.113.1 activate
 exit-address-family
end

Why it works

The configured peer expectation once again matches EDGE-A’s actual BGP autonomous system.


11. Post-fix verification

show ip bgp summary
show ip bgp neighbors 203.0.113.1
show ip bgp 192.0.2.0 255.255.255.0
show ip route 192.0.2.0 255.255.255.0
ping 192.0.2.1 source 198.51.100.1

Check that:

  • the session is Established;
  • the peer is recognized with the intended remote ASN;
  • the route is learned with the expected AS path;
  • the route is installed;
  • forwarding succeeds.

12. Rollback

Return to the known-good neighbor statement:

configure terminal
router bgp 4200000001
 no neighbor 203.0.113.1 remote-as 64514
 neighbor 203.0.113.1 remote-as 64512
 address-family ipv4
  neighbor 203.0.113.1 activate
 exit-address-family
end

Preserve logs and neighbor reset reason before clearing sessions if an unexplained production mismatch occurs.


13. Production lessons

Design lesson

Use globally assigned ASNs for public interdomain identity and private ASNs only where the design explicitly supports them.

Security lesson

Private ASN leakage is not merely untidy documentation. It can create ambiguous paths and connectivity problems and must be controlled at Internet boundaries.

Migration lesson

Four-octet ASNs are normal in modern BGP. Legacy assumptions about 16-bit-only ranges can break filters, regexes, inventory systems and monitoring tools.

Tooling lesson

Store ASN values as 32-bit-capable integers/strings in automation and telemetry pipelines. Do not assume a maximum of 65535.

Troubleshooting lesson

When IP reachability works but BGP will not establish, compare both sides’ ASN expectations early in the investigation.


14. Knowledge check

Q1

Which private-use ASN ranges are documented by RFC 6996?

Answer: 64512–65534 and 4200000000–4294967294.

Q2

Why can ASN 23456 appear during four-octet ASN interoperability?

Answer: It is AS_TRANS, used as part of compatibility with older BGP speakers that cannot directly represent a four-octet ASN.

Q3

A company uses private ASN 64520 internally and connects to the public Internet through another globally unique ASN. What design issue must be handled at the boundary?

Answer: Private-use ASNs must not remain in AS path information advertised to the global Internet; removal/filtering must be designed and verified.


15. Sources

  1. RFC 6793 — *BGP Support for Four-Octet Autonomous System (AS) Number Space*.
  2. RFC 6996 — *Autonomous System (AS) Reservation for Private Use*.
  3. RFC 5396 — *Textual Representation of Autonomous System Numbers*.
  4. RFC 4271 — *A Border Gateway Protocol 4 (BGP-4)*.
  5. Cisco — *BGP Command Reference: show ip bgp neighbors / show ip bgp summary*.
  6. Cisco — *IP Routing Configuration Guide, Cisco IOS XE 17.x*.


#BGP #ASN #CiscoNetworking #NetworkEngineering #CCNP #InternetRouting #RETICUX

Reticux Day 1 — Why BGP Exists: Interdomain Routing, Policy and Autonomous Systems

Learning objective

By the end of this post, the reader should be able to explain why BGP is required between independently administered routing domains, distinguish reachability from policy, and build a minimal two-AS eBGP lab that exchanges only explicitly originated prefixes.


Why BGP Exists



1. Opening — the Internet cannot be routed as one giant IGP

Inside a small network, engineers can often define “best” as the path with the lowest metric. OSPF can calculate cost. IS-IS can calculate shortest paths. EIGRP can compare composite metrics. Those protocols work because a single administrative organization can agree on what the metric means and can operate the network under one routing policy.

The Internet has a different problem.

It is not one network under one operator. It is a collection of independently administered networks that may be customers, providers, peers, competitors, partners, cloud networks, content networks, universities, governments, enterprises, and access providers. Two organizations may both be able to reach the same destination and still disagree about which path should carry traffic. One path may be technically shorter but commercially unacceptable. Another may be longer but preferred because it is cheaper, contracted, more trusted, geographically controlled, or reserved for backup.

BGP exists for this environment. RFC 4271 defines BGP-4 as an inter-Autonomous System routing protocol whose primary function is to exchange network reachability information with other BGP systems. The reachability information carries path information that enables policy decisions and loop prevention.

The important idea is simple:

> BGP is not primarily a “find the numerically shortest route” protocol. It is a policy-controlled reachability exchange system between routing domains.

That distinction explains almost everything that follows in this series.


2. Concept and standards behaviour

2.1 What problem does BGP solve?

Suppose AS 64512 can reach 192.0.2.0/24, and AS 64513 can reach 198.51.100.0/24. If those organizations want to exchange traffic, they need a controlled way to tell each other:

  • which prefixes are reachable;
  • through which autonomous-system path;
  • which attributes describe the path;
  • which advertisements should be accepted;
  • which advertisements should be rejected;
  • which path should be preferred when several exist;
  • and when a previously reachable path must be withdrawn.

BGP provides that control-plane exchange.

2.2 BGP is a path-vector protocol

A distance-vector protocol tells a router something broadly equivalent to “this destination is N units away through me.” A link-state protocol distributes topology information and lets each router calculate a path.

BGP instead carries a path of autonomous systems in the AS_PATH attribute for ordinary inter-AS route propagation. This allows a receiving BGP speaker to see which autonomous systems a route has traversed and, critically, reject a route that already contains its own AS number.

That is a major loop-prevention mechanism for interdomain routing.

2.3 Reachability does not equal forwarding

A BGP speaker can learn that a prefix exists without being able to forward packets successfully to it. Successful forwarding depends on several layers:

  1. The BGP route must be accepted by policy.
  2. A path must become best or otherwise eligible for installation.
  3. The BGP next hop must be reachable.
  4. The route must be installed in the routing information base (RIB), subject to competition from other routing sources.
  5. The forwarding information base (FIB) must be programmed correctly.
  6. Interfaces, adjacency resolution, ACLs, firewalls, tunnels and downstream routing must permit actual packet delivery.

This is why later troubleshooting posts will repeatedly separate BGP control-plane evidence from data-plane evidence.

2.4 BGP is policy driven

Policy can be applied to routes as they enter or leave a router. Examples include:

  • permit only prefixes assigned to a customer;
  • reject private or bogon routes from an Internet peer;
  • prefer one provider for outbound traffic;
  • prepend the local ASN toward a backup provider;
  • attach communities for downstream treatment;
  • suppress a more-specific route under certain conditions;
  • reject routes whose origin fails an RPKI policy;
  • prevent a customer route from being re-advertised to another customer in an unsafe way.

The policy mechanism is vendor-specific; the underlying BGP attributes and protocol rules are standardized.

2.5 BGP is incremental

Once a BGP session is established and the initial routing information has been exchanged, BGP does not periodically resend the full table simply because a timer expires. Changes are communicated through incremental UPDATE messages and withdrawals. This is one reason BGP can operate with very large routing information sets, though scale still has substantial CPU, memory and convergence consequences.

2.6 BGP runs over TCP

BGP uses TCP as its transport, with TCP port 179 associated with BGP session establishment. BGP therefore relies on IP reachability and TCP mechanics rather than implementing its own reliable transport. Day 4 will examine this in depth.


3. Scenario — RETICUX Lab FND-001

Two independent lab networks need to exchange exactly one prefix each.

Engineering requirement

  • EDGE-A represents AS 64512.
  • EDGE-B represents AS 64513.
  • The routers are directly connected.
  • AS 64512 owns lab prefix 192.0.2.0/24.
  • AS 64513 owns lab prefix 198.51.100.0/24.
  • Each side must advertise only its own prefix.
  • No default route is used.

Topology

192.0.2.0/24                               198.51.100.0/24
   Lo10                                          Lo10
    |                                             |
+--------+  Gi0/0 203.0.113.1/30   203.0.113.2/30 Gi0/0 +--------+
| EDGE-A |----------------------------------------------| EDGE-B |
|AS64512 |                 eBGP                         |AS64513 |
+--------+                                              +--------+

Success criteria

  • The BGP session reaches Established.
  • EDGE-A learns 198.51.100.0/24 through AS 64513.
  • EDGE-B learns 192.0.2.0/24 through AS 64512.
  • End-to-end ICMP succeeds between the loopback prefixes when sourced appropriately.
  • No unrelated prefix is advertised.

4. Prerequisites

  • Cisco IOS XE 17.18.x target release.
  • Two virtual routers with at least two Layer-3 interfaces each, or one interface plus a loopback.
  • IPv4 unicast routing enabled.
  • Direct IP reachability across 203.0.113.0/30.
  • No ACL blocking TCP/179 or ICMP for the lab.
  • Independent management access is recommended before BGP policy changes.

5. Baseline configuration

EDGE-A — AS 64512

hostname EDGE-A
!
interface GigabitEthernet0/0
 description eBGP-to-EDGE-B
 ip address 203.0.113.1 255.255.255.252
 no shutdown
!
interface Loopback10
 description Prefix-originated-by-AS64512
 ip address 192.0.2.1 255.255.255.0
!
router bgp 64512
 bgp log-neighbor-changes
 neighbor 203.0.113.2 remote-as 64513
 address-family ipv4
  network 192.0.2.0 mask 255.255.255.0
  neighbor 203.0.113.2 activate
 exit-address-family

EDGE-B — AS 64513

hostname EDGE-B
!
interface GigabitEthernet0/0
 description eBGP-to-EDGE-A
 ip address 203.0.113.2 255.255.255.252
 no shutdown
!
interface Loopback10
 description Prefix-originated-by-AS64513
 ip address 198.51.100.1 255.255.255.0
!
router bgp 64513
 bgp log-neighbor-changes
 neighbor 203.0.113.1 remote-as 64512
 address-family ipv4
  network 198.51.100.0 mask 255.255.255.0
  neighbor 203.0.113.1 activate
 exit-address-family

Why the network statement matters

On Cisco IOS XE, the BGP network statement does not create the underlying IP route. The matching route must exist in the local routing table for BGP to originate it under the expected conditions. In this lab, each loopback interface creates the connected /24 route required for the corresponding network statement.

This is an important production lesson: BGP route origination is not the same operation as creating reachability.


6. Verification before modification

Check IP reachability

On EDGE-A:

ping 203.0.113.2

On EDGE-B:

ping 203.0.113.1

This proves the directly connected transport path is reachable before troubleshooting BGP itself.

Check BGP session state

show ip bgp summary

Expected result:

  • the neighbor is listed with the configured remote AS;
  • the session is established rather than showing an FSM state such as Idle or Active;
  • the prefix count is non-zero after exchange.

Inspect the learned prefix

On EDGE-A:

show ip bgp 198.51.100.0 255.255.255.0
show ip route 198.51.100.0 255.255.255.0

On EDGE-B:

show ip bgp 192.0.2.0 255.255.255.0
show ip route 192.0.2.0 255.255.255.0

The first command examines BGP path information. The second checks whether the selected path was installed in the IP routing table.

Forwarding test

From EDGE-A:

ping 198.51.100.1 source 192.0.2.1

From EDGE-B:

ping 192.0.2.1 source 198.51.100.1

A BGP session in Established state is not enough; the traffic test validates the forwarding path.


7. Controlled modification — withdraw reachability by removing the origin

The purpose of this modification is to demonstrate that BGP advertises reachability that exists in the control plane; it does not manufacture the route simply because a network command is present.

On EDGE-A, shut Loopback10:

configure terminal
interface Loopback10
 shutdown
end

Expected control-plane result

The connected route for 192.0.2.0/24 disappears. The BGP process can no longer satisfy the route-origination condition for that exact network statement, so the prefix should be withdrawn from EDGE-B.

Expected data-plane result

Traffic from EDGE-B to 192.0.2.1 fails because the destination is no longer available and the BGP route is withdrawn.

Monitoring signal

show ip route 192.0.2.0 255.255.255.0
show ip bgp 192.0.2.0 255.255.255.0
show ip bgp neighbors 203.0.113.1

8. Fault injection

Illustrative lab — not a real incident.

Lab name

FND-001-ORIGIN-MISSING

Fault

Remove the local route while leaving the BGP network statement in configuration.

Initial symptom

The BGP session remains established, but the remote router no longer learns the prefix.

Why this fault matters

A common beginner assumption is that “the neighbor is up, therefore BGP should advertise the configured network.” The missing evidence is the local route used to satisfy origination.


9. Step-by-step troubleshooting

``text show ip bgp summary ``

``text show ip route 192.0.2.0 255.255.255.0 ``

``text show ip bgp 192.0.2.0 255.255.255.0 ``

``text show running-config | section router bgp ``

``text show ip bgp neighbors 203.0.113.2 advertised-routes ``

  1. Confirm that the BGP neighbor remains established.
  2. Check whether the local route exists.
  3. Check whether BGP has the prefix locally.
  4. Inspect the exact network statement.
  5. Check what is being advertised to the neighbor.
  6. Prove the smallest root cause: the required local route is absent.
  7. Restore the source of the route rather than resetting the BGP session unnecessarily.

10. Root cause and correction

Root cause

Loopback10 was shut down, removing 192.0.2.0/24 from the local RIB. The BGP network statement remained configured, but its origination condition was no longer met.

Correction

configure terminal
interface Loopback10
 no shutdown
end

Why the correction works

The connected route returns to the RIB. BGP can again originate the matching prefix and advertise it to the external peer.


11. Post-fix verification

On EDGE-A:

show ip interface brief | include Loopback10
show ip route 192.0.2.0 255.255.255.0
show ip bgp 192.0.2.0 255.255.255.0
show ip bgp neighbors 203.0.113.2 advertised-routes

On EDGE-B:

show ip bgp 192.0.2.0 255.255.255.0
show ip route 192.0.2.0 255.255.255.0
ping 192.0.2.1 source 198.51.100.1

Observe the session for several minutes in the lab and confirm that no unexpected resets occur.


12. Rollback

If the controlled modification itself causes an unexpected lab problem, restore the loopback:

configure terminal
interface Loopback10
 no shutdown
end

If experimenting with BGP policy on a remote environment, maintain independent management access so a routing mistake cannot lock out the operator.

Preserve before/after outputs of:

show ip bgp summary
show ip bgp
show ip route
show logging

13. Production lessons

Design lesson

BGP should be introduced because administrative policy and interdomain reachability require it, not merely because it is considered an “advanced” routing protocol.

Change-management lesson

Separate transport/session changes from route-origination and policy changes. If too many variables change at once, fault isolation becomes much harder.

Monitoring lesson

Track both session state and prefix state. A session can remain healthy while required routes disappear.

Security lesson

A working BGP session does not mean every learned route should be trusted. Production eBGP requires explicit import/export policy, ownership validation and containment controls covered later in the series.

Scale lesson

BGP’s incremental update model supports large routing systems, but route count, path count, policy complexity and churn all affect CPU, memory and convergence.


14. Knowledge check

Q1

Two ISP links are available. One path has fewer AS hops, but the business contract requires outbound traffic to use the other provider unless it fails. Why is BGP appropriate?

Answer: Because BGP supports policy-based path selection. The “preferred” route can be determined by administrative policy rather than a single shortest-path metric.

Q2

A BGP neighbor is Established, but a locally configured network is not visible on the peer. What should you verify before resetting the session?

Answer: Verify that the exact route required for origination exists in the local routing table, then check the local BGP table and advertised routes.

Q3

A route is visible in the BGP table but traffic still fails. Name two layers to check next.

Answer: Check next-hop reachability/RIB installation and then FIB/data-plane forwarding, including interfaces and policy devices in the path.


15. Sources

  1. RFC 4271 — *A Border Gateway Protocol 4 (BGP-4)*, RFC Editor.
  2. Cisco — *IP Routing Configuration Guide, Cisco IOS XE 17.x: Configuring a Basic BGP Network*.
  3. Cisco — *IP Routing Configuration Guide: Connecting to a Service Provider Using External BGP*.
  4. Cisco — *BGP Command Reference: show ip bgp / show ip bgp neighbors / show ip bgp summary*.

Accessed: 2026-08-11.




#BGP #Cisco #NetworkEngineering #Routing #CCNP #InternetRouting #RETICUX

IP addressing and subnetting Guide - CCNA CCNP - Networking

 

IP Address Classes

Figure 1 IP Classes

 

Private Address Space

Class A 10.0.0.0 to 10.255.255.255

Class B 172.16.0.0 to 172.31.255.255

Class C 192.168.0.0 to 192.168.255.255

 

Default Subnet Masks

Class A 255.0.0.0

Class B 255.255.0.0

Class C 255.255.255.0

 

 

Figure 2 Decimal to Binary conversion

 

 

Figure 3 Binary to Decimal conversion

 

 

Figure 4Network and host identification

 

 

Figure 5 Network Addresses

 

 

Figure 6 Host address identification

 

 

How to determine the number of subnets and the number of hosts per subnet

 

Two formulas can provide this basic information:

Number of subnets = 2S (Second subnet formula: Number of subnets = 2S - 2)

Number of hosts per subnet = 2h - 2

Both formulas calculate the number of hosts or subnets based on the number of binary bits used. For example if you borrow three bits from the host portion of the address use the number of subnets formula to determine the total number of subnets gained by borrowing the three bits. This would be 23 or 2 x 2 x 2 = 8 subnets

To determine the number of hosts per subnet you would take the number of binary bits used in the host portion and apply this to the number of hosts per subnet formula If five bits are in the host portion of the address this would be 25 or 2 x 2 x 2 x 2 x 2 = 32 hosts.

When dealing with the number of hosts per subnet you have to subtract two addresses from the range. The first address in every range is the subnet number. The last address in every range is the broadcast address. These two addresses cannot be assigned to any device in the network which is why you have to subtract two addresses to find the number of usable addresses in each range.

For example, if two bits are borrowed for the network portion of the address you can easily determine the number of subnets and hosts per subnets using the two formulas.

 

 

What about that second subnet formula:

Number of subnets = 2S - 2

In some instances the first and last subnet range of addresses are reserved. This is similar to the first and last host addresses in each range of addreses.

The first range of addresses is the zero subnet. The subnet number for the zero subnet is also the subnet number for the classful subnet address.

The last range of addresses is the broadcast subnet. The broadcast address for the last subnet in the broadcast subnet is the same as the classful broadcast address.

 

 

Figure 7 Class A addressing Guide

 

Figure 8 Class B addressing guide

 

 

Figure 9 Class C addressing guide

Featured Post

Day 41 — BGP Confederations: Sub-AS Design, External View and Migration

1. Opening Confederations are another way to scale BGP inside a large administrative domain. They divide the domain into member autonomous systems while presenting a single confederation identifier to external peers. They are powerful, but their operational model is more complex than simply 'using private ASNs inside.' The engineering goal is not to memorize another BGP command. It is to understand what information each speaker is allowed to propagate, what path information can be hidden, and what failure domain is created by the chosen control-plane architecture . 2. Concept and standards behavior RFC 5065 defines AS_CONFED_SEQUENCE and AS_CONFED_SET and how member-AS relationships are represented. Confederation external sessions have eBGP-like properties inside the confederation, while the confederation is presented externally as one AS. Modern guidance must also account for the fact that RFC 9774 prohibits new origination of AS_SET/AS_CONFED_SET in ordinary aggregation c...