< Free Open Study > |
8-1 neighbor { ip-address peer- group - name } advertise-map route-map-name1 non-exist-map route-map-name2Syntax Description:
Purpose: The primary prefix referenced by route-map-name2 is advertised to BGP peers if the prefix is in the BGP table. If the network is directly connected, the network or redistribute connected command can be used to place the primary network in the BGP table. If the primary prefix is learned via an IGP, the redistribute IGP command installs the prefix in the BGP table. The prefix may be learned from a BGP peer and is automatically placed in the BGP table. The primary prefix is advertised until it disappears from the BGP table. This can happen if the network goes down or if the advertisement for this network is no longer being received. When the route disappears, the prefix referenced by route-map-name1 is advertised. If the primary network reappears in the BGP table, it is again advertised, and the secondary prefix is suppressed. Cisco IOS Software Release: 12.0 Configuration Example: Advertise the Primary Route While Suppressing the Secondary RouteThe goal of this example is to illustrate the mechanics of the neighbor advertise-map command. In Figure 8-1, Router A advertises network 156.26.32.0/24 if the route is up. If network 156.26.32.0/24 goes down, network 144.223.8.0/24 is advertised. Figure 8-1. Illustration of the neighbor advertise-map Command
Router A interface loopback 0 description primary prefix ip address 156.26.32.1 255.255.255.0 ! interface loopback 1 description secondary prefix ip address 144.223.8.1 255.255.255.0 ! router bgp 1 network 156.26.32.0 mask 255.255.255.0 network 144.223.8.0 mask 255.255.255.0 neighbor 10.1.1.2 remote-as 1 neighbor 10.1.1.2 advertise-map secondary non-exist-map primary ! access-list 1 permit 156.26.1.0 0.0.0.255 access-list 2 permit 144.223.8.0 0.0.0.255 ! route-map primary permit 10 match ip address 1 ! route-map secondary permit 10 match ip address 2 ___________________________________________________________________________ Router B router bgp 1 neighbor 10.1.1.1 remote-as 1 ! Two loopbacks have been created on Router A to simulate the primary and secondary prefixes. Both prefixes must be in the BGP table. The two network commands on Router A install the prefixes in the BGP table. If both of the loopback interfaces are up, the primary and secondary prefixes are in the BGP table on Router A. The advertise-map command prevents the secondary prefix from being advertised to BGP peers as long as the primary prefix is in the BGP table. If the primary prefix disappears from the BGP table, the secondary prefix is advertised. VerificationVerify that the primary and secondary prefixes are in the BGP table on Router A: rtrA# show ip bgp BGP table version is 15, local router ID is 156.26.32.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 *> 144.223.8.0/24 0.0.0.0 0 32768 i *> 156.26.32.0/24 0.0.0.0 0 32768 i Verify that only the primary prefix is being advertised to Router B: rtrB# show ip bgp BGP table version is 23, local router ID is 10.1.1.2 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 * i156.26.32.0/24 10.1.1.1 0 100 0 i You can also view the effect of advertise-map by examining specific entries in the BGP table. rtrA# show ip bgp 144.223.8.0 BGP routing table entry for 144.223.8.0/24, version 29 Paths: (1 available, best #1) Not advertised to any peer Local 0.0.0.0 from 0.0.0.0 (156.26.32.1) Origin IGP, metric 0, localpref 100, weight 32768, valid, sourced, local,2 rtrA# show ip bgp 156.26.32.0 BGP routing table entry for 156.26.32.0/24, version 28 Paths: (1 available, best #1) Advertised to non peer-group peers: 10.1.1.2 Local 0.0.0.0 from 0.0.0.0 (156.26.32.1) Origin IGP, metric 0, localpref 100, weight 32768, valid, sourced, local,2 To demonstrate the operation of the advertise-map command, we need to make the primary prefix disappear from the BGP table on Router A by shutting down loopback interface 0 on Router A: int loopback 0 ip address 156.26.32.1 255.255.255.0 shutdown The primary route should disappear from the BGP table on Router A: rtrA# show ip bgp BGP table version is 16, local router ID is 156.26.32.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 *> 144.223.8.0/24 0.0.0.0 0 32768 i With the primary route gone, the secondary route should be advertised to Router B: rtrB# show ip bgp BGP table version is 23, local router ID is 10.1.1.2 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 * i144.223.8.0/24 10.1.1.1 0 100 0 i The specific entries for the primary and secondary prefixes show the effect of non-exist-map: rtrA# show ip bgp 144.223.8.0 BGP routing table entry for 144.223.8.0/24, version 31 Paths: (1 available, best #1) Advertised to non peer-group peers: 10.1.1.2 Local 0.0.0.0 from 0.0.0.0 (156.26.32.1) Origin IGP, metric 0, localpref 100, weight 32768, valid, sourced, local,2 rtrA# show ip bgp 156.26.32.0 % Network not in table Troubleshooting
|
< Free Open Study > |