BGP Path Attributes - Multi-Exit Discriminator (MED)

ccnp-routing
How the Multi-Exit Discriminator attribute lets a dual-homed enterprise tell its ISP which inbound link to prefer, with route map configuration.
Published

Jan 21, 2018

Our scenario Currently R4 and R5 both choose R2 to reach network 12.12.12.0/24.
R5#show ip bgp 12.12.12.0/24 longer-prefixes
BGP table version is 26, local router ID is 5.5.5.5

     Network          Next Hop            Metric LocPrf Weight Path
 * i 12.12.12.0/24    4.4.4.4                  0    100      0 64500 i
 *>                   2.2.2.2                  0             0 64500 i

Now we want ISP1 to send us traffic over the upper link, meaning that R5 also has to send the traffic to R4. But we do not manage ISP routers. We want to configure R2 which we have access to.

image
R2(config)#ip prefix-list PrefixMED seq 10 permit 12.12.12.0/24
R2(config)#ip prefix-list NET13 permit 13.13.13.0/24
R2(config)#route-map RmMED10 permit 10  
R2(config-route-map)#match ip address prefix-list PrefixMED
R2(config-route-map)#set metric 10
R2(config-route-map)#exit
R2(config)#route-map RmMED20 permit 10                         
R2(config-route-map)#match ip address prefix-list PrefixMED
R2(config-route-map)#set metric 20
R2(config-route-map)#exit
R2(config)#route-map RmMED20 permit 20       
R2(config-route-map)#match ip address prefix-list NET13 
R2(config-route-map)#exit 
R2(config)#ip prefix-list NET13 permit 13.13.13.0/24
R2(config)#route-map RmMED10 permit 20           
R2(config-route-map)#match ip address prefix-list NET13
R2(config)#router bgp 64500
R2(config-router)#neighbor 4.4.4.4 route-map RmMED10 out
R2(config-router)#neighbor 5.5.5.5 route-map RmMED20 out
R2(config-router)#end
R2#clear ip bgp 4.4.4.4 soft
R2#clear ip bgp 5.5.5.5 soft
R5#show ip bgp 12.12.12.0/24 longer-prefixes
BGP table version is 31, local router ID is 5.5.5.5

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 12.12.12.0/24    4.4.4.4                 10    100      0 64500 i
 *                    2.2.2.2                 20             0 64500 i
Back to top