< Free Open Study > |
3-1 bgp always-compare-medSyntax 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:
BGP normally does not compare MED values for routes from different autonomous systems. This command allows for the comparison of MED values for routes from different autonomous systems. Cisco IOS Software Release: 11.0 Configuration Example: Comparing MED Values from Different Autonomous SystemsIn Figure 3-1, Router B is learning about network 193.16.1.0/24 from Routers A and C. AS 4 is being simulated using loopbacks, a static route, and route maps. Figure 3-1. MEDs From Different Autonomous Systems Are Normally Not Compared
Router A interface Loopback0 ip address 5.5.5.5 255.255.255.255 ! interface FastEthernet0 ip address 172.17.1.2 255.255.255.0 ! router bgp 1 redistribute static route-map setmed neighbor 172.17.1.1 remote-as 2 neighbor 172.17.1.1 route-map setas out no auto-summary ! ip route 193.16.1.0 255.255.255.0 Loopback0 route-map setmed permit 10 set metric 200 route-map setmas permit 10 set as-path prepend 4 ___________________________________________________________________________ Router B interfacef Ethernet0/0 ip address 172.17.1.1 255.255.255.0 ! interface Serial2/0 ip address 10.1.1.1 255.255.255.252 clockrate 64000 ! router bgp 2 neighbor 10.1.1.2 remote-as 3 neighbor 172.17.1.2 remote-as 1 ___________________________________________________________________________ Router C interface Loopback1 ip address 6.6.6.6 255.255.255.255 ! interface Serial0 ip address 10.1.1.2 255.255.255.252 ! router bgp 3 redistribute static route-map setmed neighbor 10.1.1.1 remote-as 2 neighbor 10.1.1.1 route-map setas no auto-summary ! route-map setmed permit 10 set metric 100 route-map setas permit 10 set as-path prepend 4 ip route 193.16.1.0 255.255.255.0 Loopback1 Router A is advertising network 193.16.1.0/24 with a metric or MED of 200, and Router C is advertising network 193.16.1.0/24 with a metric or MED of 100. Because Routers A and C are in different autonomous systems, Router B does not use the MED value to determine the best path. From the best path selection criteria, we can see that Router B uses the router ID to determine the best path to 193.16.1.0/24. The BGP ID of a neighbor BGP router can be found by using the show ip bgp neighbors command. A router's own BGP ID can be found using the show ip bgp summary or show ip bgp commands. rtrA# show ip bgp summary BGP router identifier 5.5.5.5, local AS number 1 BGP table version is 3, main routing table version 3 1 network entries and 1 paths using 133 bytes of memory 1 BGP path attribute entries using 52 bytes of memory 0 BGP route-map cache entries using 0 bytes of memory 0 BGP filter-list cache entries using 0 bytes of memory BGP activity 2/3 prefixes, 5/4 paths Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 172.17.1.1 4 2 122 123 3 0 0 01:45:46 0 _____________________________________________________________________________________ rtrB# show ip bgp neighbors BGP neighbor is 10.1.1.2, remote AS 3, external link BGP version 4, remote router ID 6.6.6.6 BGP state = Established, up for 01:49:19 BGP neighbor is 172.17.1.2, remote AS 1, external link BGP version 4, remote router ID 5.5.5.5 BGP state = Established, up for 01:46:44 _____________________________________________________________________________________ rtrC# show ip bgp summary BGP router identifier 6.6.6.6, local AS number 3 BGP table version is 3, main routing table version 3 1 network entries and 2 paths using 153 bytes of memory 2 BGP path attribute entries using 192 bytes of memory BGP activity 1/0 prefixes, 3/1 paths Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.1.1.1 4 2 139 141 3 0 0 01:52:18 1 Router A has a lower router ID than Router C. If all other path selection criteria are equal, the route learned from Router A is used. Inspect the BGP table on Router B to ensure that 193.16.1.0/24 is being learned from both Routers A and C. rtrB# show ip bgp BGP table version is 3, local router ID is 172.17.1.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 * 193.16.1.0 10.1.1.2 100 0 3 4 ? *> 172.17.1.2 200 0 1 4 ? The route learned from Router A should be installed in the IP routing table even though this route has a higher MED than the route learned from Router C. rtrB# show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort not set 172.17.0.0/24 is subnetted, 1 subnets C 172.17.1.0 is directly connected, Ethernet0/0 172.16.0.0/24 is subnetted, 1 subnets 10.0.0.0/30 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Serial2/0 B 193.16.1.0/24 [20/200] via 172.17.1.2, 00:10:36 Modify the BGP configuration on Router B to allow the comparison of MED values from different autonomous systems. Router B router bgp 2 bgp always-compare-med neighbor 10.1.1.2 remote-as 3 neighbor 172.17.1.2 remote-as 1 VerificationVerify that the best path to 193.16.1.0/24 has changed to the route with the lowest MED. rtrB# show ip bgp BGP table version is 4, local router ID is 172.17.1.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 *> 193.16.1.0 10.1.1.2 100 0 3 4 ? * 172.17.1.2 200 0 1 4 ? rtrB# show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set 172.17.0.0/24 is subnetted, 1 subnets C 172.17.1.0 is directly connected, Ethernet0/0 172.16.0.0/24 is subnetted, 1 subnets S 172.16.4.0 is directly connected, Serial2/0 10.0.0.0/30 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Serial2/0 B 193.16.1.0/24 [20/100] via 10.1.1.2, 00:02:08 Troubleshooting
|
< Free Open Study > |