router3 BGP1 基础部分
生活随笔
收集整理的這篇文章主要介紹了
router3 BGP1 基础部分
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
1、AS--自治系統 由同1個管理組織一組路由器,有相同策略 0-65535 公有AS:1-64511 私有AS:64512-65535=1024 route-views.routeviews.org 2、為什么使用BGP 1)承載大量路由---37W(增長中....2011年04月07日) 2)路由策略 實際使用:MAN多個出口 ????????? MPLS×××?? ? 3、什么時候不使用BGP 1)設備資源不足:2G 2)不是很懂BGP 3)單出口 4、 BGP特點: 1)BGP是屬于EGP、無類、DV路由協議 不同AS之間使用---->EGP 2)BGP是一個路徑vector路由協議 AS-BY-AS而不是hop-by-hop 3)可靠更新:工作在TCP=179端口上 4)BGP采用增量、觸發更新 5)周期性keepalive檢驗tcp連接 6)有豐富屬性-->控制路由選擇 5、BGP三張表 1)鄰居表 sh ip bgp summary? sh ip bgp neighbor 2)BGP數據庫 列出BGP所有的路由條目(包含最佳和次佳) sh ip bgp *> 3)路由表 把BGP表中最佳的路徑放到轉發表中 sh ip route bgp 6、BGP數據包結構 1)open +keepalive=hello routerid?holdtime 2)keepalive?只有頭部大小=19byte 60sec?holdtime=180sec 3)update: 最佳路由=網絡號+mask+屬性 *> 4)notification 發現有錯誤,報警,撤除TCP連接 7、BGP鄰居 1)IBGP (1)同1個AS形成的鄰居 (2)條件:只要可達 (3)過程:建鄰居--->建立TCP連接---->發包---->查找IGP路由 (4)IBGP通常使用loopback建立鄰居 2)EBGP (1)不同AS形成的鄰居 (2)條件:直連 (3)通常是使用物理接口建立鄰居 8、BGP路由傳遞 1)控制層面 AS-BY-AS 2)數據層面 hop-by-hop 黑洞:(1)重發布BGP---->IGP 擴展性問題 ?????? (2)full-mesh IBGP鄰居--->鄰居關系多 ?????? (3)RR/聯邦 ?????? (4)MPLS 9、BGP基本配置 1) R4(config-if)#router bgp 4 R4(config-router)#nei 24.1.1.2 remote-as 123 R2(config-router)#router bgp 123 R2(config-router)#nei 24.1.1.4 remote-as 4 R2(config-router)#nei 3.3.3.3 remote-as 123 R3(config-router)#router bgp 123 R3(config-router)#bgp router-id 3.3.3.3 R3(config-router)#nei 2.2.2.2 remote-as 123 R3(config-router)#nei 35.1.1.5 remote-as 5 R5(config-router)#bgp router-id 35.1.1.3????????????? R5(config-router)#nei 35.1.1.3 remote-as 123 2)更新源 R3(config-router)#nei 2.2.2.2 update-source lo0 R2(config-router)#nei 3.3.3.3 update-source lo0 R3(config-router)#do sh ip bgp sum BGP router identifier 3.3.3.3, local AS number 123 BGP table version is 1, main routing table version 1 Neighbor??????? V??? AS MsgRcvd MsgSent?? TblVer?InQ OutQ Up/Down? State/PfxRcd 2.2.2.2???????? 4?? 123?????? 4?????? 4??????? 1??? 0??? 0 00:00:11??????? 0 35.1.1.5??????? 4???? 5?????? 9?????? 9??????? 1??? 0??? 0 00:05:46??????? 0 3)發布網絡 R4(config-router)#network 4.4.4.0 mask 255.255.255.0 被發布的網絡必須跟路由表嚴格匹配 R5(config-router)#net 5.5.5.0 mask 255.255.255.0 R2(config-router)#do sh ip bgp ?* valid, > best, ?? Network????????? Next Hop??????????? Metric LocPrf Weight Path *> 4.4.4.0/24?????? 24.1.1.4???????????????? 0???????????? 0 4 i * i5.5.5.0/24?????? 35.1.1.5???????????????? 0??? 100????? 0 5 i *> 表示可以發布給其它R、可以放進路由表 4)next-hop-self R3(config-router)#neighbor 2.2.2.2 next-hop-self R2(config-router)#nei 3.3.3.3 next-hop-self 5)解決數據黑洞---full mesh ibgp R1(config-router)#router bgp 123 R1(config-router)#bgp router-id 1.1.1.1 R1(config-router)#nei 2.2.2.2 remote-as 123 R1(config-router)#nei 2.2.2.2 update-source lo0 R1(config-router)#nei 3.3.3.3 remote-as 123 R1(config-router)#nei 3.3.3.3 update-source lo0 R2(config-router)#nei 1.1.1.1 remote-as 123 R2(config-router)#nei 1.1.1.1 update-source lo0 R2(config-router)#nei 1.1.1.1 next-hop-s R3(config-router)#nei 1.1.1.1 remote-as 123 R3(config-router)#nei 1.1.1.1 update-source lo 0 R3(config-router)#nei 1.1.1.1 next-hop-s sh ip bgp summ ----查看鄰居 sh ip bgp查看BGP 數據庫 sh ip route bgp查看BGP 路由 clear ip bgp *硬清除 1、BGP下1跳行為 1)路由往IBGP鄰居通告下1跳不變 2)路由往EBGP鄰居通告下1跳是當前R 3)next-hop-self 4)MA環境中的下一跳(重定向) R1(config-router)#router bgp 13 R1(config-router)#bgp router-id 1.1.1.1 R1(config-router)#nei 12.1.1.2 remote-as 2 R1(config-router)#nei 3.3.3.3 remote-as 13 R1(config-router)#nei 3.3.3.3 upda?? lo0?? R1(config-router)#nei 3.3.3.3 next-hop-self R2(config-if)#router bgp 2 R2(config-router)#nei 12.1.1.1 remote-as 13 R2(config-router)#net 2.2.2.0 mask 255.255.255.0 R3(config-router)#router bgp 13 R3(config-router)#nei 1.1.1.1 remote-as 13 R3(config-router)#nei 1.1.1.1 up lo 0???? R3(config-router)#nei 134.1.1.4 remote-as 4 R4(config-if)#router bgp 4 R4(config-router)#nei 134.1.1.3 remote-as 13 R4(config-router)#do sh ip bgp??? ?? Network????????? Next Hop??????????? Metric LocPrf Weight Path *> 2.2.2.0/24?????? 134.1.1.1????????????????????????????? 0 13 2 i debug ip bgp update 2、peer-group 1)有相同路由策略1組路由器a 2)作用:簡化配置、節省資源 3)配置 (1)創建peer-group (2)把peer放到peer-group中去 3、同步 1)BGP路由和IGP路由的同步 2)同步作用:防止黑洞在發送路由給EBGP鄰居之前首先保證IGP有這條路由 12.2(8)T默認都是關閉 3) router bgp 13 ?no synchronization 4、BGP狀態 1)idle:查找路由表 2)connect:TCP連接已經成功建立 3)open sent:已發送open,等待對方的open 4)open confirm:收到對方open,發送keepalive,等待對方的keepalive 5)established:成功接收keepalive 停在idle:沒有鄰居的路由 停在active: (1)鄰居沒有我的路由 (2)鄰居配錯鄰居IP (3)鄰居沒有配置 (4)AS配置錯誤 debug ip bgp 5、BGP認證 1)MD5 2) R1(config-router)#neighbor 12.1.1.2 password chuyue100 R2(config-router)#neighbor 12.1.1.1 password chuyue100 6、sh ip bgp rib-failure r>i3.3.3.0/24?????? 3.3.3.3????????????????? 0??? 100????? 0 i 注意:此路由依然可以發送給鄰居,因為是最佳 7、BGP會話清除 1)硬清 clear ip bgp * 把BGP會話及TCP連接都清除 2)軟清 TCP連接不清除 clear ip bgp * soft 3) R1#sh ip bgp neighbor 12.1.1.2 advertised-routes R2#sh ip bgp neighbor 12.1.1.1 received-routes R2(config-router)#nei 12.1.1.1 soft-reconfiguration inbound 把從這個鄰居收到路由放到一個獨立內存空間 8、匯總 1)自動 R2(config)#int lo 1 R2(config-if)#ip add 2.2.1.2 255.255.255.0 R2(config-if)#router?bgp 2 R2(config-router)#redistribute connected *> 2.0.0.0????????? 12.1.1.2???????????????? 0???????????? 0 2 ? 自動匯總僅針對重發布進BGP的路由 no auto-summary -->攜帶metric auto-summary --->不攜帶metric 2)手工 (1)非專業匯總 R2(config-router)#net 2.2.1.0 mask 255.255.255.0 R2(config)#ip route 2.2.0.0 255.255.252.0 null 0 R2(config)#router bgp 2 R2(config-router)#net 2.2.0.0 mask 255.255.252.0 (2)專業匯總 R2(config-router)#aggregate-address 2.2.0.0 255.255.252.0 R2(config-router)#aggregate-address 2.2.0.0 255.255.252.0 summary-only ?//抑制細化路由 ????????????????? aggregate-address 2.2.0.0 255.255.252.0 as-set summary-only ???????????? //匯總路由會使之前的AS-PATH 丟失,as-set可以保留轉載于:https://blog.51cto.com/nppstudy/725796
總結
以上是生活随笔為你收集整理的router3 BGP1 基础部分的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java编程好文章链接收集
- 下一篇: 几大搜索引擎的网站登录入口