Non-Optimal eBGP Routing
Last updated
Last updated
Topology: russo-bgp-iol
Load non-optimial.ebgp.init.cfg
The R3-R4 link has high delay, and the ISIS metric has been adjusted to 30 on this link on both sides.
R6 is choosing to route traffic destined for 192.0.2.1/32 and 2001:db8::1/128 via R4 due to its lower RID. Find an elegant way to influence R6 to use R5 as the ingress point instead of R4.
Before we make any changes, R6 is choosing the path via R4 due to its lower RID. R6 has no idea that the IGP topology of 65000 is such that R5 is actually a better ingress point.
The MED attribute is for just this use case. If R4 and R5 both signal R6 with their own internal IGP metric to the nexthop for each prefix, R6 can choose the lowest cost path into AS 65000. By default, a router does not set MED for eBGP or iBGP learned prefixes. On the contrary, the router strips the MED value of any eBGP or iBGP learned prefix when advertising to an eBGP neighbor. We can simply tell the router to set the MED to its own internal IGP metric to the nexthop using the following route-map:
R6 is now aware of each eBGP peer’s internal IGP metric for the prefix. Because both peers belong to the same AS, the router will by default use the MED in the bestpath decision process.
Note that this route-map can also be used when you want to propagate a MED for a prefix that was injected in the local AS but not injected on the local router. By default, the router will strip the MED on any prefixes advertised to an eBGP peer except for locally-injected prefixes.