< Free Open Study > |
3-2 bgp bestpath as- path ignoreSyntax 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:
The shortest AS-path normally is used to select the best path if there are multiple routes to the same destination. This command allows the router to ignore AS-path information when making a best path determination. Cisco IOS Software Release: 12.0 Configuration Example: Ignoring the AS-Path Attribute When Making a Best Path SelectionIn Figure 3-2, Router B is learning about network 193.16.1.0/24 from Routers A and C. ASs 4 and 5 are simulated using loopbacks, a static route, and a route map. The simulated autonomous systems are used to create a longer AS-path attribute for the route being advertised by Router A. Figure 3-2. The AS-Path Attribute Is Normally Used to Make a Best Path Determination
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 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 setas permit 10 set as-path prepend 5 4 ___________________________________________________________________________ Router B interface 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 neighbor 10.1.1.1 remote-as 2 neighbor 10.1.1.1 route-map setas out no auto-summary ! 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 an AS-path of 1 5 4, and Router C is advertising network 193.16.1.0/24 with an AS-path of 3 4. Router B selects the path for 193.16.1.0/24 from Router C as the best path because the AS-path is shorter than the AS-path from Router A. rtrB# show ip bgp BGP table version is 2, 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 172.17.1.2 0 0 1 5 4 ? *> 10.1.1.2 0 0 3 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 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/0] via 10.1.1.2, 00:19:15 Modify the BGP configuration on Router B so that the AS-path is not used to make the best path selection. Router B router bgp 2 bgp bestpath as-path ignore neighbor 10.1.1.2 remote-as 3 neighbor 172.17.1.2 remote-as 1 VerificationRouter 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. Because the AS-path attribute is being ignored, the best path should be toward Router A due to its lower router ID value. The router ID values can be found using the show ip bgp command on Routers A and C: rtrA# show ip bgp BGP table version is 5, local router ID is 5.5.5.5 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 172.17.1.1 0 2 3 4 ? *> 0.0.0.0 0 32768 ? _____________________________________________________________________________________ rtrC# show ip bgp BGP table version is 3, local router ID is 6.6.6.6 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 0.0.0.0 0 32768 ? Verify that the best path to 193.16.1.0/24 has changed to the route advertised by Router A: rtrB# show ip bgp BGP table version is 2, 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 172.17.1.2 0 0 1 5 4 ? * 10.1.1.2 0 0 3 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 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/0] via 172.17.1.2, 00:08:48 Troubleshooting
|
< Free Open Study > |