Agent: report the FIB for reachability scoping #3
Reference in New Issue
Block a user
Delete Branch "benvin/agent-fib"
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?
Why
The control plane scopes which routers enforce a rule based on whether a router can actually route to both endpoints. That needs a reachability signal from each device; this has the agent report its FIB.
Changes
ip route show/ip -6 route show.Pairs with
The tomswallapi side (reachable_prefixes column, the /routes endpoint, and compiler scoping) is a separate PR on tomswallapi.
The agent now collects the device's reachable prefixes from the kernel FIB (including FRR-installed routes) via 'ip route show' / 'ip -6 route show' and reports them to the control plane (POST /devices/{name}/routes) alongside its status. tomswallapi uses these to scope which routers enforce a rule. Route parsing (default routes, ECMP nexthop lines, route-type keywords, host routes, v4/v6) is unit-tested; collection degrades to nil without iproute2.