- 1、本文档共4页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
操纵BGP路径选择-local preference属性案例
操纵BGP路径选择---local preference属性案例(配图+详细验证过程)
本地优先级(local pref)属性是分配给路由的一种优先级度量,用于和到同一目的地的其他路由相比较。这是BGP路由处理中的第二优先属性(WEIGHT是第一优先属性)。Local Pref属性只在本AS内部有效,不会被传送到EBGP邻居上。本地优先级越高,路由优先级越高。
?
以上案例中,我们通过对R3的配置,设置从R1学到的1.0.0.0的本地优先级(Localpref)设置为200,由于缺省的值为100,AS200中所有的路由器都会选择R3到达1.0.0.0。
?
?
//// r1 ////
int f2/0
? ip ad 192.1.1.1 255.255.255.0
?
int f3/0
? ip ad 193.1.1.1 255.255.255.0
?
int lo0
? ip ad 1.1.1.1 255.255.255.0
?
int lo1
? ip ad 2.2.2.2 255.255.255.0
?
router bgp 100
? no syn
? neighbor 192.1.1.2 remote-as 200
? neighbor 193.1.1.3 remote-as 200
? network 1.0.0.0
? network 1.0.0.0
?
?
?
//// r2 ////
int f2/0
? ip ad 192.1.1.2 255.255.255.0
?
int f4/0
? ip ad 194.1.1.2 255.255.255.0
?
router os 1
? netw 0.0.0.0 255.255.255.255 a 0
? passive-interface f2/0
?
router bgp 200
? no syn
? neighbor 192.1.1.1 remote-as 100
? neighbor 194.1.1.4 remote-as 200
? neighbor 195.1.1.3 remote-as 200
? neighbor 194.1.1.4 next-hop-self
?
?
//// r3 ////
int f3/0
? ip ad 193.1.1.3 255.255.255.0
?
int f5/0
? ip ad 195.1.1.3 255.255.255.0
?
router os 1
? netw 0.0.0.0 255.255.255.255 a 0
? passive-interface f3/0
?
router bgp 200
? no syn
? neighbor 193.1.1.1 remote-as 100
? neighbor 195.1.1.4 remote-as 200
? neighbor 195.1.1.4 next-hop-self
? neighbor 194.1.1.2 remote-as 200
? neighbor 193.1.1.1 route-map localpref in
?
access-list 1 permit 1.0.0.0 0.255.255.255
?
route-map localpref permit 10
? match ip ad 1
? set local-pref 200
route-map localpref permit 20
? set local-pref 100
?
//// r4 ////
int f4/0
? ip ad 194.1.1.4 255.255.255.0
?
int f5/0
? ip ad 195.1.1.4 255.255.255.0
?
int lo0
? ip ad 4.4.4.4 255.255.255.0
?
router os 1
? netw 0.0.0.0 255.255.255.255 a 0
?
router bgp 200
? no syn
? neighbor 194.1.1.2 remote-as 200
? neighbor 195.1.1.3 remote-as 200
? netw 4.0.0.0
?
?
?
?
验证:
//// r4 ////
r4#sh ip bgp?? Network????????? Next Hop??????????? Metric LocPrf Weight Path*i1.0.0.0????????? 195.1.1.3??????????????? 0??? 200????? 0 100 i* i2.0.0.0????????? 195.1.1.3???????????????
文档评论(0)