< Free Open Study > |
8-12 neighbor { ip-address peer- group - name } filter-list as- path -list-number weight weightSyntax Description:
Purpose: Routes learned from BGP neighbors have the weight attribute set to 0. This form of the filter-list command allows you to set the weight attribute of selected routes received from a particular neighbor. This command applies only to incoming route updates. The operation of the filter list is identical for both IBGP and EBGP neighbors. Cisco IOS Software Release: 10.0. Peer group support was added in Release 11.0, and the weight keyword was removed in Release 12.1. Configuration Example: Set the Weight of Routes Originating from a Particular ASIn Figure 8-13, Routers B and C are advertising four network prefixes. Router A inspects the route update coming from Router B and sets the weight of networks originating from AS 3 to 850. The last AS listed in the AS path list is the originating AS. Loopbacks are used on Routers B and C to simulate the advertised networks, as shown in the configuration. Figure 8-13. Scenario for the Use of the neighbor filter-list weight Command
Router A interface Serial0 ip address 10.1.1.1 255.255.255.252 ! router bgp 1 neighbor 10.1.1.2 remote-as 2 ___________________________________________________________________________ Router B ip subnet-zero ! interface Loopback0 ip address 172.16.0.1 255.255.255.0 ! interface Loopback1 ip address 172.16.1.1 255.255.255.0 ! interface Loopback2 ip address 172.16.2.1 255.255.255.0 ! interface Loopback3 ip address 172.16.3.1 255.255.255.0 ! interface Serial0 ip address 10.1.1.2 255.255.255.252 clockrate 64000 ! router bgp 2 network 172.16.0.0 mask 255.255.255.0 network 172.16.1.0 mask 255.255.255.0 network 172.16.2.0 mask 255.255.255.0 network 172.16.3.0 mask 255.255.255.0 neighbor 10.1.1.1 remote-as 1 neighbor 10.1.2.2 remote-as 3 ___________________________________________________________________________ Router C ip subnet-zero ! interface Loopback0 ip address 198.16.0.1 255.255.255.0 ! interface Loopback1 ip address 198.16.1.1 255.255.255.0 ! interface Loopback2 ip address 198.16.2.1 255.255.255.0 ! interface Loopback3 ip address 198.16.3.1 255.255.255.0 ! interface Serial0 ip address 10.1.2.2 255.255.255.252 ! router bgp 3 network 198.16.0.0 network 198.16.1.0 network 198.16.2.0 network 198.16.3.0 neighbor 10.1.2.1 remote-as 2 Before proceeding to the filter list weight example, verify that BGP is propagating the routes: rtrA# show ip bgp BGP table version is 22, 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 *> 172.16.0.0/24 10.1.1.2 0 0 2 i *> 172.16.1.0/24 10.1.1.2 0 0 2 i *> 172.16.2.0/24 10.1.1.2 0 0 2 i *> 172.16.3.0/24 10.1.1.2 0 0 2 i *> 198.16.0.0 10.1.1.2 0 2 3 i *> 198.16.1.0 10.1.1.2 0 2 3 i *> 198.16.2.0 10.1.1.2 0 2 3 i *> 198.16.3.0 10.1.1.2 0 2 3 i ___________________________________________________________________________ rtrB# show ip bgp BGP table version is 9, local router ID is 172.16.3.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 *> 172.16.0.0/24 0.0.0.0 0 32768 i *> 172.16.1.0/24 0.0.0.0 0 32768 i *> 172.16.2.0/24 0.0.0.0 0 32768 i *> 172.16.3.0/24 0.0.0.0 0 32768 i *> 198.16.0.0 10.1.2.2 0 0 3 i *> 198.16.1.0 10.1.2.2 0 0 3 i *> 198.16.2.0 10.1.2.2 0 0 3 i *> 198.16.3.0 10.1.2.2 0 0 3 i ___________________________________________________________________________ rtrC# show ip bgp BGP table version is 18, local router ID is 198.16.3.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 *> 172.16.0.0/24 10.1.2.1 0 0 2 i *> 172.16.1.0/24 10.1.2.1 0 0 2 i *> 172.16.2.0/24 10.1.2.1 0 0 2 i *> 172.16.3.0/24 10.1.2.1 0 0 2 i *> 198.16.0.0 0.0.0.0 0 32768 i *> 198.16.1.0 0.0.0.0 0 32768 i *> 198.16.2.0 0.0.0.0 0 32768 i *> 198.16.3.0 0.0.0.0 0 32768 i Notice the AS path information contained in the BGP tables of the three routers. Before a router sends an update to another router in a different AS, the advertising router prepends its AS number to the update. This information is used to inspect the updates. For this example, we want to inspect the route update that Router B is sending to Router A and set the weight of routes that originate in AS 3 to 850. We can identify the routes originating in AS 3 by looking at the last AS number in the AS path information. If the last AS number is 3, these routes originated in AS 3. We don't care how many AS numbers are listed in the path, as long as the last AS number is 3. In order to set the weight of routes based on AS path information, we need to use an AS path filter in conjunction with the BGP filter-list command. An AS path filter utilizes regular expressions to match patterns in the AS path list. Refer to Appendix B for a discussion of regular expressions. The regular expression used to match any prefix originating from AS 3 is _ 3$. Two of the characters an underscore matches are a space and the beginning-of-string character. There is always a space between the AS numbers listed in an AS path. The 3$ must match a 3 and then the end-of-string character. So, the regular expression _ 3$ matches any path originating from AS 3, regardless of the length of the AS path. Now modify the BGP configuration on Router A to set the weight of routes originating in AS 3 to 850: Router A router bgp 1 neighbor 10.1.1.2 remote-as 2 neighbor 10.1.1.2 filter-list 1 weight 850 ! ip as-path access-list 1 permit _3$ The filter list always references an IP AS path access list. For this example, the AS path access list number is 1. The first statement in access list 1 matches any routes originating in AS 3 and allows their weights to be set to 850. VerificationVerify that the routes originating in AS 3 have a weight of 850 on Router A: rtrA# show ip bgp BGP table version is 9, 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 *> 172.16.0.0/24 10.1.1.2 0 0 2 i *> 172.16.1.0/24 10.1.1.2 0 0 2 i *> 172.16.2.0/24 10.1.1.2 0 0 2 i *> 172.16.3.0/24 10.1.1.2 0 0 2 i *> 198.16.0.0 10.1.1.2 850 2 3 i *> 198.16.1.0 10.1.1.2 850 2 3 i *> 198.16.2.0 10.1.1.2 850 2 3 i *> 198.16.3.0 10.1.1.2 850 2 3 I Troubleshooting
|
< Free Open Study > |