show ip route: legend omits OSPF/BGP, the default gateway is labelled static, and the administrative distance is invisible #1234
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1234
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
show ip routelabels every row from a two-code legend, but the table it prints can carry four codes,and the one row that most often explains a lab's behaviour — the default gateway — is mislabelled.
Three problems, all in what the command says rather than in what the engine does:
routesTable()emitsO(OSPF) andB(BGP) rows as well asCandS,so an OSPF-learned route prints as a code the legend never defines.
S(static). It is not a static route:routeTo()treats it as aseparate source with administrative distance 254, while a static route has distance 1. On a device
with both —
ip default-gateway 10.1.2.254andip route 0.0.0.0 0.0.0.0 10.1.2.1— the tableprints two identical-looking
S 0.0.0.0/0rows and gives no clue which one wins. (The static onedoes; the operator cannot see that.)
installed route (
routeTo()compares longest prefix first, then lowest AD). Two rows for the sameprefix therefore have no visible tie-break.
Connected rows also print
via -, which reads as "no next hop" rather than "directly connected".Steps to reproduce
on a host with
ip default-gateway 10.1.2.254, and on a router with both a default gateway and astatic default route. The second case shows two
S 0.0.0.0/0rows with nothing to distinguish them.Expected
The output convention every operator already knows:
S*) and reported in aGateway of last resortline, so it cannot be confused with a configured static route;[distance/metric], which is the information the engine actually uses;is directly connected, <iface>.Scope
Formatting and labelling of
show ip routeonly.routesTable()already returns everything needed(
code,type,ad); no routing behaviour changes.show ip route: a legend that covers the table, and a default you can tell apart (#1234) #1236show ip route(#1301) #1302