BGP实验手册.docx
- 文档编号:5804230
- 上传时间:2023-01-01
- 格式:DOCX
- 页数:59
- 大小:1.22MB
BGP实验手册.docx
《BGP实验手册.docx》由会员分享,可在线阅读,更多相关《BGP实验手册.docx(59页珍藏版)》请在冰豆网上搜索。
BGP实验手册
Lab1.
ConfiguringBasicBGP
实验目的:
1、掌握BGP的基本配置方法。
2、掌握如何查看BGP的各种配置信息。
实验拓扑图:
实验步骤及要求:
1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。
2、在R1、R2和R3配置BGP路由协议,具体配置如下:
R1(config)#routerbgp64512
R1(config-router)#neighbor172.16.255.2remote-as64512
R1(config-router)#
R1(config-router)#network172.16.255.0mask255.255.255.252
R1(config-router)#network172.16.0.0mask255.255.255.0
R1(config-router)#network172.16.1.0mask255.255.255.0
R1(config-router)#network172.16.2.0mask255.255.255.0
R1(config-router)#network172.16.3.0mask255.255.255.0
R1(config-router)#exit
R1(config)#
R2(config)#routerbgp64512
R2(config-router)#neighbor172.16.255.1remote-as64512
R2(config-router)#neighbor10.1.255.2remote-as64513
R2(config-router)#
R2(config-router)#network172.16.255.0mask255.255.255.252
R2(config-router)#network10.1.255.0mask255.255.255.252
R2(config-router)#exit
R2(config)#exit
R2#
R3(config)#routerbgp64513
R3(config-router)#neighbor10.1.255.1remote-as64512
R3(config-router)#
R3(config-router)#network10.1.255.0mask255.255.255.252
R3(config-router)#network192.168.0.0
R3(config-router)#network192.168.1.0
R3(config-router)#network192.168.2.0
R3(config-router)#network192.168.3.0
R3(config-router)#exit
R3(config)#
3、查看BGP的邻居关系:
R1#showipbgpneighbors
BGPneighboris172.16.255.2,remoteAS64512,internallink
BGPversion4,remoterouterID172.16.255.2
BGPstate=Established,upfor00:
29:
25
Lastread00:
00:
24,holdtimeis180,keepaliveintervalis60seconds
Neighborcapabilities:
Routerefresh:
advertisedandreceived(old&new)
AddressfamilyIPv4Unicast:
advertisedandreceived
Messagestatistics:
InQdepthis0
OutQdepthis0
SentRcvd
Opens:
11
Notifications:
00
Updates:
14
Keepalives:
3232
RouteRefresh:
00
Total:
3437
Defaultminimumtimebetweenadvertisementrunsis5seconds
…………
4、查看简洁BGP汇总信息:
R2#showipbgpsummary
BGProuteridentifier172.16.255.2,localASnumber64512
BGPtableversionis19,mainroutingtableversion19
10networkentriesusing1010bytesofmemory
11pathentriesusing528bytesofmemory
3BGPpathattributeentriesusing180bytesofmemory
1BGPAS-PATHentriesusing24bytesofmemory
0BGProute-mapcacheentriesusing0bytesofmemory
0BGPfilter-listcacheentriesusing0bytesofmemory
BGPusing1742totalbytesofmemory
BGPactivity14/4prefixes,16/5paths,scaninterval60secs
NeighborVASMsgRcvdMsgSentTblVerInQOutQUp/DownState/PfxRcd
10.1.255.24645134749190000:
10:
155
172.16.255.14645124245190000:
37:
534
R2#
5、查看R1的路由表:
R1#showiproute
Gatewayoflastresortisnotset
172.16.0.0/16isvariablysubnetted,5subnets,2masks
C172.16.255.0/30isdirectlyconnected,FastEthernet0/0
C172.16.0.0/24isdirectlyconnected,Loopback0
C172.16.1.0/24isdirectlyconnected,Loopback0
C172.16.2.0/24isdirectlyconnected,Loopback0
C172.16.3.0/24isdirectlyconnected,Loopback0
10.0.0.0/30issubnetted,1subnets
B10.1.255.0[200/0]via172.16.255.2,00:
48:
22
B192.168.0.0/24[200/0]via10.1.255.2,00:
22:
27
B192.168.1.0/24[200/0]via10.1.255.2,00:
22:
27
B192.168.2.0/24[200/0]via10.1.255.2,00:
22:
27
B192.168.3.0/24[200/0]via10.1.255.2,00:
22:
27
R1#
6、另外一些命令:
R1#clearipbgp*
R1#clearipbgp172.16.255.2
R1#clearipbgp*soft
7、实验完成。
Lab2.
ConfiguringBGPUsingLoopbackAddresses
实验目的:
1、掌握基于回环口的BGP的邻居关系建立的配置方法。
2、理解需要使用回环口为目的。
实验拓扑图:
实验步骤及要求:
1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。
2、配置AS64512自治系统的RIPv2路由协议。
R1(config)#routerrip
R1(config-router)#network172.16.0.0
R1(config-router)#version2
R1(config-router)#noauto-summary
R1(config-router)#exit
R2(config)#routerrip
R2(config-router)#noauto-summary
R2(config-router)#version2
R2(config-router)#network172.16.0.0
R2(config-router)#exit
3、首先在R1和R2上使用回环口创建邻居关系,配置如下:
R1(config)#routerbgp64512
R1(config-router)#network172.16.0.0mask255.255.255.0
R1(config-router)#network172.16.1.0mask255.255.255.0
R1(config-router)#neighbor172.16.16.1remote-as64512
R1(config-router)#exit
R2(config)#routerbgp64512
R2(config-router)#network172.16.255.0mask255.255.255.252
R2(config-router)#network10.1.255.0mask255.255.255.252
R2(config-router)#
R2(config-router)#neighbor172.16.0.1remote-as64512
R2(config-router)#exit
4、由于BGP在创建对等体时,需要时间较长。
所以,需要等待一段时间。
然后再查看R1和R2的BGPSummary信息。
R1#showipbgpsummary
NeighborVASMsgRcvdMsgSentTblVerInQOutQUp/DownState/PfxRcd
172.16.16.146451200000neverActive
R1#
R2#showipbgpsummary
NeighborVASMsgRcvdMsgSentTblVerInQOutQUp/DownState/PfxRcd
172.16.0.146451200000neverActive
R2#
5、在R1路由器开启对BGP的调试:
R1#debugipbgpin
*Mar3011:
42:
34.607:
BGP:
172.16.16.1multihopopendelayed19731ms(noroute)
*Mar3011:
42:
54.339:
BGP:
172.16.16.1multihopopendelayed17735ms(noroute)
*Mar3011:
43:
12.075:
BGP:
172.16.16.1multihopopendelayed17459ms(noroute)
*Mar3011:
43:
29.535:
BGP:
172.16.16.1multihopopendelayed14687ms(noroute)
6、由于R1和R2是同一个自治系统,所以我们使用RIPv2协议来解决路由不可达的问题,同时还要在BGP协议中指出使用回环口配置邻居关系,具体配置如下:
R1(config)#routerrip
R1(config-router)#version2
R1(config-router)#noauto-summary
R1(config-router)#
R1(config-router)#network172.16.0.0
R1(config-router)#exit
R1(config)#
R1(config)#routerbgp64512
R1(config-router)#neighbor172.16.16.1update-sourceloopback0
R1(config-router)#exit
R2(config)#routerrip
R2(config-router)#version2
R2(config-router)#noauto-summary
R2(config-router)#network172.16.0.0
R2(config-router)#exit
R2(config)#
R2(config)#routerbgp64512
R2(config-router)#neighbor172.16.0.1update-sourceloopback0
R2(config-router)#exit
7、稍等片刻或是直接clearipbgp*后,再次查看R1的BGPsummary信息:
R1#shipbgpsummary
NeighborVASMsgRcvdMsgSentTblVerInQOutQUp/DownState/PfxRcd
172.16.16.14645125560000:
00:
202
R1#
8、再次配置R2与R3使用回环口创建eBGP邻居关系:
R2(config)#routerbgp64512
R2(config-router)#neighbor192.168.0.1remote-as64513
R2(config-router)#neighbor192.168.0.1update-sourceloopback0
R2(config-router)#neighbor192.168.0.1ebgp-multihop2
R2(config-router)#exit
R2(config)#iproute192.168.0.1255.255.255.25510.1.255.2
R3(config)#routerbgp64513
R3(config-router)#neighbor172.16.16.1remote-as64512
R3(config-router)#neighbor172.16.16.1update-sourceloopback0
R3(config-router)#neighbor172.16.16.1ebgp-multihop2
R3(config-router)#
R3(config-router)#network192.168.0.0
R3(config-router)#network192.168.1.0
R3(config-router)#network10.1.255.0mask255.255.255.252
R3(config-router)#exit
R3(config)#iproute172.16.16.1255.255.255.25510.1.255.1
9、在R2上观察BGP的邻居关系状态:
R2#showipbgpsummary
NeighborVASMsgRcvdMsgSentTblVerInQOutQUp/DownState/PfxRcd
172.16.0.1464512192090000:
14:
112
192.168.0.14645135690000:
00:
103
R2#
10、实验完成。
Lab3.
UnderstandBGPAuto-Summary
实验目的:
1、理解BGP的自动汇总特性。
实验拓扑图:
实验步骤及要求:
1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。
2、首先配置各路由器的邻居关系,并通过相关命令确认邻居关系的状态。
配置如下:
R1(config)#routerbgp64512
R1(config-router)#neighbor172.16.255.2remote-as64512
R1(config-router)#exit
R2(config)#routerbgp64512
R2(config-router)#neighbor172.16.255.1remote-as64512
R2(config-router)#neighbor10.1.255.2remote-as64513
R2(config-router)#exit
R3(config)#routerbgp64513
R3(config-router)#neighbor10.1.255.1remote-as64512
R3(config-router)#exit
9、在R2上观察BGP的邻居关系状态:
R2#shipbgpsummary
BGProuteridentifier172.16.16.1,localASnumber64512
BGPtableversionis1,mainroutingtableversion1
NeighborVASMsgRcvdMsgSentTblVerInQOutQUp/DownState/PfxRcd
10.1.255.24645135510000:
01:
010
172.16.255.14645125510000:
01:
460
R2#
4、查看R1的BGP的协议属性:
R1#showipprotocols
RoutingProtocolis"bgp64512"
Outgoingupdatefilterlistforallinterfacesisnotset
Incomingupdatefilterlistforallinterfacesisnotset
IGPsynchronizationisdisabled
Automaticroutesummarizationisdisabled
Neighbor(s):
AddressFiltInFiltOutDistInDistOutWeightRouteMap
172.16.255.2
Maximumpath:
1
RoutingInformationSources:
GatewayDistanceLastUpdate
Distance:
external20internal200local200
R1#
5、在R1作如下配置:
R1(config)#routerbgp64512
R1(config-router)#network172.16.0.0
R1(config-router)#exit
6、在R2上使用clearipbgp*soft命令,加快BGP的收敛后,查看R2的路由表和summary信息:
R2#showipbgpsummary
BGProuteridentifier172.16.16.1,localASnumber64512
BGPtableversionis1,mainroutingtableversion1
NeighborVASMsgRcvdMsgSentTblVerInQOutQUp/DownState/PfxRcd
10.1.255.2464513121210000:
08:
290
172.16.255.1464512131310000:
09:
140
R2#
R2#showiproute
Gatewayoflastresortisnotset
172.16.0.0/16isvariablysubnetted,2subnets,2masks
C172.16.255.0/30isdirectlyconnected,FastEthernet0/0
C172.16.16.0/24isdirectlyconnected,Loopback0
10.0.0.0/30issubnetted,1subnets
C10.1.255.0isdirectlyconnected,Serial1/1
R2#
7、问题分析:
BGP协议在将某路由通告给自己的邻居对等体时,会检查路由是否同步和本地路由表中是否已经存在此条路由。
本实验中R2没有学习到R1的路由的主要问题并不是同步,而是R1的路由表中没有关于172.16.0.0/16子网的路由。
8、在R1上查看BGP对172.16.0.0/16网络路由描述:
R1#showipbgp172.16.0.0
%Networknotintable
R1#
9、在R1作如下配置:
R1(config)#routerbgp64512
R1(config-router)#auto-summary
R1(config-router)#exit
R1(config)#exit
10、再次查看R2路由表:
R2#showiproute
Gatewayoflastresortisnotset
172.16.0.0/16isvariablysubnetted,3subnets,3masks
C172.16.255.0/30isdirectlyconnected,FastEthernet0/0
C172.16.16.0/24isdirectlyconnected,Loopback0
B172.16.0.0/16[200/0]via172.16.255.1,00:
01:
23
10.0.0.0/30issubnetted,1subnets
C10.1.255.0isdirectlyconnected,Serial1/1
R2#
R2#showipbgpsummary
NeighborVASMsgRcvdMsgSentTblVerInQOutQUp/DownState/PfxRcd
10.1.255.2464
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- BGP 实验 手册