ccie bgp学习笔记

上传人:第*** 文档编号:34610715 上传时间:2018-02-26 格式:DOCX 页数:53 大小:956.42KB
返回 下载 相关 举报
ccie bgp学习笔记_第1页
第1页 / 共53页
ccie bgp学习笔记_第2页
第2页 / 共53页
ccie bgp学习笔记_第3页
第3页 / 共53页
ccie bgp学习笔记_第4页
第4页 / 共53页
ccie bgp学习笔记_第5页
第5页 / 共53页
点击查看更多>>
资源描述

《ccie bgp学习笔记》由会员分享,可在线阅读,更多相关《ccie bgp学习笔记(53页珍藏版)》请在金锄头文库上搜索。

1、BGP 实验下一跳 IGP 可达试验 iBGP 路由宣告下一跳时碰到如下问题,R1 上和 R3 上分别有一条默认路由,R1 到 R3 的连通性没问题,但起 iBGP 邻居时,始终卡在Active 状态, 在 R1 上打开 debug ip bgp all 有如下出错提示。*Mar 1 00:13:35.555: BGP: 23.1.1.3 multihop open delayed 17171ms (no route)后在 R1 上加一条 ip route 23.1.1.0 255.255.255.0 12.1.1.2 邻居可正常起来(R3 端未加静态路由),再删除该路由邻居状态仍然正常。 然

2、后在 R1 上宣告 loopback0 1.1.1.0 进 BGP,在 R3 上观察其下一跳如下:R3(config)#do sh ip routeGateway of last resort is 23.1.1.2 to network 0.0.0.01.0.0.0/24 is subnetted, 1 subnetsB 1.1.1.0 200/0 via 12.1.1.1, 00:04:5823.0.0.0/24 is subnetted, 1 subnetsC 23.1.1.0 is directly connected, FastEthernet0/0S* 0.0.0.0/0 1/0

3、via 23.1.1.2在 R3 上 ping 结果如下R3(config)#do ping 1.1.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:U.U.U因为在 R2 上没有到 1.1.1.0 的路由,所以会显示不可达。这就需要 bgp/igp 同步。还有一种情况就是 R1 是一个 AS,R2 、R3 是另一个 AS,当 R1 上宣告一条路由时,R2 上学到,下一跳指向 R1 的接口地址(具体地址是用来和 R2 建立邻居的IP,不一定是接口 I

4、P),但 R2 再把这条路由通告级其 iBGP 邻居 R3 时,下一跳仍然是 R1 的地址,这就导致这些路由在 R3 上进入不了路由表,因为 R1 的地址对于 R3 来说是另一个 AS 的,不可达。可以起一条静态路由解决该问题,但BGP 有个下一跳自我命令用来解决这问题。next-hop-self本地优先级(LOCAL_PREF) 影响离开本 AS 的路径。且只在本 AS 内传递,当从本 AS 到外部路由有多条路径时,调整本地优先级可影响出去的路,越大越优先,配置方法 是在 bgp 进程下 bgp default local-preference * ;配置完成后,使用 clear ip bg

5、p * soft,来软重置 bgp 进程,也可直接使用 clear ip bgp *,但会导致所有邻居重新建立。见下图:默认优先级为 100,则 R2 会选择先形成邻居的下一跳作为出口 ?(存疑)。此时我如果想让 R2 到 60.0.0.1 由 3.3.3.3 为下一跳,则在 R3 上调整本地优先级大于 100 即可。配置如下R3(config-router)#bgp default local-preference 110软重启 bgp 进程后在 R2 上的结果如下:R2#clear ip bgp * softR2#sh ip bgpBGP table version is 5, local

6、 router ID is 20.0.0.1Status codes: s suppressed, d damped, h history, * valid, best, i - internal,r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incompleteNetwork Next Hop Metric LocPrf Weight Path* 20.0.0.0/24 0.0.0.0 0 32768 i* i60.0.0.0/24 1.1.1.1 0 100 0 400 600 i*i 3.3.3.3 0 110 0 5

