CCNP试验手册BGP单人版.docx
- 文档编号:25959603
- 上传时间:2023-06-16
- 格式:DOCX
- 页数:16
- 大小:19.03KB
CCNP试验手册BGP单人版.docx
《CCNP试验手册BGP单人版.docx》由会员分享,可在线阅读,更多相关《CCNP试验手册BGP单人版.docx(16页珍藏版)》请在冰豆网上搜索。
CCNP试验手册BGP单人版
路由协议,AS(自治系统)角度来区分成:
1.IGP内部网关路由协议
RIP(路由信息协议)-----udp520端口
EIGRP(增强型内部网关路由协议)
OSPF(开放式最短路径优先路由协议)
ISIS(中间系统到中间系统路由协议)
2.EGP外部网关路由协议
BGP(边界网关路由协议)----tcp/ip卷2(人邮)
特点:
1.稳定性强
1)使用tcp协议传输,端口号179。
2)基于TLV(类型,长度,字符串)开发。
3)定期有keepalive来保持连接状态。
4)Bgp都是通过单播手动方式建立邻居关系。
2.选路比较精准
13条选路原则
3.路由的控制能力很强
丰富的命令和工具来实现路由的控制
4.维护的路由条目数量最多,internet(30万条)
Bgp的应用领域
1.运营商之间的核心设备的路由传递
2.企业和企业之间也可能采用bgp,为了实现稳定和控制
3.多宿主的企业要实现专线的负载均衡
BGP的前身叫EGP,EGP被BGP所取代的原因在于不能防环。
BGP选路也是可以看跳数(一个AS),它也是距离矢量,又叫路径向量。
在计算跳数是,路由里传递时会携带所经过的as的as号,并且详细标注是哪些as,此属性我们叫AS-path属性,此属性既可以计算跳数,又可以用来防环。
当路由器收到bgp路由里边as-path属性中,包含了自身的as号,就可以判断为环路路由,置为无效路由。
AS1-R3(config)#routerbgp1建立bgp进程,后边指定AS号,一个路由器只能配置一个bgp进程。
AS1-R1(config-router)#neighborremote-as2手动指定对方地址和as号
AS2-r3(config-router)#doshowipbgpneighbor
看established
AS1-R1(config-router)#doshowipbgpsummary
BGProuteridentifier,localASnumber1
BGPtableversionis1,mainroutingtableversion1
NeighborV版本ASMsgRcvdMsgSentTblVerInQOutQUp/DownState/PfxRcd
424410000:
00:
360(表示从邻居那学到了几条路由,0表示没学到任何路由,但邻居正常)
不同AS的路由器的邻居关系叫EBGP
相同AS的路由器的邻居关系叫IBGP
1难点:
路由黑洞:
由于中间路由器没有运行BGP,所以导致数据无法传递。
1).把bgp路由重分布到IGP路由,但用的不多,因为只能重分布少量路由。
2).全部运行BGP
3).内部运行MPLS(多协议标签交换)
邻居关系最好基于loopback接口建立,在具备多条物理线路可以实现冗余备份。
AS1-R1(config-router)#neighborremote-as1建立IBGP邻居关系
AS1-R1(config-router)#neighborupdate-sourceloopback0指定R1使用自己的lo0和对方建立邻居关系,指定和某个邻居的更新源接口
AS1-R2(config-router)#bgprouter-id配置bgp的router-id
AS1-R2(config)#intlo1
AS1-R2(config-if)#ipadd
AS1-R2(config-if)#routerbgp1
AS1-R2(config-router)#networkmask通告路由,它会准确的匹配路由表里的相应路由,然后通过bgp邻居宣告;可以宣告非自身的路由。
Bgp会有三张表
邻居表:
存储所有的邻居
Showipbgpneighbor
Showipbgpsummary
Bgp拓扑表:
存储所有的路径
Showipbgp
路由表:
最佳路径放置到路由表,又叫转发表
Showiproutebgp
AS1-R2(config-router)#doshowipbgp
BGPtableversionis2,localrouterIDis
Statuscodes:
ssuppressed,ddamped,hhistory,*valid,>best,i-internal,
rRIB-failure,SStale
Origincodes:
i-IGP,e-EGP,?
-incomplete
NetworkNextHopMetricLocPrfWeightPath
*>032768i
*010002i
*i010002i
2难点:
bgp路由的下一条不可达
1.通过IGP通告边界网段
2.修改路由的下一跳为自身,改成可达的下一跳。
AS1-R1(config-router)#routerbgp1
AS1-R1(config-router)#neinext-hop-self修改传递路由的下一跳自身
AS1-R3(config)#routerbgp1
AS1-R3(config-router)#neinext-hop-self修改传递路由的下一跳自身
3难点:
bgp的水平分割,bgp的路由器不会把从ibgp邻居学到的路由再传递给另外一个ibgp邻居。
1.full-mesh(全互联)的ibgp邻居关系
2.路由反射器,可以把hub路由器作为一个反射器,把从ibgp邻居学到的最好的路由反射给另外一个ibgp邻居。
AS1-R2(config-router)#neiroute-reflector-client
AS1-R2(config-router)#neiroute-reflector-client
3.联盟
Showipbgp
NetworkNextHopMetricLocPrfWeightPath
*>032768i
*010002i(起源属性)
*i010002i
Aspath属性后边的表示起源属性,表示此路由怎么出现的,可以是bgp通告i,也可以是egp通告e,也可以其他路由协议重分布到bgp?
。
i>e>?
EBGP管理距离20
IBGP管理距离200
MED多出口离开属性:
可以影响自身AS和邻居AS(对比前提需要多条路径通过的as是一致的,否则不会对比此属性)。
LocalPRF本地优先权:
可以影响本AS。
Weight权重:
只能影响自身。
•Permit850
任何包含850的字符串(850,6850,…)的as-path
•Permit_850$起源于850的路由as-path
•Permit^850$
只能包含唯一的850字符串的as-path
•Permit^$
一个空的as-path,表示只能通告本as始发的bgp路由
•Permit.*
表示任何字符串,permitany
Router(config)#ipas-pathaccess-list10permit_65020$
Router(config)#route-mapfrom65020permit1
Router(config-route-map)#matchas-path10
Router(config-route-map)#setweight10
Router(config-route-map)#exit
Router(config)#route-mapfrom65020permit2
Router(config-route-map)#routerbgp1
Router(config-router)#neiroute-mapfrom65020in
第一步:
初始配置
Router(config)#hostnameAS1-r1(根据路由器适当调整)
AS1-r1(config)#noipdomain-lookup
AS1-r1(config)#linecon0
AS1-r1(config-line)#noexec-timeout
AS1-r1(config-line)#loggsy
第二步:
地址配置
AS1-r1(config)#intlo0
AS1-r1(config-if)#ipadd
AS1-r1(config-if)#ipospfnetworkpoint-to-point
AS1-r1(config-if)#ints1/1
AS1-r1(config-if)#ipadd
AS1-r1(config-if)#noshu
AS1-r1(config-if)#intf0/0
AS1-r1(config-if)#ipadd
AS1-r1(config-if)#noshu
AS1-r2(config)#intlo0
AS1-r2(config-if)#ipadd
AS1-r2(config-if)#ipospfnetworkpoint-to-point
AS1-r2(config-if)#ints1/0
AS1-r2(config-if)#ipadd
AS1-r2(config-if)#noshu
AS1-r2(config-if)#ints1/1
AS1-r2(config-if)#ipadd
AS1-r2(config-if)#noshu
AS1-r3(config)#intlo0
AS1-r3(config-if)#ipadd
AS1-r3(config-if)#ipospfnetworkpoint-to-point
AS1-r3(config-if)#ints1/0
AS1-r3(config-if)#ipadd
AS1-r3(config-if)#noshu
AS1-r3(config-if)#intf0/0
AS1-r3(config-if)#ipadd
AS1-r3(config-if)#noshu
AS2-r1(config)#intlo0
AS2-r1(config-if)#ipadd
AS2-r1(config-if)#ipospfnetworkpoint-to-point
AS2-r1(config-if)#ints1/1
AS2-r1(config-if)#ipadd
AS2-r1(config-if)#noshu
AS2-r1(config-if)#intf0/0
AS2-r1(config-if)#ipadd
AS2-r1(config-if)#noshu
AS2-r2(config)#intlo0
AS2-r2(config-if)#ipadd
AS2-r2(config-if)#ipospfnetworkpoint-to-point
AS2-r2(config-if)#ints1/0
AS2-r2(config-if)#ipadd
AS2-r2(config-if)#noshu
AS2-r2(config-if)#ints1/1
AS2-r2(config-if)#ipadd
AS2-r2(config-if)#noshu
AS2-r3(config)#intlo0
AS2-r3(config-if)#ipadd
AS2-r3(config-if)#ipospfnetworkpoint-to-point
AS2-r3(config-if)#ints1/0
AS2-r3(config-if)#ipadd
AS2-r3(config-if)#noshu
AS2-r3(config-if)#intf0/0
AS2-r3(config-if)#ipadd
AS2-r3(config-if)#noshu
第三步:
配置IGP---OSPF
AS1-r1(config)#routerospf1
AS1-r1(config-router)#netarea0
AS1-r1(config-router)#netarea0
AS1-r2(config-if)#routerospf1
AS1-r2(config-router)#netarea0
AS1-r2(config-router)#netarea0
AS1-r3(config-if)#routerospf1
AS1-r3(config-router)#netarea0
AS1-r3(config-router)#netarea0
AS2-r1(config-if)#routerospf1
AS2-r1(config-router)#netarea0
AS2-r1(config-router)#netarea0
AS2-r2(config-if)#routerospf1
AS2-r2(config-router)#netarea0
AS2-r2(config-router)#netarea0
AS2-r3(config-if)#routerospf1
AS2-r3(config-router)#netarea0
AS2-r3(config-router)#netarea0
第三步:
配置BGP
3.1建立BGP邻居
建立EBGP邻居
AS1-r1(config)#routerbgp1
AS1-r1(config-router)#neighborremote-as2
AS2-r1(config-router)#routerbgp2
AS2-r1(config-router)#neiremote-as1
AS2-r3(config-router)#routerbgp2
AS2-r3(config-router)#neighborremote-as1
AS1-r3(config-router)#routerbgp1
AS1-r3(config-router)#neighborremote-as2
察看邻居关系
*Apr2220:
38:
54.155:
%BGP-5-ADJCHANGE:
neighborUp
AS2-r1(config-router)#doshipbgpsummary
BGProuteridentifier,localASnumber2
BGPtableversionis1,mainroutingtableversion1
NeighborVASMsgRcvdMsgSentTblVerInQOutQUp/DownState/PfxRcd
414410000:
00:
580
AS2-r1(config-router)#doshipbgpnei
BGPneighboris,remoteAS1,externallink
BGPversion4,remoterouterID
BGPstate=Established,upfor00:
02:
15
建立IBGP邻居
AS1-r3(config-router)#routerbgp1
AS1-r3(config-router)#neighborremote-as2
AS2-r3(config-router)#routerbgp2
AS2-r3(config-router)#neighborremote-as1
AS1-r2(config-router)#routerbgp1
AS1-r1(config-router)#neighborremote-as1
AS1-r1(config-router)#neighborupdate-sourceloopback0
AS1-r2(config-router)#routerbgp1
AS1-r2(config-router)#neighborremote-as1
AS1-r2(config-router)#neighborupdate-sourceloopback0
AS1-r2(config-router)#neighborremote-as1
AS1-r2(config-router)#neighborupdate-sourceloopback0
AS1-r3(config)#routerbgp1
AS1-r3(config-router)#neighborremote-as1
AS1-r3(config-router)#neighborupdate-sourceloopback0
AS2-r1(config)#routerbgp2
AS2-r1(config-router)#neighborremote-as2
AS2-r1(config-router)#neighborupdate-sourceloopback0
AS2-r2(config)#routerbgp2
AS2-r2(config-router)#neighborremote-as2
AS2-r2(config-router)#neighborupdate-sourceloopback0
AS2-r2(config-router)#neighborremote-as2
AS2-r2(config-router)#neighborupdate-sourceloopback0
AS2-r3(config-router)#routerbgp2
AS2-r3(config-router)#neiremote-as2
AS2-r3(config-router)#neiupdate-sourceloopback0
第四步:
通告路由
AS1-r2(config)#intlo1
AS1-r2(config-if)#ipadd
AS1-r2(config-if)#routerbgp1
AS1-r2(config-router)#networkmask
AS2-r2(config)#intlo1
AS2-r2(config-if)#ipadd
AS2-r2(config)#routerbgp2
AS2-r2(config-router)#netmask
在r2上发现路由下一跳不可达问题
AS1-r2#shipbgp
BGPtableversionis2,localrouterIDis
Statuscodes:
ssuppressed,ddamped,hhistory,*valid,>best,i-internal,
rRIB-failure,SStale
Origincodes:
i-IGP,e-EGP,?
-incomplete
NetworkNextHopMetricLocPrfWeightPath
*>032768i
*010002i
*i010002i
解决方案一:
重分布边界网络
AS1-r3(config)#routerospf1
AS1-r3(config-router)#redistributeconnectedsubnets
AS2-r3(config)#routerospf1
AS2-r3(config-router)#redistributeconnectedsubnets
AS1-r2#shipbgp
BGPtableversionis3,localrouterIDis
Statuscodes:
ssuppressed,ddamped,hhistory,*valid,>best,i-internal,
rRIB-failure,SStale
Origincodes:
i-IGP,e-EGP,?
-incomplete
NetworkNextHopMetricLocPrfWeightPath
*>032768i
*>010002i
*i010002i
解决方案2:
修改下一跳为自身
AS1-r1(config)#routerbgp1
AS1-r1(config-router)#neighbornext-hop-self
AS2-r1(config)#routerbgp2
AS2-r1(config-router)#neighbornext-hop-self
AS1-r2#shipbgp
BGPtableversionis3,localrouterIDis
Statuscodes:
ssuppressed,ddamped,hhistory,*valid,>best,i-internal,
rRIB-failure,SStale
Origincodes:
i-IGP,e-EGP,?
-incomplete
NetworkNextHopMetricLocPrfWeightPath
*>032768i
*>010002i
*i010002i
但是在R1和R3上还是只能看到,由于BGP路由在AS内部传递的时候不会修改AS-path属性,所以无法防止环路,那么BGP路由器水平分割就是不会把从IBGP对等体学习到的路由传递给另外一个IBGP对等体.
AS1-r1#shipbgp
BGPtableversionis7,localrouterIDis
Statuscodes:
ssuppressed,ddamped,hhistory,*valid,>best,i-internal,
rRIB-failure,SStale
Origincodes:
i-IGP,e-EGP,?
-incomplete
NetworkNextHopMetricLocPrfWeightPath
*>01000i
*>02i
AS1-r1#shipbgp
BGPtableversionis7,localrouterIDis
Statuscodes:
ssuppressed,ddamped,hhistory,*valid,>best,i-internal,
rRIB-failur
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- CCNP 试验 手册 BGP 单人