We are trying to figure out if there is a way to set “distance” for BGP learned routes (either for specific routes, or all routes learned from a peer).
Alternatively, I would be happy to see if there are other options to achieve the following:
Assume we have a router which is running 2 eBGP sessions which receive the same prefix from both peers (let’s say 192.0.2.0/24) - Each peer is associated with a different interface (let’s say eth0 and eth2).
We also have another interface, eth1, which would have a static route for 192.0.2.0 pointed at it.
We would like to set the preference for the route selection to look like:
eth0: priority 1
eth1: priority 2
eth2: priority 3
So within BGP, we could set local-pref to some priority-based value, which will resolve between the eth0 and eth2 paths, but then the selected route would have the default eBGP distance. This will now be compared with the static route’s distance pointing to eth1.
What I am trying to achieve is being able to control the distance of the BGP route when it is being compared with the static route.
Is this supported today?
Any other ideas on how this can be achieved?