BGP选路原则详解讲课教案

上传人:新** 文档编号:568617494 上传时间:2024-07-25 格式:PPT 页数:113 大小:1.47MB
返回 下载 相关 举报
BGP选路原则详解讲课教案_第1页
第1页 / 共113页
BGP选路原则详解讲课教案_第2页
第2页 / 共113页
BGP选路原则详解讲课教案_第3页
第3页 / 共113页
BGP选路原则详解讲课教案_第4页
第4页 / 共113页
BGP选路原则详解讲课教案_第5页
第5页 / 共113页
点击查看更多>>
资源描述

《BGP选路原则详解讲课教案》由会员分享,可在线阅读,更多相关《BGP选路原则详解讲课教案(113页珍藏版)》请在金锄头文库上搜索。

1、BGP选路原则详解修订记录修订日期修订版本修订描述作者2009-09-27V1.0初稿完成。高志岩第一条:Weight属性l实验验证R2、R3分别通告10.0.0.0给R1R1将10.0.0.0使用network方式引入BGP10.0.0.0/810.0.0.0/810.0.0.0/8AS 1AS 2R3R1R2IBGPEBGP第一条:Weight属性l实验验证R1的BGP表r1#sh ip bgp BGP table version is 2, local router ID is 9.9.0.1Status codes: s suppressed, d damped, h history,

2、 * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* i10.0.0.0 9.9.13.3 0 100 0 i* 9.9.12.2 0 0 2 i* 0.0.0.0 0 32768 i第一条:Weight属性l实验验证R1对BGP Peer应用不同的Route-map修改所学习路由的Weight值10.0.0.0/810.0.0.0/810.0.0.0/8AS 1A

3、S 2R3R1R2IBGPEBGProuter bgp 1 -R1的路由策略的路由策略neighbor 9.9.12.2 route-map FROM_R2 inroute-map FROM_R2 permit 10 set weight 65535第一条:Weight属性l实验验证R1的BGP表选路结果r1#sh ip bgpBGP table version is 7, local router ID is 9.9.0.1Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-f

4、ailure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Pathr i10.0.0.0 9.9.13.3 0 100 0 ir 9.9.12.2 0 65535 2 ir 0.0.0.0 0 32768 iBGP路由选路原则路由选路原则1.Weight1.Weight属性属性2.Local Preference2.Local Preference属性属性3.3.本地路由始发方式本地路由始发方式4.AS-Path4.AS-Path长度长度5.Origin

5、5.Origin属性属性6.MED6.MED属性属性7.EBGP7.EBGP优于优于IBGPIBGP8.8.到达到达Next-hopNext-hop的代价的代价9.9.执行等价负载均衡执行等价负载均衡10.EBGP10.EBGP路由接收的顺序路由接收的顺序11.11.路由的路由的Router-IDRouter-ID12.Cluster-list12.Cluster-list长度长度13.13.配置的配置的BGP PeerBGP Peer指定地址指定地址第二条:Local Preference属性l比较原则及配置注意事项:值越大,越优先默认情况下,本地始发的路由的LP为100,从EBGP Pee

6、r接收的路由的LP为100.Local Preference属性只能在IBGP Peer之间传递,不能在EBGP Peer之间传递,如果在EBGP Peer之间收到的路由的路径属性中携带了Local Preference,则会触发Notifacation报文,造成会话中断第二条:Local Preference属性l比较原则及配置注意事项:Local Preference通过如下三种方法进行设置:通过将IGP路由引入BGP时关联Route-map进行设置针对IBGP Peer应用IN/OUT方向的Route-map,对从Peer接收到的或者通告给Peer的所有或部分路由进行设置针对EBGP P

7、eer应用IN方向的Route-map,对从Peer接收到的所有或部分路由进行设置Local Preference为BGP选路策略中经常使用的一个路径属性第二条:Local Preference属性l实验一:Local Prefenerce无法在EBGP Peer之间传递R1R2AS 1AS 210.0.0.0/8EBGProuter bgp 2 network 10.0.0.0 neighbor 9.9.12.1 remote-as 1 neighbor 9.9.12.1 route-map TO_R1 out!route-map TO_R1 permit 10 set local-pref

8、erence 500第二条:Local Preference属性l实验一:Local Prefenerce无法在EBGP Peer之间传递查看本地始发的BGP路由的LP值r2#show ip bgp BGP table version is 2, local router ID is 9.9.0.2Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Net

9、work Next Hop Metric LocPrf Weight Path* 10.0.0.0 0.0.0.0 0 32768 i空值空值? ?r2#sh ip b 10.0.0.0BGP routing table entry for 10.0.0.0/8, version 2Paths: (1 available, best #1, table Default-IP-Routing-Table) Advertised to non peer-group peers: 9.9.12.1 Local 0.0.0.0 from 0.0.0.0 (9.9.0.2) Origin IGP, me

10、tric 0, localpref 100, weight 32768, valid, sourced, local, best第二条:Local Preference属性l实验一:Local Prefenerce无法在EBGP Peer之间传递R2通告给R1的BGP路由是否携带LP?r1#sh ip bgp BGP table version is 2, local router ID is 9.9.0.1Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S

11、 StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.12.2 0 0 2 i500500没有传递没有传递? ?r2#sh ip bgp neighbors 9.9.12.1 advertised-routes BGP table version is 2, local router ID is 9.9.0.2Status codes: s suppressed, d damped, h history, * valid, bes

12、t, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 0.0.0.0 0 32768 i第二条:Local Preference属性l实验一:Local Prefenerce无法在EBGP Peer之间传递R2通告给R1的BGP Update报文R2通告的通告的10.0.0.0/8前缀的路径属性中不包含前缀的路径属性中不包含Local Preference属性属性第二条:L

13、ocal Preference属性l实验二:修改本地始发路由的默认LP值R1R2AS 110.0.0.0/8IBGProuter bgp 1 -R2的路由策略的路由策略 bgp default local-preference 500 network 10.0.0.0 neighbor 9.9.12.1 remote-as 1第二条:Local Preference属性l实验二:修改本地始发路由的默认LP值r2#sh ip b BGP table version is 2, local router ID is 10.0.0.1Status codes: s suppressed, d dam

14、ped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 0.0.0.0 0 32768 i空值空值? ?r2#sh ip b 10.0.0.0BGP routing table entry for 10.0.0.0/8, version 2Paths: (1 available, best #1, table Defau

