Page MenuHomeVyOS Platform

policy-route: add suppress-prefix-length support for PBR ip rules
In progress, NormalPublicENHANCEMENT

Description

Add support for route suppression in policy routing by introducing
set suppress-prefix-length for policy route and policy route6 rules.

This maps to Linux ip rule suppress_prefixlength, allowing operators to
reuse main-table routes while suppressing prefixes up to a configured length.

What changed:

  • Added new CLI leaf:
    • set suppress-prefix-length <0-128>
    • wired into policy route common rule schema
  • Extended policy route apply logic to append:
    • suppress_prefixlength <N> to generated ip rule add ... commands
  • Added validation:
    • suppress-prefix-length requires set table or set vrf
    • range constrained by address family:
      • IPv4: 0..32
      • IPv6: 0..128
    • prevent conflicting suppress values for the same resolved table id
  • Added smoketests:
    • positive test for IPv4/IPv6 suppress_prefixlength rule presence
    • negative test ensuring commit fails on conflicting values for same table

Files:

  • interface-definitions/include/policy/route-common.xml.i
  • interface-definitions/include/policy/route-set-suppress-prefix-length.xml.i
  • src/conf_mode/policy_route.py
  • smoketest/scripts/cli/test_policy_route.py

Details

Version
-
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)