7、00 600 i也可以使用 route-map 来精确到具体一条路由的 LocPrf 值。route-map p2 permit 10set local-preference 200router-bgp 100neighbor 14.1.1.4 route-map p2 in上面的配置是把从 14.1.1.4 的所有路由的 LocPrf 都调整到 200。下面的配置是调整部分:!route-map p2 permit 10match ip address 10set local-preference 200!route-map p2 permit 20!router-bgp 100neighb

8、or 14.1.1.4 route-map p2 in记得 route-map 的最后一句要加,不然不在 ACL 中的路由将不能宣告。调整权重和其它属性用到 route-map 时配置类似。MED(多出口鉴别)属性MED 是 MULTI_EXIT_DISC 的缩写,顾名思义他影响从别的 AS 进入本 AS 的路径。(*可以联想在 BGP 中来回的流量路径一不定是相反的同一条路径*); 它允许将首选进入本 AS 的入口点通知给另一个 AS,和 LOCAL_PREF 不同,具有越低的Comment n1: 如果在比较不同 AS的 MED可使用 bgp always-compare-medMED值的

9、路由是首选。特别注意:如果到同一目的地的两条路径分别来自不同AS则不进行 MED比较,所以上图该实验已经做不出效果了 。 见如下拓扑:4台路由器上分别宣告其 loopback1到 bgp中,默认在 R3和 R4上看到到 R1的loopback口 10.0.0.0的下一跳如下所示:R3:R3(config-if)#do sh ip bgpBGP table version is 10, local router ID is 3.3.3.3Network Next Hop Metric LocPrf Weight Path* i10.0.0.0/24 4.4.4.4 0 100 0 100 i*

10、2.2.2.2 0 100 i* 30.0.0.0/24 0.0.0.0 0 32768 i*i40.0.0.0/24 4.4.4.4 0 100 0 iR4:R4(config-router)#do sh ip bgpBGP table version is 6, local router ID is 4.4.4.4Network Next Hop Metric LocPrf Weight Path* i10.0.0.0/24 3.3.3.3 0 100 0 100 i* 1.1.1.1 0 0 100 i*i30.0.0.0/24 3.3.3.3 0 100 0 i* 40.0.0.0/2

11、4 0.0.0.0 0 32768 i此时未作任何其它配置,所以分别走自己的下一跳进入 AS100,如果我想让AS200到 AS100中的 10.0.0.0/24流量优先从 R1走,则需要在 R2上调整相关路由的 MED 值(增加相关路由的 MED 值,MED 可以理解为 mertic,越小越优先),配置如下:access-list 1 permit 10.0.0.0 0.0.0.255route-map med permit 10match ip address 1set metric 10!router bgp 100no synchronizationbgp log-neighbor-c

12、hangesneighbor 1.1.1.1 remote-as 100neighbor 1.1.1.1 update-source Loopback0neighbor 3.3.3.3 remote-as 200neighbor 3.3.3.3 ebgp-multihop 255neighbor 3.3.3.3 update-source Loopback0neighbor 3.3.3.3 route-map med outno auto-summary!再在 R3、R4 上观察 bgp 路由表(先 clear ip bgp * soft):R3(config-if)#do sh ip bgp

13、 BGP table version is 11, local router ID is 3.3.3.3Status codes: s suppressed, d damped, h history, * valid, best, i - internal,r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incompleteNetwork Next Hop Metric LocPrf Weight Path*i10.0.0.0/24 4.4.4.4 0 100 0 100 i* 2.2.2.2 10 0 100 i* 30.0

14、.0.0/24 0.0.0.0 0 32768 i*i40.0.0.0/24 4.4.4.4 0 100 0 i查看路由表:34.0.0.0/24 is subnetted, 1 subnetsC 34.1.1.0 is directly connected, FastEthernet0/02.0.0.0/24 is subnetted, 1 subnetsS 2.2.2.0 1/0 via 23.1.1.23.0.0.0/32 is subnetted, 1 subnetsC 3.3.3.3 is directly connected, Loopback04.0.0.0/32 is subnetted, 1 subnetsR 4.4.4.4 120/1 via 34.1.1.4, 00:00:22, FastEthernet0/023.0.0.0/24 is subnetted, 1 subnetsC

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 解决方案

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