Skip to content

Static route on a VPC VR should win over a BGP route for the same prefix #14941

Backlog

Description

@MitchDrage

The required feature described as a wish

When a VPC router already has a BGP route for a prefix, a static route for the same prefix isn't programmed, because CsStaticRoutes.py only adds a route when ip route show | grep '^' finds nothing for that prefix.
If the static is there first, it stays and BGP never replaces it. So whichever route arrives first wins, and after a router restart the result can flip.

I'd like the static to always win on the same prefix - this is the way most routing platforms operate.
Operator BGP peers only accept a default route, so this comes up with tenant BGP on private gateways (#14687). There, keeping the static routes in place while BGP comes up is the planned migration path.

The change is one line: the check ignores routes with proto bgp, so the static is added at metric 0. zebra treats it as a kernel route (distance 0) and withdraws its own route.
I tested this with FRR 8.4.4. The static held through session resets, peer withdraw and re-advertise, and a zebra restart. Removing the static brought the BGP route back straight away.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions