fix(routes): give the IPv6 default route ::/0
driver / standard (pull_request) Successful in 17s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m10s
driver / test (3.12) (pull_request) Successful in 1m8s
driver / lowest (pull_request) Successful in 37s
driver / test (3.13) (pull_request) Successful in 1m14s
driver / build (pull_request) Successful in 38s
driver / security (pull_request) Successful in 1m20s
CI / driver (pull_request) Successful in 2m59s
driver / publish (pull_request) Skipped

get_route_to read "ip -4 route show && ip -6 route show" as one output
and mapped "default" to 0.0.0.0/0; the "default6" branch meant for IPv6
never matches, because ip -6 also prints "default". A dual-stack host
showed two 0.0.0.0/0 routes, one of them family ipv6. Each family is now
read with its own command, so "default" becomes ::/0 for IPv6 and a host
route without a prefix length a /128 there instead of a /32.

The line parse moves to napalm_linux/_routes.py.

Closes #6
This commit is contained in:
Christian Manivong committed 2026-11-01 21:50:33 +01:00
1 parent 69f1701ea6
commit 897892b923
5 files changed
+108 -41

No files matched your search

+4
View File
@@ -71,6 +71,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`seq=` replies and replies from a name (`bytes from host (address)`) now appear in
`results`, BusyBox's `round-trip` line fills the RTT fields, and an iputils summary
that counts errors is read as well.
- `get_route_to()` reports a dual-stack host's IPv6 default route as `::/0` (#6). It
came back as a second `0.0.0.0/0` with `family: ipv6`, because `ip -6 route show`
calls its default route `default` as well. An IPv6 host route is now a `/128`
instead of a `/32`.
## [0.15.1] - 2026-10-23