Hello,
I have an inbound route-map applied that adds the peer’s round trip time to the metric value when routes are imported:
set policy route-map gen-in rule 50 set metric '+rtt'
Applied like so:
set protocols bgp peer-group PEER-GROUP address-family ipv4-unicast route-map import 'gen-in'
And this works great! However, I would like to re-advertise the metric to my peers. I tried doing the same, but with an outbound route-map:
set policy route-map gen-out rule 10 set metric '+rtt'
set protocols bgp peer-group PEER-GROUP address-family ipv4-unicast route-map export 'gen-out'
However, the metric set on advertised routes is 0. I think on a level this makes sense, as it is local RTT is basically nothing.
However, I would like to re-advertise the metric as added when routes are imported. Why, you may ask? I’m toying around with abusing MED to determine which path may be the lowest latency.
Example fictitious logical eBGP topology:
From a logical standpoint, the “shortest” path between Node B and Node D is the direct path, but the “fastest” path is actually B <> E <> D.
When Node E receives Node B’s prefixes, it imports them with a metric of 20. When Node E re-advertises Node B’s prefixes to Node D, it passes along a metric of 20, and when Node D imports them it adds 15 to the metric for an installed metric of 35.
Of course, for this to work, we need to enable set protocols bgp parameters always-compare-med.
Is it possible to re-advertise metric manipulated upon import?