15、lt-IP-Routing-Table) Advertised to non peer-group peers: 9.9.12.1 Local 0.0.0.0 from 0.0.0.0 (10.0.0.1) Origin IGP, metric 0, localpref 500, weight 32768, valid, sourced, local, best第二条:Local Preference属性l实验二:修改本地始发路由的默认LP值r1#sh ip b BGP table version is 4, local router ID is 9.9.0.1Status codes: s

16、suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path*i10.0.0.0 9.9.12.2 0 500 0 i第二条:Local Preference属性l实验三:将IGP中的路由引入BGP时关联Route-map设置LPR1R2AS 110.0.0.0/8IBGProuter bgp 1 -R2的路由策

17、略的路由策略 network 10.0.0.0 route-map SET_LP neighbor 9.9.12.1 remote-as 1!route-map SET_LP permit 10 set local-preference 400第二条:Local Preference属性l实验三:将IGP中的路由引入BGP时关联Route-map设置LPr2#sh ip b BGP table version is 3, local router ID is 10.0.0.1Status codes: s suppressed, d damped, h history, * valid, be

18、st, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 0.0.0.0 0 400 32768 ir1#sh ip bBGP table version is 6, local router ID is 9.9.0.1Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r

19、 RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path*i10.0.0.0 9.9.12.2 0 400 0 i第二条:Local Preference属性l实验四:对IBGP Peer应用IN/OUT方向Route-mapR3单向访问R6的数据流需求R1R2对R3应用OUT方向Route-mapR1AS 1R2R3R4R5R6AS 2以该方式部署策略以该方式部署策略,对数对数据流控制的作用范围据流控制的作用范围10.0.0.0/

20、811.0.0.0/8EBGP第二条:Local Preference属性l实验四:对IBGP Peer应用IN/OUT方向Route-mapR4、R5正常通告R6的路由,R1、R2的BGP表R1AS 1R2R3R4R5R6AS 210.0.0.0/811.0.0.0/8EBGPr1#sh ip bgp Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.15.5 0 2 i* 9.9.14.4 0 2 i* 11.0.0.0 9.9.15.5 0 2 i* 9.9.14.4 0 2 ir2#sh ip bgp Network Ne

21、xt Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.25.5 0 2 i* 9.9.24.4 0 2 i* 11.0.0 9.9.25.5 0 2 i* 9.9.24.4 0 2 iIBGPIBGPIBGPIBGP第二条:Local Preference属性l实验四:对IBGP Peer应用IN/OUT方向Route-mapR1、R2的路由策略router bgp 1 -R1的路由策略的路由策略 neighbor 9.9.13.3 route-map TO_R3 outaccess-list 1 permit 10.0.0.0access-list 2

22、 permit 11.0.0.0route-map TO_R3 permit 10 match ip address 1 set local-preference 500route-map TO_R3 permit 20 match ip address 2 set local-preference 400router bgp 1 -R2的路由策略的路由策略 neighbor 9.9.23.3 route-map TO_R3 outaccess-list 1 permit 10.0.0.0access-list 2 permit 11.0.0.0route-map TO_R3 permit 1

23、0 match ip address 1 set local-preference 400route-map TO_R3 permit 20 match ip address 2 set local-preference 500R1AS 1R2R3R4R5R6AS 210.0.0.0/811.0.0.0/8EBGPIBGPIBGPIBGPIBGP第二条:Local Preference属性l实验四:对IBGP Peer应用IN/OUT方向Route-mapR3的路由选路结果r3#sh ip b BGP table version is 6, local router ID is 9.9.0.3

24、Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* i10.0.0.0 9.9.23.2 0 400 0 2 i*i 9.9.13.1 0 500 0 2 i*i11.0.0.0 9.9.23.2 0 500 0 2 i* i 9.9.13.1 0 400 0 2 iR

25、1AS 1R2R3R4R5R6AS 210.0.0.0/811.0.0.0/8EBGPIBGPIBGPIBGPIBGP第二条:Local Preference属性l实验四:对IBGP Peer应用IN/OUT方向Route-map路由策略结果:R3到R6的实际单向数据流R1AS 1R2R3R4R5R6AS 210.0.0.0/811.0.0.0/8EBGP以该方式部署策略以该方式部署策略,对数对数据流控制的作用范围据流控制的作用范围第二条:Local Preference属性l实验五:对EBGP Peer应用IN方向Route-mapR3单向访问R6的数据流需求R1R2分别对R4R5应用OUT

26、方向的Route-mapR1AS 1R2R3R4R5R6AS 2以该方式部署策略以该方式部署策略,对数对数据流控制的作用范围据流控制的作用范围10.0.0.0/811.0.0.0/8EBGP第二条:Local Preference属性l实验五:对EBGP Peer应用IN方向Route-mapR1、R2的路由策略router bgp 1 -R1的路由策略的路由策略 neighbor 9.9.14.4 route-map FROM_R4 inaccess-list 1 permit 10.0.0.0route-map FROM_R4 permit 10 match ip address 1 se

27、t local-preference 500route-map FROM_R4 permit 20router bgp 1 -R2的路由策略的路由策略 neighbor 9.9.25.5 route-map FROM_R5 inaccess-list 2 permit 11.0.0.0route-map FROM_R5 permit 10 match ip address 2 set local-preference 500route-map FROM_R5 permit 20R1AS 1R2R3R4R5R6AS 210.0.0.0/811.0.0.0/8EBGPIBGPIBGPIBGPIBG

28、P第二条:Local Preference属性l实验五:对EBGP Peer应用IN方向Route-mapR1、R2的BGP表r1#sh ip bgp Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.15.5 0 2 i* 9.9.14.4 500 0 2 i* 11.0.0.0 9.9.14.4 0 2 i* 9.9.15.5 0 2 ir2#sh ip bgp Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.25.5 0 2 i* 9.9.24.4 0 2 i

29、* 11.0.0.0 9.9.25.5 500 0 2 i* 9.9.24.4 0 2 iR1AS 1R2R3R4R5R6AS 210.0.0.0/811.0.0.0/8EBGPIBGPIBGPIBGPIBGP第二条:Local Preference属性l实验五:对EBGP Peer应用IN方向Route-mapR3的BGP表r3#sh ip bgp BGP table version is 10, local router ID is 9.9.0.3Status codes: s suppressed, d damped, h history, * valid, best, i - inte

30、rnal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* i10.0.0.0 9.9.23.2 0 100 0 2 i*i 9.9.13.1 0 500 0 2 i*i11.0.0.0 9.9.23.2 0 500 0 2 i* i 9.9.13.1 0 100 0 2 iR1AS 1R2R3R4R5R6AS 210.0.0.0/811.0.0.0/8EBGPIBGPIBGPIBGPIBGP第二条:Local Pre

