A BGP session across an unplugged cable stays Established and keeps its routes #1269

Closed
opened 2026-11-09 20:32:25 +00:00 by jaylouisw · 0 comments
Owner

What happens

Two routers, eBGP over one cable. Session up, prefix learned. Now pull the cable:

r2# show ip bgp
Neighbor         V  AS      State           Reason
10.0.0.1         4  65001   Established     eBGP

1 of 1 neighbour(s) established
1 prefix(es) installed from BGP

r2# show ip route
B  10.0.0.0       /24  [20/0] via 10.0.0.1  Gi0

The cable is out. The session says Established, the prefix stays installed, and show ip route offers a B
route whose next hop cannot be reached — so the routing table claims a path that does not exist. Shutting the
far port produces the same thing.

_bgpReachable() asked iface.enabled — "did somebody shut this port" — and nothing else. Not whether the
cable is in, not whether the link is up, not whether the far port is up. That is the same question
show ip interface brief was answering wrongly before #1237, and the same rule (Device.ifaceStatus(iface, topo)) now exists for it.

Separately, show ip bgp printed a count of installed prefixes and no way to see which prefixes, off
which peer, with what path — the next question, and the one show ip route sends you here with.

Expected

  • a session requires a port that can carry a frame: a pulled cable, a down link, a shut far port and an
    admin-down port each end the session, with the reason naming the actual fault (cannot carry a frame (link down), (peer shut down), administratively down) rather than "down on the router";
  • the prefixes learned over a session that is no longer established are withdrawn: no B row survives a
    session that is down;
  • restoring the cable brings the session and the prefixes back;
  • show ip bgp lists the installed prefixes with next hop, MED, local preference, weight, AS path and origin,
    and marks the session type — and the prefix length printed there matches show ip route's, one mask rule;
  • with no prefixes installed, no prefix header is printed over nothing.

Scope

The existing BGP reachability check and the existing show ip bgp output. No new commands, no new config
surface.

## What happens Two routers, eBGP over one cable. Session up, prefix learned. Now **pull the cable**: ``` r2# show ip bgp Neighbor V AS State Reason 10.0.0.1 4 65001 Established eBGP 1 of 1 neighbour(s) established 1 prefix(es) installed from BGP r2# show ip route B 10.0.0.0 /24 [20/0] via 10.0.0.1 Gi0 ``` The cable is out. The session says Established, the prefix stays installed, and `show ip route` offers a `B` route whose next hop cannot be reached — so the routing table claims a path that does not exist. Shutting the far port produces the same thing. `_bgpReachable()` asked `iface.enabled` — "did somebody shut this port" — and nothing else. Not whether the cable is in, not whether the link is up, not whether the far port is up. That is the same question `show ip interface brief` was answering wrongly before #1237, and the same rule (`Device.ifaceStatus(iface, topo)`) now exists for it. Separately, `show ip bgp` printed a **count** of installed prefixes and no way to see which prefixes, off which peer, with what path — the next question, and the one `show ip route` sends you here with. ## Expected * a session requires a port that can **carry a frame**: a pulled cable, a down link, a shut far port and an admin-down port each end the session, with the reason naming the actual fault (`cannot carry a frame (link down)`, `(peer shut down)`, `administratively down`) rather than "down on the router"; * the prefixes learned over a session that is no longer established are **withdrawn**: no `B` row survives a session that is down; * restoring the cable brings the session and the prefixes back; * `show ip bgp` lists the installed prefixes with next hop, MED, local preference, weight, AS path and origin, and marks the session type — and the prefix length printed there matches `show ip route`'s, one mask rule; * with no prefixes installed, no prefix header is printed over nothing. ## Scope The existing BGP reachability check and the existing `show ip bgp` output. No new commands, no new config surface.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge#1269
No description provided.