< Free Open Study > |
Syntax Description: This command has no arguments. Purpose: If multiple BGP routes to the same destination exist, BGP selects the best path based on the route attributes in the following order:
By default, Cisco IOS Software sets the MED value to 0 for a prefix that does not have the MED value set. If all other attributes are equal, the route with a MED of 0 is considered the best. Using this command causes the router to consider prefixes with a missing MED to have a MED of infinity. Cisco IOS Software Release: 12.0 Configuration Example: Comparing MEDs from Different Autonomous SystemsIn Figure 3-4, Router B is learning about network 150.150.150.0/24 from Routers A and C. Router C is using a MED of 20, and Router A is not setting the MED value. By default, BGP sets the missing MED value to 0. Because Routers A and C are in different autonomous systems, the MED values for 150.150.150.0/24 are not compared. For this example, we will force Router B to compare the MED values using the command bgp always-compare-med. Figure 3-4. By Default, BGP Sets a Missing MED Value to 0
Router A router bgp 1 network 150.150.150.0 mask 255.255.255.0 neighbor 172.17.1.1 remote-as 2 ! ip route 150.150.150.0 255.255.255.0 serial0 ___________________________________________________________________________ Router B router bgp 2 bgp always-compare-med neighbor 172.17.1.2 remote-as 1 neighbor 10.1.1.2 remote-as 3 Router C router bgp 3 neighbor 10.1.1.1 route-map setmed out network 150.150.150.0 mask 255.255.255.0 neighbor 10.1.1.1 remote-as 2 neighbor 10.1.1.1 route-map setmed out ! ip route 150.150.150.0 255.255.255.0 serial1 ! route-map setmed permit 10 set metric 20 Router B is receiving an advertisement for network 150.150.150.0/24 from Routers A and C: rtrB# show ip bgp BGP table version is 3, local router ID is 172.16.2.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 150.150.150.0/24 172.17.1.2 0 0 1 i * 10.1.1.2 20 0 3 I The best-path algorithm has selected the route from Router A as the best because we are comparing MEDs. Router A does not send a MED value for network 150.150.150.0/24. By default, BGP sets the MED value for prefixes from Router A to 0. Now modify the BGP configuration on Router B so that the missing MEDs are treated as infinity: Router B router bgp 2 bgp bestpath med missing-as-worst VerificationVerify that the best-path algorithm has selected the route from Router C as the best due to a lower MED value: rtrB# show ip bgp BGP table version is 3, local router ID is 172.16.2.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path * 150.150.150.0/24 172.17.1.2 0 0 1 i *> 10.1.1.2 20 0 3 i Troubleshooting
|
< Free Open Study > |