Skip to content

FIB Route Filter HLD#2367

Open
kalash-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:fib-route-filter-hld
Open

FIB Route Filter HLD#2367
kalash-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:fib-route-filter-hld

Conversation

@kalash-nexthop

@kalash-nexthop kalash-nexthop commented Jun 5, 2026

Copy link
Copy Markdown

Adds a HLD for FIB_ROUTE_FILTER — a CONFIG_DB table that binds a route-map to a (vrf, addr_family, source-protocol) tuple, so operators can selectively prevent specific routes of a given protocol from being installed into the FIB. Backed by FRR's native ip|ipv6 protocol <P> route-map <RM> zebra route filtering.

The HLD covers:

  • YANG model and CONFIG_DB schema for FIB_ROUTE_FILTER
  • Boot-time render via a shared Jinja template, included from both zebra.conf.j2 (bgpcfgd) and frr.conf.j2 (frrcfgd)
  • Runtime apply via new FibRouteFilterMgr (bgpcfgd) and fib_route_filter_handler (frrcfgd, via mgmtd)

Related PR: sonic-net/sonic-buildimage#27192

Add a High-Level Design for the FIB_ROUTE_FILTER feature under
doc/route-filter/. Covers YANG schema, CONFIG_DB shape, the shared
Jinja boot-render template, runtime apply via bgpcfgd
(FibRouteFilterMgr) and frrcfgd (fib_route_filter_handler), FRR
zebra route-map evaluation, info flow diagrams, warmboot/fastboot
impact, restrictions, and the testing plan across yang_model_tests,
sonic-bgpcfgd, sonic-frr-mgmt-framework, sonic-config-engine, and
sonic-mgmt.

Signed-off-by: Kalash Nainwal <kalash@nexthop.ai>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

### 9.1 Apply Filter Flow

```
Operator CONFIG_DB runtime manager FRR (zebra)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

”runtime manager"? it is frrcfgd, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking @eddieruan-alibaba . The next line clarifies this:

The runtime manager is `bgpcfgd.FibRouteFilterMgr` when `bgpcfgd` owns FRR config translation, and `frrcfgd.fib_route_filter_handler` (routed through `mgmtd`) when `frrcfgd` is the active translator.

```
Operator CONFIG_DB runtime manager FRR (zebra)
│ │ │ │
│ sonic-db-cli HSET │ │ │

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not keep the same syntax as vtysh, since it is route-map anyway.

@kalash-nexthop kalash-nexthop Jun 8, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any strong reason to pick FIB_ROUTE_FILTER|<vrf>|<afi>|<protocol> → route_map=<RM>, other than that I didn't find following vtysh cmd very intuitive (i.e, the syntax makes it hard to tell this is filtering routes at zebra level and not at individual protocol level):

ip[v6] protocol PROTOCOL route-map ROUTEMAP

I thought FIB_ROUTE_FILTER here would be better than something like IP_PROTOCOL_FILTER in conveying that this feature is filtering routes from fib rather than say applying bgp route maps to filter routes from rib itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants