7.41 BGP Conditional Advertisement
• Configure R3 in such a way that AS 300 uses AS 100 to get to all prefixes learned from AS 254.
• If the link between R1 and R3 goes down traffic from AS 300 to AS 254 should be rerouted directly to AS 200.
---------------------
僅僅設定在R3上
當R1與R3介面正常時,R3並不會將AS254的prefixs放給SW1
當R1與R3介面故障時,R3會將AS254的prefixs放給SW1
The syntax for conditional advertisement is as follows:
neighbor <IP> advertise-map MAP1 {non-exist|exist-map} MAP2
The configuration involves defining two route-maps.
One route-map (MAP1) selects the prefixes to be advertised to the peer. These prefixes must already exist in the local BGP table.
The other route-map (MAP2) selects the prefixes to be tracked in the local BGP table.
If this is a “non-exist” map, than condition is triggered when no prefixes in the BGP table match the route-map.
If this is an “exist” map, then condition is triggered when there is a prefix in the BGP table matching the route-map.
---------------------
R3:
ip as-path access-list 1 permit 254$
!
ip prefix-list LINK_R1_R3 permit 155.1.13.0/24
!
route-map ADVERTISE_MAP permit 10
match as-path 1
!
route-map NON_EXIST_MAP permit 10
match ip address prefix-list LINK_R1_R3
!
router bgp 200
network 155.1.13.0 mask 255.255.255.0
neighbor 155.1.37.7 advertise-map ADVERTISE_MAP non-exist-map NON_EXIST_MAP
---------------------
Rack1R3#show ip bgp 155.1.13.0
BGP routing table entry for 155.1.13.0/24, version 93
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
1 2 3 4
Local
0.0.0.0 from 0.0.0.0 (150.1.3.3)
Origin IGP, metric 0, localpref 100, weight 32768, valid, sourced, local, best
Rack1R3#
Rack1R3#show ip bgp neighbors 155.1.37.7 advertised-routes
BGP table version is 107, local router ID is 150.1.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 28.119.16.0/24 155.1.13.1 0 100 54 i
*> 28.119.17.0/24 155.1.13.1 0 100 54 i
*> 112.0.0.0 155.1.13.1 0 100 54 50 60 i
*> 113.0.0.0 155.1.13.1 0 100 54 50 60 i
*> 114.0.0.0 155.1.13.1 0 100 54 i
*> 115.0.0.0 155.1.13.1 0 100 54 i
*> 116.0.0.0 155.1.13.1 0 100 54 i
*> 117.0.0.0 155.1.13.1 0 100 54 i
*> 118.0.0.0 155.1.13.1 0 100 54 i
*> 119.0.0.0 155.1.13.1 0 100 54 i
*> 155.1.0.0 155.1.13.1 0 100 i
*> 155.1.13.0/24 0.0.0.0 0 32768 i
Total number of prefixes 12
Rack1R3#
Rack1R3#show ip bgp neighbors 155.1.37.7
BGP neighbor is 155.1.37.7, remote AS 300, external link
BGP version 4, remote router ID 150.1.7.7
BGP state = Established, up for 00:53:34
Last read 00:00:53, last write 00:00:33, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(old & new)
Address family IPv4 Unicast: advertised and received
Message statistics:
InQ depth is 0
OutQ depth is 0
Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 26 24
Keepalives: 56 49
Route Refresh: 4 0
Total: 87 74
Default minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 107, neighbor version 107/0
Output queue size: 0
Index 4, Offset 0, Mask 0x10
4 update-group member
Condition-map NON_EXIST_MAP, Advertise-map ADVERTISE_MAP, status: Withdraw
Rack1SW1#show ip bgp
BGP table version is 20, local router ID is 150.1.7.7
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 28.119.16.0/24 155.1.67.6 0 100 54 i
*> 28.119.17.0/24 155.1.67.6 0 100 54 i
*> 112.0.0.0 155.1.67.6 0 100 54 50 60 i
*> 113.0.0.0 155.1.67.6 0 100 54 50 60 i
*> 114.0.0.0 155.1.67.6 0 100 54 i
*> 115.0.0.0 155.1.67.6 0 100 54 i
*> 116.0.0.0 155.1.67.6 0 100 54 i
*> 117.0.0.0 155.1.67.6 0 100 54 i
*> 118.0.0.0 155.1.67.6 0 100 54 i
*> 119.0.0.0 155.1.67.6 0 100 54 i
*> 155.1.0.0 155.1.67.6 0 0 100 i
*> 205.90.31.0 155.1.67.6 0 100 200 254 ?
*> 220.20.3.0 155.1.67.6 0 100 200 254 ?
*> 222.22.2.0 155.1.67.6 0 100 200 254 ?
Rack1SW1#
當R3 S1/2介面 shutdown
Rack1R3#show ip bgp neighbors 155.1.37.7
BGP neighbor is 155.1.37.7, remote AS 300, external link
BGP version 4, remote router ID 150.1.7.7
BGP state = Established, up for 00:57:05
Last read 00:00:08, last write 00:00:05, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(old & new)
Address family IPv4 Unicast: advertised and received
Message statistics:
InQ depth is 0
OutQ depth is 0
Sent Rcvd
Opens: 1 1
Notifications: 0 0
Updates: 31 25
Keepalives: 60 53
Route Refresh: 4 0
Total: 96 79
Default minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 121, neighbor version 120/0
Output queue size: 0
Index 4, Offset 0, Mask 0x10
4 update-group member
Condition-map NON_EXIST_MAP, Advertise-map ADVERTISE_MAP, status: Advertise
Rack1R3#show ip bgp neighbors 155.1.37.7 advertised-routes
BGP table version is 126, local router ID is 150.1.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i28.119.16.0/24 155.1.45.4 0 100 0 100 54 i
*>i28.119.17.0/24 155.1.45.4 0 100 0 100 54 i
*>i112.0.0.0 155.1.45.4 0 100 0 100 54 50 60 i
*>i113.0.0.0 155.1.45.4 0 100 0 100 54 50 60 i
*>i114.0.0.0 155.1.45.4 0 100 0 100 54 i
*>i115.0.0.0 155.1.45.4 0 100 0 100 54 i
*>i116.0.0.0 155.1.45.4 0 100 0 100 54 i
*>i117.0.0.0 155.1.45.4 0 100 0 100 54 i
*>i118.0.0.0 155.1.45.4 0 100 0 100 54 i
*>i119.0.0.0 155.1.45.4 0 100 0 100 54 i
*>i155.1.0.0 155.1.45.4 0 100 0 100 i
*>i205.90.31.0 192.10.1.254 0 100 0 254 ?
*>i220.20.3.0 192.10.1.254 0 100 0 254 ?
*>i222.22.2.0 192.10.1.254 0 100 0 254 ?
Total number of prefixes 14
Rack1R3#
Rack1SW1#show ip bgp
BGP table version is 35, local router ID is 150.1.7.7
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* 28.119.16.0/24 155.1.37.3 0 200 100 54 i
*> 155.1.67.6 0 100 54 i
* 28.119.17.0/24 155.1.37.3 0 200 100 54 i
*> 155.1.67.6 0 100 54 i
* 112.0.0.0 155.1.37.3 0 200 100 54 50 60 i
*> 155.1.67.6 0 100 54 50 60 i
* 113.0.0.0 155.1.37.3 0 200 100 54 50 60 i
*> 155.1.67.6 0 100 54 50 60 i
* 114.0.0.0 155.1.37.3 0 200 100 54 i
*> 155.1.67.6 0 100 54 i
* 115.0.0.0 155.1.37.3 0 200 100 54 i
*> 155.1.67.6 0 100 54 i
* 116.0.0.0 155.1.37.3 0 200 100 54 i
*> 155.1.67.6 0 100 54 i
* 117.0.0.0 155.1.37.3 0 200 100 54 i
*> 155.1.67.6 0 100 54 i
* 118.0.0.0 155.1.37.3 0 200 100 54 i
*> 155.1.67.6 0 100 54 i
* 119.0.0.0 155.1.37.3 0 200 100 54 i
*> 155.1.67.6 0 100 54 i
* 155.1.0.0 155.1.37.3 0 200 100 i
*> 155.1.67.6 0 0 100 i
*> 205.90.31.0 155.1.37.3 0 200 254 ?
* 155.1.67.6 0 100 200 254 ?
*> 220.20.3.0 155.1.37.3 0 200 254 ?
* 155.1.67.6 0 100 200 254 ?
*> 222.22.2.0 155.1.37.3 0 200 254 ?
* 155.1.67.6 0 100 200 254 ?
Rack1SW1#
沒有留言:
張貼留言