31、ference属性l实验五:对EBGP Peer应用IN方向Route-map路由策略结果:R3到R6的实际单向数据流R1AS 1R2R3R4R5R6AS 210.0.0.0/811.0.0.0/8以该方式部署策略以该方式部署策略,对数对数据流控制的作用范围据流控制的作用范围BGP路由选路原则路由选路原则1.Weight1.Weight属性属性2.Local Preference2.Local Preference属性属性3.3.本地路由始发方式本地路由始发方式4.AS-Path4.AS-Path长度长度5.Origin5.Origin属性属性6.MED6.MED属性属性7.EBGP7.EBG

32、P优于优于IBGPIBGP8.8.到达到达Next-hopNext-hop的代价的代价9.9.执行等价负载均衡执行等价负载均衡10.EBGP10.EBGP路由接收的顺序路由接收的顺序11.11.路由的路由的Router-IDRouter-ID12.Cluster-list12.Cluster-list长度长度13.13.配置的配置的BGP PeerBGP Peer指定地址指定地址第三条:本地路由始发方式l比较原则及配置注意事项 该比较原则主要是指本地在进入一条IGP路由进去BGP表时,使用不同的方式比如network或redistribute等,那么这些方式之间是存在优先顺序的:network

33、redistributeaggregate注意,该原则是不会作为BGP路由选路策略的第三条:本地路由始发方式l实验验证 本地分别以3种方式引入一条路由,如下配置所示interface Loopback1 ip address 3.3.3.3 255.255.255.255router bgp 1 network 3.3.3.3 mask 255.255.255.255 route-map A aggregate-address 3.3.3.3 255.255.255.255 attribute-map C redistribute connected route-map Broute-map

34、A permit 10 set local-preference 200route-map B permit 10 set local-preference 300route-map C permit 10 set local-preference 400第三条:本地路由始发方式l实验验证 本地BGP表中的显示,network方式为第一选择r3#sh ip bgpBGP table version is 13, local router ID is 9.9.0.3Status codes: s suppressed, d damped, h history, * valid, best, i

35、- internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 3.3.3.3/32 0.0.0.0 0 200 32768 i第三条:本地路由始发方式l实验验证 将network 3.3.3.3 mask 255.255.255.255 删除redistribute方式成为优选r3#sh ip bBGP table version is 14, local router ID is 9.9.0.3Status

36、 codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 3.3.3.3/32 0.0.0.0 0 300 32768 ?BGP路由选路原则路由选路原则1.Weight1.Weight属性属性2.Local Preference2.Local Preference属性属性3.3.本地路由

37、始发方式本地路由始发方式4.AS-Path4.AS-Path长度长度5.Origin5.Origin属性属性6.MED6.MED属性属性7.EBGP7.EBGP优于优于IBGPIBGP8.8.到达到达Next-hopNext-hop的代价的代价9.9.执行等价负载均衡执行等价负载均衡10.EBGP10.EBGP路由接收的顺序路由接收的顺序11.11.路由的路由的Router-IDRouter-ID12.Cluster-list12.Cluster-list长度长度13.13.配置的配置的BGP PeerBGP Peer指定地址指定地址第四条:AS-Path长度l比较原则及配置注意事项优选长度小

38、的AS-Path列表其他AS-Path比较原则:在做聚合路由时,使用as-set后产生的AS-Path列表中的里的AS号长度只算一个AS号的长度在联盟内的AS-Path列表中的()的AS号长度不做计算依据当向EBGP Peer 通告路由时,将自己的AS号加在AS-Path列表的最左端,向IBGP Peer通告路由时,不会对AS-Path列表做任何修改第四条:AS-Path长度l比较原则及配置注意事项修改AS-Path列表的方法:可以通过对EBGP Peer使用IN/OUT方向的Route-map,使用set as-path prepend命令来添加AS号。注意,上述操作只能对EBGP Peer

39、,对IBGP Peer无法生效。可以在BGP进程下使用bgp bestpath as-path ignore命令来跳过AS-Path的长度比较修改AS-Path长度可作为BGP选路策略的一种。第四条:AS-Path长度l实验一:使用OUT方向的Route-map来修改AS-PathR3访问R4的单向数据流需求R1R2R3R4AS1AS210.0.0.0/8以该方式部署策略以该方式部署策略,对数对数据流控制的作用范围据流控制的作用范围第四条:AS-Path长度l实验一:使用OUT方向的Route-map来修改AS-PathR1、R2的路由策略(R1保持默认)router bgp 2 -R2的路由

40、策略的路由策略 neighbor 9.9.23.3 route-map TO_R3 outroute-map TO_R3 permit 10 set as-path prepend 5 5 5 R1R2R3R4AS1AS210.0.0.0/8IBGPEBGPEBGPIBGP第四条:AS-Path长度l实验一:使用OUT方向的Route-map来修改AS-PathR3的BGP表选路结果r3#sh ip bBGP table version is 2, local router ID is 9.9.0.3Status codes: s suppressed, d damped, h history

41、, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.23.2 0 2 5 5 5 i* 9.9.13.1 0 2 i第四条:AS-Path长度l实验二:使用IN方向的Route-map来修改AS-PathR3访问R4的单向数据流需求R1R2R3R4AS1AS210.0.0.0/8以该方式部署策略以该方式部署策略,对数对数据流控制的作用范

42、围据流控制的作用范围第四条:AS-Path长度l实验二:使用IN方向的Route-map来修改AS-PathR3的路由策略router bgp 1 -R3的路由策略的路由策略 neighbor 9.9.23.2 route-map FROM_R2 inroute-map FROM_R2 permit 10 set as-path prepend 5 5 5R1R2R3R4AS1AS210.0.0.0/8IBGPEBGPEBGPIBGP第四条:AS-Path长度l实验二:使用IN方向的Route-map来修改AS-PathR3的BGP表选路结果r3#sh ip bgpBGP table vers

43、ion is 2, local router ID is 9.9.0.3Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.23.2 0 5 5 5 2 i* 9.9.13.1 0 2 i不同方向的不同方向的route-map对于插入的对于插入

