根据条件通告BGP路由 Conditionally Advertising BGP Routes

来源:本站原创 CISCO 超过1,938 views围观 0条评论

 

通过设定条件达到通告路由的方法

SUMMARY STEPS

1. enable
2. configure terminal
3. router bgp autonomous-system-number
4. neighbor {ip-address | peer-group-name} remote-as autonomous-system-number
5. neighbor ip-address advertise-map map-name {exist-map map-name | non-exist-map map-name}
6. exit
7. route-map map-tag [permit | deny] [sequence-number]
8. match ip address {access-list-number [access-list-number… | access-list-name…] | access-list-name [access-list-number… | access-list-name] | prefix-list prefix-list-name [prefix-list-name…]}
9. Repeat Steps 7 and 8 for every prefix to be tracked.
10. exit
11. access-list access-list-number {deny | permit} source [source-wildcard] [log]
12. Repeat Step 11 for every access list to be created.
13. exit

EX: RA 产生一条Default-route RB 如果BGP table 中有10.10.11.0/30这个路由的话,就通告Default-route 给EBGP R3

A:

nei 10.10.2.2 default-orginate //让RA产生一条默认路由

B:

ip prefix-list 11 per 10.10.11.0/30 //。。。

route-map R11

match ip add prefix-list 11 //…

ip prefix-list DEF-R per 0.0.0.0/0 //…

route-map DEF-R

match ip add pre DEF-R

下面是应用的方法

1) nei 10.10.3.3 advertise-map DEF-R exist-map R11 //如果R11路由存在的话就通告DEF-R这条路由

2) nei 10.10.3.3 advertise-map DEF-R non-exist-map R11 //如果R11的路由不存在的话,就通告DEF-R这条路由

DETAILED STEPS Command or Action Purpose

Step 1
enable

Example:

Router> enable
Enables privileged EXEC mode.
•Enter your password if prompted.
Step 2
configure terminal

Example:

Router# configure terminal
Enters global configuration mode.
Step 3
router bgp autonomous-system-number

Example:

Router(config)# router bgp 45000
Enters router configuration mode for the specified routing process.
Step 4
neighbor {ip-address | peer-group-name} remote-as autonomous-system-number

Example:

Router(config-router)# neighbor 192.168.1.2 remote-as 40000
Adds the IP address of the neighbor in the specified autonomous system to the IPv4 multiprotocol BGP neighbor table of the local router.
Step 5
neighbor ip-address advertise-map map-name {exist-map map-name | non-exist-map map-name}

Example:

Router(config-router)# neighbor 192.168.1.2 advertise-map map1 exist-map map2
Adds the IP address of the neighbor in the specified autonomous system to the IPv4 multiprotocol BGP neighbor table of the local router.
Step 6
exit

Example:

Router(config-router)# exit
Exits router configuration mode and enters global configuration mode.
Step 7
route-map map-tag [permit | deny] [sequence-number]

Example:

Router(config)# route-map map1 permit 10
Configures a route map and enters route map configuration mode.
•In this example, a route map named map1 is created.
Step 8
match ip address {access-list-number [access-list-number… | access-list-name…] | access-list-name [access-list-number…|access-list-name] | prefix-list prefix-list-name [prefix-list-name…]}

Example:

Router(config-route-map)# match ip address 1
Configures the route map to match a prefix that is permitted by a standard access list, an extended access list, or a prefix list.
•In this example, the route map is configured to match a prefix permitted by access list 1.
Step 9
Repeat Steps 7and 8 for every prefix to be tracked.

Step 10
exit

Example:

Router(config-route-map)# exit
Exits route map configuration mode and enters global configuration mode.
Step 11
access-list access-list-number {deny | permit} source [source-wildcard] [log]

Example:

Router(config)# access-list 1 permit 172.17.0.0
Configures a standard access list.
•In this example, access list 1 permits advertising of the 172.17.0.0. prefix depending on other conditions set by the neighbor advertise-map command.
Step 12
Repeat Step 11 for every access list to be created.

Step 13
exit

Example:

Router(config)# exit
Exits global configuration mode and returns to privileged EXEC mode.
Step 14
exit

Example:

Router(config-router)# exit
Exits router configuration mode and enters global configuration mode.

引用http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124cg/hirp_c/ch05/brbbasic.htm#wp1083233

文章出自:CCIE那点事 http://www.jdccie.com/ 版权所有。本站文章除注明出处外,皆为作者原创文章,可自由引用,但请注明来源。 禁止全文转载。
本文链接:http://www.jdccie.com/?p=1680转载请注明转自CCIE那点事
如果喜欢:点此订阅本站