44、的AS号的位置是不同的号的位置是不同的BGP路由选路原则路由选路原则1.Weight1.Weight属性属性2.Local Preference2.Local Preference属性属性3.3.本地路由始发方式本地路由始发方式4.AS-Path4.AS-Path长度长度5.Origin5.Origin属性属性6.MED6.MED属性属性7.EBGP7.EBGP优于优于IBGPIBGP8.8.到达到达Next-hopNext-hop的代价的代价9.9.执行等价负载均衡执行等价负载均衡10.EBGP10.EBGP路由接收的顺序路由接收的顺序11.11.路由的路由的Router-IDRouter-

45、ID12.Cluster-list12.Cluster-list长度长度13.13.配置的配置的BGP PeerBGP Peer指定地址指定地址第五条:Origin属性l比较原则及配置注意事项三种不同的Origin属性的优先顺序:IGPEGPincompleteOrigin属性会一直在BGP路由中携带Origin属性配置方法:将IGP路由引入BGP时关联Route-map进行设置默认情况下,network方式产生的BGP路由的Origin属性为IGP,而redistribute方式产生的BGP路由的Origin属性为“?”对BGP Peer应用IN/OUT方向的Route-map进行设置很少使

46、用设置Origin属性作为BGP路由选路策略第五条:Origin属性l实验1:设置Origin属性R1R2R3分别以network方式引入路由,R1R3关联不同的Route-map设置不同的Origin属性11.0.0.0/813.0.0.0/812.0.0.0/8AS 1AS 2R3R1R2IBGPEBGProuter bgp 1 -R3的路由策略的路由策略 network 13.0.0.0 route-map SET_Originroute-map SET_Origin permit 10 set origin incompleterouter bgp 1 -R1的路由策略的路由策略net

47、work 11.0.0.0 route-map SET_Originroute-map SET_Origin permit 10 set origin egp 第五条:Origin属性l实验1:设置Origin属性R1的BGP表r1# sh ip bgp BGP table version is 4, local router ID is 9.9.0.1Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP,

48、 e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 11.0.0.0 0.0.0.0 0 32768 e* 12.0.0.0 9.9.12.2 0 0 2 i*i13.0.0.0 9.9.13.3 0 100 0 ?第五条:Origin属性l实验1:设置Origin属性R1对R3应用IN方向的Route-map修改Origin属性,R2对R1使用OUT方向的Route-map修改Origin属性11.0.0.0/813.0.0.0/812.0.0.0/8AS 1AS 2R3R1R2IBGPEBGProuter

49、 bgp 1 -R1的路由策略的路由策略neighbor 9.9.13.3 route-map FROM_R3 inroute-map FROM_R3 permit 10 set origin igprouter bgp 2 -R2的路由策略的路由策略neighbor 9.9.12.1 route-map TO_R1 outroute-map TO_R1 permit 10 set origin incomplete第五条:Origin属性l实验1:设置Origin属性R1的BGP表r1#sh ip bgpBGP table version is 6, local router ID is 9

50、.9.0.1Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 11.0.0.0 0.0.0.0 0 32768 e* 12.0.0.0 9.9.12.2 0 0 2 ?*i13.0.0.0 9.9.13.3 0 100 0 i第五条:Origin属性l实验2:不同Or

51、igin属性之间的优先顺序10.0.0.0/810.0.0.0/8AS 1R3R1R2IBGPIBGP10.0.0.0/8R4IBGProuter bgp 1 -R3的路由策略的路由策略network 10.0.0.0 route-map SET_Originroute-map SET_Origin permit 10 set origin incompleteR2仅使用仅使用network方方式引入式引入10.0.0.0router bgp 1 -R4的路由策略的路由策略network 10.0.0.0 route-map SET_Originroute-map SET_Origin per

52、mit 10 set origin egp 第五条:Origin属性l实验2:不同Origin属性之间的优先顺序R1的BGP表路由选路结果r1#sh ip bgpBGP table version is 2, local router ID is 9.9.0.1Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metri

53、c LocPrf Weight Path* i10.0.0.0 9.9.14.4 0 100 0 e* i 9.9.13.3 0 100 0 ?*i 9.9.12.2 0 100 0 i第五条:Origin属性l实验2:不同Origin属性之间的优先顺序断开R1与R2的连接,R1的BGP表路由选路结果r1#sh ip bBGP table version is 3, local router ID is 9.9.0.1Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failu

54、re, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* i10.0.0.0 9.9.14.4 0 100 0 e*i 9.9.13.3 0 100 0 ?BGP路由选路原则路由选路原则1.Weight1.Weight属性属性2.Local Preference2.Local Preference属性属性3.3.本地路由始发方式本地路由始发方式4.AS-Path4.AS-Path长度长度5.Origin5.Origin属性属性6.MED6.MED属性

55、属性7.EBGP7.EBGP优于优于IBGPIBGP8.8.到达到达Next-hopNext-hop的代价的代价9.9.执行等价负载均衡执行等价负载均衡10.EBGP10.EBGP路由接收的顺序路由接收的顺序11.11.路由的路由的Router-IDRouter-ID12.Cluster-list12.Cluster-list长度长度13.13.配置的配置的BGP PeerBGP Peer指定地址指定地址第六条:MED属性l比较原则及配置注意事项MED值越小,越优先.默认情况下,只比较来自同一邻居AS的BGP路由的MED值MED设置方法:将IGP路由引入BGP时关联Route-map进行设置对

56、BGP Peer应用IN/OUT方向的Route-map进行设置非Route-map(自动)方式:使用network或redistribute方式将IGP路由引入BGP时,MED将继承IGP路由的Metric(直联路由的Metric为0)使用aggregate-address方式引入路由,则MED为空第六条:MED属性l比较原则及配置注意事项本地在将一条BGP路由通告给EBGP Peer时,是否携带MED值,需要根据以下条件进行判断(不对EBGP Peer使用Route-map):如果该BGP路由是本地始发(network或redistribute)的,则携带MED值发送给EBGP Peer

57、(如果MED为空,则设置为0)如果该BGP路由是从其他BGP Peer学习过来的,那么将该路由通告给EBGP Peer时不携带MED本地在将一条BGP路由通告给IBGP Peer时,一定会携带MED值如果接收或产生的路由的MED为空,那么在向IBGP Peer通告时,将MED设置为0第六条:MED属性l比较原则及配置注意事项其他MED相关配置命令(BGP进程下):bgp always-compare-medbgp bestpath med missing-as-worst bgp deterministic-medbgp bestpath med confedMED为BGP选路策略中经常使用的

58、一个路径属性第六条:MED属性l实验1:MED继承IGP的MetricR1使用network方式将11.0.0.0引入BGP,使用redistribute方式将12.0.0.0引入BGP11.0.0.0/812.0.0.0/8AS 1R3R1R2IBGPOSPFCost100router bgp 1 -R1的路由策略的路由策略network 11.0.0.0redistribute ospf 1第六条:MED属性l实验1:MED继承IGP的MetricR1的路由表R1的BGP表r1#sh ip ro 9.0.0.0/8 is variably subnetted, 3 subnets, 2 m

59、asksC 9.9.0.1/32 is directly connected, Loopback0C 9.9.12.0/24 is directly connected, FastEthernet0/0.12C 9.9.13.0/24 is directly connected, FastEthernet0/0.13C 11.0.0.0/8 is directly connected, Loopback1O 12.0.0.0/8 110/101 via 9.9.12.2, 00:01:59, FastEthernet0/0.12r1#sh ip bgpBGP table version is

60、4, local router ID is 9.9.0.1Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 9.9.12.0/24 0.0.0.0 0 32768 ?* 11.0.0.0 0.0.0.0 0 32768 i* 12.0.0.0 9.9.12.2 101

61、 32768 ?第六条:MED属性l实验2:MED属性的传递范围R2R3分别使用network方式引入直连路由进入BGP,并关联Route-map,将MED设置为10013.0.0.0/812.0.0.0/8AS 1AS 2R3R1R2IBGPEBGProuter bgp 1 -R3的路由策略的路由策略network 13.0.0.0 route-map SET_MEDroute-map SET_MED permit 10 set metric 100router bgp 2 -R2的路由策略的路由策略network 12.0.0.0 route-map SET_MEDroute-map SE

62、T_MED permit 10 set metric 100R4IBGP第六条:MED属性l实验2:MED属性的传递范围R3的BGP表R1的BGP表R2的BGP表r3#sh ip bgp Network Next Hop Metric LocPrf Weight Path* i12.0.0.0 9.9.12.2 100 100 0 2 i* 13.0.0.0 0.0.0.0 100 32768 ir1#sh ip bgp Network Next Hop Metric LocPrf Weight Path* 12.0.0.0 9.9.12.2 100 0 2 i*i13.0.0.0 9.9.1

63、3.3 100 100 0 ir2# sh ip bgp Network Next Hop Metric LocPrf Weight Path* 12.0.0.0 0.0.0.0 100 32768 i* 13.0.0.0 9.9.12.1 0 1 i第六条:MED属性l实验2:MED属性的传递范围R2的BGP表(详细)R4的BGP表r2#sh ip bgp 13.0.0.0BGP routing table entry for 13.0.0.0/8, version 3Paths: (1 available, best #1, table Default-IP-Routing-Table)

64、Not advertised to any peer 1 9.9.12.1 from 9.9.12.1 (9.9.0.1) Origin IGP, localpref 100, valid, external, bestr4#sh ip bBGP table version is 3, local router ID is 9.9.0.4Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP

65、, ? - incomplete Network Next Hop Metric LocPrf Weight Path*i12.0.0.0 9.9.24.2 100 100 0 i*i13.0.0.0 9.9.12.1 0 100 0 1 i第六条:MED属性l实验3:对EBGP Peer应用INOUT方向Route-mapR3单向访问R6的数据流需求R4R5分别对R1R2应用OUT方向Route-mapR1AS 1R2R3R4R5R6AS 2以该方式部署策略以该方式部署策略,对数对数据流控制的作用范围据流控制的作用范围10.0.0.0/811.0.0.0/8EBGPIBGPIBGPIBGPI

66、BGP第六条:MED属性l实验3:对EBGP Peer应用INOUT方向Route-mapR4R5的路由策略router bgp 2 -R4的路由策略的路由策略neighbor 9.9.14.1 route-map TO_R1 outneighbor 9.9.24.2 route-map TO_R2 outaccess-list 1 permit 10.0.0.0access-list 2 permit 11.0.0.0route-map TO_R2 permit 10 set metric 200route-map TO_R1 permit 10 match ip address 1 set

67、 metric 100route-map TO_R1 permit 20 match ip address 2 set metric 300router bgp 2 -R5的路由策略的路由策略neighbor 9.9.15.1 route-map TO_R1 outneighbor 9.9.25.2 route-map TO_R2 outaccess-list 1 permit 10.0.0.0access-list 2 permit 11.0.0.0route-map TO_R2 permit 10 match ip address 1 set metric 300route-map TO_

68、R2 permit 20 match ip address 2 set metric 100route-map TO_R1 permit 10 set metric 200第六条:MED属性l实验3:对EBGP Peer应用INOUT方向Route-mapR1R2的BGP表r1#sh ip bgp BGP table version is 9, local router ID is 9.9.0.1Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S Stale

69、Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.15.5 200 0 2 i* 9.9.14.4 100 0 2 i* 11.0.0.0 9.9.14.4 300 0 2 i* 9.9.15.5 200 0 2 ir2#sh ip bgp BGP table version is 10, local router ID is 9.9.0.2Status codes: s suppressed, d damped, h history,

70、* valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.24.4 200 0 2 i* 9.9.25.5 300 0 2 i* 11.0.0.0 9.9.25.5 100 0 2 i* 9.9.24.4 200 0 2 i第六条:MED属性l实验3:对EBGP Peer应用INOUT方向Route-mapR3的BGP表路由选路结果r3#sh i

71、p bgp BGP table version is 10, local router ID is 9.9.0.3Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* i10.0.0.0 9.9.23.2 200 100 0 2 i*i 9.9.13.1 100 100

72、0 2 i* i11.0.0.0 9.9.13.1 200 100 0 2 i*i 9.9.23.2 100 100 0 2 i第六条:MED属性l实验4:对IBGP Peer应用INOUT方向Route-mapR3单向访问R6的数据流需求R1R2分别对R3应用OUT方向Route-mapR1AS 1R2R3R4R5R6AS 2以该方式部署策略以该方式部署策略,对数对数据流控制的作用范围据流控制的作用范围10.0.0.0/811.0.0.0/8EBGPIBGPIBGPIBGPIBGP第六条:MED属性l实验4:对IBGP Peer应用INOUT方向Route-mapR1R2的路由策略route

73、r bgp 1 -R1的路由策略的路由策略neighbor 9.9.13.3 route-map TO_R3 outaccess-list 1 permit 10.0.0.0access-list 2 permit 11.0.0.0route-map TO_R3 permit 10 match ip address 1 set metric 100route-map TO_R3 permit 20 match ip address 2 set metric 200router bgp 1 -R2的路由策略的路由策略neighbor 9.9.23.3 route-map TO_R3 outacc

74、ess-list 1 permit 10.0.0.0access-list 2 permit 11.0.0.0route-map TO_R3 permit 10 match ip address 1 set metric 200route-map TO_R3 permit 20 match ip address 2 set metric 100第六条:MED属性l实验4:对IBGP Peer应用INOUT方向Route-mapR3的BGP表路由选路结果r3#sh ip bgpBGP table version is 18, local router ID is 9.9.0.3Status co

75、des: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* i10.0.0.0 9.9.23.2 200 100 0 2 i*i 9.9.13.1 100 100 0 2 i* i11.0.0.0 9.9.13.1 200 100 0 2 i*i 9.9.23.2 100 100 0 2 i第六

76、条:MED属性l实验5: bgp always-compare-medR3单向访问R4的数据流需求R2对R3应用OUT方向的Route-mapR1R2R3R4AS3AS210.0.0.0/8EBGPEBGPEBGPEBGPAS1AS4router bgp 1 -R2的路由策略的路由策略neighbor 9.9.23.3 route-map TO_R3 outroute-map TO_R3 permit 10set metric 100第六条:MED属性l实验5: bgp always-compare-medR3的BGP表路由选路结果r3#sh ip bBGP table version is

77、2, local router ID is 9.9.0.3Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.13.1 0 1 4 i* 9.9.23.2 100 0 2 4 i第六条:MED属性l实验5: bgp always-compare

78、-medR3的BGP进程下增加bgp always-compare-medr3#sh ip bBGP table version is 3, local router ID is 9.9.0.3Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9

79、.13.1 0 1 4 i* 9.9.23.2 100 0 2 4 i第六条:MED属性l实验6: bgp bestpath med missing-as-worst R5单向访问R4的数据流需求所有设备均不设置路由策略(Route-map)R1R2R3R4AS1AS210.0.0.0/8EBGPIBGPIBGPR5IBGPEBGP第六条:MED属性l实验6: bgp bestpath med missing-as-worst R5的BGP表路由选路结果r5#sh ip bgpBGP table version is 3, local router ID is 9.9.0.5Status co

80、des: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.25.2 0 2 i* i 9.9.35.3 0 100 0 2 i第六条:MED属性l实验6: bgp bestpath med missing-as-worst R5的BGP进程下使用bgp bestpat

81、h med missing-as-worst r5#sh ip bBGP table version is 4, local router ID is 9.9.0.5Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.25.2 42949672

82、95 0 2 i*i 9.9.35.3 0 100 0 2 iBGP路由选路原则路由选路原则1.Weight1.Weight属性属性2.Local Preference2.Local Preference属性属性3.3.本地路由始发方式本地路由始发方式4.AS-Path4.AS-Path长度长度5.Origin5.Origin属性属性6.MED6.MED属性属性7.EBGP7.EBGP优于优于IBGPIBGP8.8.到达到达Next-hopNext-hop的代价的代价9.9.执行等价负载均衡执行等价负载均衡10.EBGP10.EBGP路由接收的顺序路由接收的顺序11.11.路由的路由的Rout

83、er-IDRouter-ID12.Cluster-list12.Cluster-list长度长度13.13.配置的配置的BGP PeerBGP Peer指定地址指定地址第七条:EBGP优于IBGPl比较原则当使用前面六条原则仍无法决定出路由的优先顺序时,会根据EBGP路由优于IBGP路由这条原则进行优选该原则不会做为BGP路由选路策略第七条:EBGP优于IBGPl实验案例以R2的BGP表为例AS1AS210.0.0.0/8R1R2R3EBGPEBGPIBGPR2将分别从将分别从R1和和R3接受到接受到10.0.0.0/8路由路由第七条:EBGP优于IBGPl实验案例以R2的BGP表为例r2#s

84、h ip bBGP table version is 2, local router ID is 9.9.0.2Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* i10.0.0.0 9.9.12.1 0 100 0 2 i* 9.9.23.3 0 0 2 i第七条:E

85、BGP优于IBGPl实验案例以R2的BGP表为例r2#sh ip bgp 10.0.0.0BGP routing table entry for 10.0.0.0/8, version 2Paths: (2 available, best #2, table Default-IP-Routing-Table) Advertised to non peer-group peers: 9.9.12.1 2 9.9.12.1 from 9.9.12.1 (9.9.0.1) Origin IGP, metric 0, localpref 100, valid, internal 2 9.9.23.3

86、from 9.9.23.3 (10.0.0.1) Origin IGP, metric 0, localpref 100, valid, external, bestBGP路由选路原则路由选路原则1.Weight1.Weight属性属性2.Local Preference2.Local Preference属性属性3.3.本地路由始发方式本地路由始发方式4.AS-Path4.AS-Path长度长度5.Origin5.Origin属性属性6.MED6.MED属性属性7.EBGP7.EBGP优于优于IBGPIBGP8.8.到达到达Next-hopNext-hop的代价的代价9.9.执行等价负载均衡

87、执行等价负载均衡10.EBGP10.EBGP路由接收的顺序路由接收的顺序11.11.路由的路由的Router-IDRouter-ID12.Cluster-list12.Cluster-list长度长度13.13.配置的配置的BGP PeerBGP Peer指定地址指定地址第八条:到达Next-hop的代价l比较原则比较到达BGP路由路径属性中的Next-hop地址的IGP Metric值,越小越优先注,该值与MED没有任何关系几乎很少使用该原则作为BGP路由选路策略第八条:到达Next-hop的代价l实验验证AS1内各设备使用Loopback接口建立IBGP PeerR1R2R3R4AS1AS

88、210.0.0.0/8OSPFcost 100r3#sh ip bBGP table version is 3, local router ID is 9.9.0.3Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* i10.0.0.0 9.9.0.1 0 100 0

89、2 i*i 9.9.0.2 0 100 0 2 iEBGPIBGPEBGPIBGP第八条:到达Next-hop的代价l实验验证R3的路由表及BGP表路由选路结果r3#sh ip b 10.0.0.0BGP routing table entry for 10.0.0.0/8, version 3Paths: (2 available, best #2, table Default-IP-Routing-Table) Not advertised to any peer 2 9.9.0.1 (metric 101) from 9.9.0.1 (9.9.0.1) Origin IGP, metri

90、c 0, localpref 100, valid, internal 2 9.9.0.2 (metric 2) from 9.9.0.2 (9.9.0.2) Origin IGP, metric 0, localpref 100, valid, internal, bestr3#sh ip roO 9.9.0.1/32 110/101 via 9.9.13.1, 00:27:43, FastEthernet0/0.13O 9.9.0.2/32 110/2 via 9.9.23.2, 00:27:43, FastEthernet0/0.23Next-hop对端与本地建立邻居所使用对端与本地建立

91、邻居所使用的源地址的源地址(Updtae Source)对端的对端的router-idBGP路由选路原则路由选路原则1.Weight1.Weight属性属性2.Local Preference2.Local Preference属性属性3.3.本地路由始发方式本地路由始发方式4.AS-Path4.AS-Path长度长度5.Origin5.Origin属性属性6.MED6.MED属性属性7.EBGP7.EBGP优于优于IBGPIBGP8.8.到达到达Next-hopNext-hop的代价的代价9.9.执行等价负载均衡执行等价负载均衡10.EBGP10.EBGP路由接收的顺序路由接收的顺序11.1

92、1.路由的路由的Router-IDRouter-ID12.Cluster-list12.Cluster-list长度长度13.13.配置的配置的BGP PeerBGP Peer指定地址指定地址第九条:执行等价负载均衡l等价负载均衡说明:当前面的8条选路原则都无法优选出最优路由时,并且在BGP进程下面配置了maximum-paths ibgp n,n的取值为2-6,那么将执行等价负载均衡如果不关联ibgp关键字,那么只会对EBGP路由执行等价负载均衡如果不配置maximum-paths,那么将进行到下一条选路原则第九条:执行等价负载均衡l实验验证R3上配置maximum-paths 2R1R2R

93、3R4AS1AS210.0.0.0/8EBGPEBGPIBGPIBGP第九条:执行等价负载均衡l实验验证R3的BGP表选路结果r3#sh ip b Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.23.2 0 2 i* 9.9.13.1 0 2 ir3#sh ip b 10.0.0.0BGP routing table entry for 10.0.0.0/8, version 3Paths: (2 available, best #1, table Default-IP-Routing-Table)Multipath: eBG

94、P Advertised to non peer-group peers: 9.9.13.1 2 9.9.23.2 from 9.9.23.2 (9.9.0.2) Origin IGP, localpref 100, valid, external, multipath, best 2 9.9.13.1 from 9.9.13.1 (9.9.0.1) Origin IGP, localpref 100, valid, external, multipath第九条:执行等价负载均衡l实验验证R3的路由表选路结果r3#sh ip roCodes: C - connected, S - static

95、, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter are

96、a, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is not set 9.0.0.0/8 is variably subnetted, 3 subnets, 2 masksC 9.9.0.3/32 is directly connected, Loopback0C 9.9.13.0/24 is directly connected, FastEthernet0/0.13C 9.9.23.0/24 is d

97、irectly connected, FastEthernet0/0.23B 10.0.0.0/8 20/0 via 9.9.13.1, 00:22:15 20/0 via 9.9.23.2, 00:20:55BGP路由选路原则路由选路原则1.Weight1.Weight属性属性2.Local Preference2.Local Preference属性属性3.3.本地路由始发方式本地路由始发方式4.AS-Path4.AS-Path长度长度5.Origin5.Origin属性属性6.MED6.MED属性属性7.EBGP7.EBGP优于优于IBGPIBGP8.8.到达到达Next-hopNext

98、-hop的代价的代价9.9.执行等价负载均衡执行等价负载均衡10.EBGP10.EBGP路由接收的顺序路由接收的顺序11.11.路由的路由的Router-IDRouter-ID12.Cluster-list12.Cluster-list长度长度13.13.配置的配置的BGP PeerBGP Peer指定地址指定地址第十条:EBGP路由接收的顺序l比较原则及注意事项当前面9条选路原则比较结果相同时,并且参与比较的路由都为EBGP路由时,会根据EBGP路由安装进BGP表的先后顺序进行优选,先安装的EBGP路由会被优选如果BGP进程下使用bgp bestpath compare-routerid命令

99、,则忽略本原则,跳到第11条选路原则第十条:EBGP路由接收的顺序l实验验证所有设备仅做基本的配置以通告路由R1R2R3R4AS1AS210.0.0.0/8EBGPEBGPIBGPIBGP第十条:EBGP路由接收的顺序l实验验证R3的BGP表路由选路结果r3#sh ip b BGP table version is 4, local router ID is 9.9.0.3Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes

100、: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.23.2 0 2 i* 9.9.13.1 0 2 i第十条:EBGP路由接收的顺序l实验验证R3的BGP表路由选路结果断开R3与R2的连接r3#sh ip b BGP table version is 5, local router ID is 9.9.0.3Status codes: s suppressed, d damped, h history, * valid, best, i - internal,

101、r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.13.1 0 2 i第十条:EBGP路由接收的顺序l实验验证R3的BGP表路由选路结果恢复R3与R2的连接r3#sh ip b BGP table version is 5, local router ID is 9.9.0.3Status codes: s suppressed, d damped, h history, * valid, be

102、st, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 10.0.0.0 9.9.23.2 0 2 i* 9.9.13.1 0 2 iBGP路由选路原则路由选路原则1.Weight1.Weight属性属性2.Local Preference2.Local Preference属性属性3.3.本地路由始发方式本地路由始发方式4.AS-Path4.AS-Path长度长度5.Origin5.Ori

103、gin属性属性6.MED6.MED属性属性7.EBGP7.EBGP优于优于IBGPIBGP8.8.到达到达Next-hopNext-hop的代价的代价9.9.执行等价负载均衡执行等价负载均衡10.EBGP10.EBGP路由接收的顺序路由接收的顺序11.11.路由的路由的Router-IDRouter-ID12.Cluster-list12.Cluster-list长度长度13.13.配置的配置的BGP PeerBGP Peer指定地址指定地址第十一条:路由的Router-IDl比较原则Router-ID越小,越优先第10条选路原则已经完成EBGP路由的优选,因此第11-13条选路原则都是针对I

104、BGP路由第十一条:路由的Router-IDl实验验证所有设备仅做基本的配置以通告路由R1R2R3R4AS1AS210.0.0.0/8EBGPIBGPIBGPEBGP第十一条:路由的Router-IDl实验验证R3的BGP表路由选路结果r3#sh ip bgpBGP table version is 2, local router ID is 9.9.0.3Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IG

105、P, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* i10.0.0.0 9.9.23.2 0 100 0 2 i*i 9.9.13.1 0 100 0 2 ir3#sh ip bgp 10.0.0.0BGP routing table entry for 10.0.0.0/8, version 2Paths: (2 available, best #2, table Default-IP-Routing-Table) Not advertised to any peer 2 9.9.23.2 from 9

106、.9.23.2 (9.9.0.2) Origin IGP, metric 0, localpref 100, valid, internal 2 9.9.13.1 from 9.9.13.1 (9.9.0.1) Origin IGP, metric 0, localpref 100, valid, internal, best第十一条:路由的Router-IDl实验验证断开R3与R1的邻居关系恢复R3与R1的邻居关系r3#sh ip b BGP table version is 3, local router ID is 9.9.0.3Status codes: s suppressed, d

107、 damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path*i10.0.0.0 9.9.23.2 0 100 0 2 ir3#sh ip b BGP table version is 4, local router ID is 9.9.0.3Status codes: s suppressed, d damped, h history,

108、 * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path*i10.0.0.0 9.9.13.1 0 100 0 2 i* i 9.9.23.2 0 100 0 2 iBGP路由选路原则路由选路原则1.Weight1.Weight属性属性2.Local Preference2.Local Preference属性属性3.3.本地路由始发方式本地路由始发方式4.AS-Path

109、4.AS-Path长度长度5.Origin5.Origin属性属性6.MED6.MED属性属性7.EBGP7.EBGP优于优于IBGPIBGP8.8.到达到达Next-hopNext-hop的代价的代价9.9.执行等价负载均衡执行等价负载均衡10.EBGP10.EBGP路由接收的顺序路由接收的顺序11.11.路由的路由的Router-IDRouter-ID12.Cluster-list12.Cluster-list长度长度13.13.配置的配置的BGP PeerBGP Peer指定地址指定地址第十二条:Cluster-list长度l比较原则长度越小,越优先仅在存在反射器的环境下,才会进行Clu

110、ster-list长度的比较,RR在执行路由反射动作时会将自己的Cluster ID添加在Cluster-list中.第十二条:Cluster-list长度l实验验证R4R2 RRR1R3 RRClientClientIBGPIBGPIBGPIBGPAS1router bgp 1 -R2的路由策略的路由策略neighbor 9.9.12.1 route-reflector-clientrouter bgp 1 -R3的路由策略的路由策略neighbor 9.9.34.4 route-reflector-client10.0.0.0/8第十二条:Cluster-list长度l实验验证R1的BGP

111、表选路结果r1#sh ip bgpBGP table version is 2, local router ID is 9.9.0.1Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* i10.0.0.0 9.9.34.4 0 100 0 i*i 9.9.34.4 0

112、100 0 ir1#sh ip bgp 10.0.0.0BGP routing table entry for 10.0.0.0/8, version 2Paths: (2 available, best #2, table Default-IP-Routing-Table) Not advertised to any peer Local 9.9.34.4 (metric 1) from 9.9.12.2 (9.9.0.2) Origin IGP, metric 0, localpref 100, valid, internal Originator: 9.9.0.4, Cluster li

113、st: 9.9.0.2, 9.9.0.3 Local 9.9.34.4 (metric 1) from 9.9.13.3 (9.9.0.3) Origin IGP, metric 0, localpref 100, valid, internal, best Originator: 9.9.0.4, Cluster list: 9.9.0.3BGP路由选路原则路由选路原则1.Weight1.Weight属性属性2.Local Preference2.Local Preference属性属性3.3.本地路由始发方式本地路由始发方式4.AS-Path4.AS-Path长度长度5.Origin5.O

114、rigin属性属性6.MED6.MED属性属性7.EBGP7.EBGP优于优于IBGPIBGP8.8.到达到达Next-hopNext-hop的代价的代价9.9.执行等价负载均衡执行等价负载均衡10.EBGP10.EBGP路由接收的顺序路由接收的顺序11.11.路由的路由的Router-IDRouter-ID12.Cluster-list12.Cluster-list长度长度13.13.配置的配置的BGP PeerBGP Peer指定地址指定地址第十三条:配置的BGP Peer指定地址l比较原则配置的邻居地址越低,越优先邻居地址是指BGP进程下面使用neighbor命令指定的地址第十三条:配置

115、的BGP Peer指定地址l实验验证R1和R2的BGP Router ID相同Router-id 9.9.0.12Router-id 9.9.0.12R1R2R3R4AS1AS210.0.0.0/8EBGPIBGPIBGPEBGP第十三条:配置的BGP Peer指定地址l实验验证R3的BGP表选路结果r3#sh ip bgp BGP table version is 2, local router ID is 9.9.0.3Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-fa

116、ilure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* i10.0.0.0 9.9.23.2 0 100 0 2 i*i 9.9.13.1 0 100 0 2 ir3#sh ip bgp 10.0.0.0BGP routing table entry for 10.0.0.0/8, version 2Paths: (2 available, best #2, table Default-IP-Routing-Table) Not advert

117、ised to any peer 2 9.9.23.2 from 9.9.23.2 (9.9.0.12) Origin IGP, metric 0, localpref 100, valid, internal 2 9.9.13.1 from 9.9.13.1 (9.9.0.12) Origin IGP, metric 0, localpref 100, valid, internal, best第十三条:配置的BGP Peer指定地址l实验验证R3与R1断开连接R3与R1恢复连接r3#sh ip b BGP table version is 3, local router ID is 9.9

118、.0.3Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path*i10.0.0.0 9.9.23.2 0 100 0 2 ir3#sh ip bgp BGP table version is 4, local router ID is 9.9.0.3Status codes:

119、 s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path*i10.0.0.0 9.9.13.1 0 100 0 2 i* i 9.9.23.2 0 100 0 2 iBGP路由选路原则路由选路原则1.Weight1.Weight属性属性2.Local Preference2.Local Preferen

120、ce属性属性3.3.本地路由始发方式本地路由始发方式4.AS-Path4.AS-Path长度长度5.Origin5.Origin属性属性6.MED6.MED属性属性7.EBGP7.EBGP优于优于IBGPIBGP8.8.到达到达Next-hopNext-hop的代价的代价9.9.执行等价负载均衡执行等价负载均衡10.EBGP10.EBGP路由接收的顺序路由接收的顺序11.11.路由的路由的Router-IDRouter-ID12.Cluster-list12.Cluster-list长度长度13.13.配置的配置的BGP PeerBGP Peer指定地址指定地址112THANKSTHANKS!

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号