0
点赞
收藏
分享

微信扫一扫

【实验分享】BGP消息类型实验

实验目的:

l掌握BGP的运行原理

l对BGP建立会话错误排查

实验说明:

l通过此实验练习,可以更好的掌握BGP运行方式

实验环境:

l两台支持SPSERVICES的IOS的路由器

l直通线

实验拓扑:

【实验分享】BGP消息类型实验_源地址


实验步骤:

R1(config)#interface f0/0

R1(config-if)#ip address 12.1.1.1 255.255.255.0

R1(config-if)#no shutdown

R1(config-if)#router bgp 100

R1(config-router)#bgp router-id 1.1.1.1{建议手动指定router-id}

R1(config-router)#neighbor 12.1.1.2 remote-as 200

R2(config)#interface f0/0

R2(config-if)#ip address 12.1.1.2 255.255.255.0

R2(config-if)#no shutdown

R2(config)#router bgp 200

R2(config-router)#bgp router-id 2.2.2.2

R2(config-router)#neighbor 12.1.1.1 remote-as 100

验证:

【实验分享】BGP消息类型实验_源地址_02

【实验分享】BGP消息类型实验_路由表_03

【实验分享】BGP消息类型实验_源地址_04


通过上述可以看出12.1.1.2以TCP随机端口发送给12.1.1.1 TCP179端口,因此是12.1.1.2主动建立了BGP的会话。{R1和R2都可以主动发起会话,最终会协商出一个主动发起者}

R2#show tcp brief 

TCB Local Address               Foreign Address             (state)

66E5610C 12.1.1.2.13149              12.1.1.1.179                ESTAB

R2#show ip bgp summary 

BGP router identifier 2.2.2.2, local AS number 200

BGP table version is 1, main routing table version 1

Neighbor   V  AS MsgRcvd MsgSent TblVer  InQ OutQ Up/Down 

{对端的邻居描述\运行BGP的版本号\对端邻居所处的AS号\建立的时间}

State/PfxRcd{如果状态有Active,说明邻居建立有问题\从这个邻居学到了多少条路由}

12.1.1.1 4  100   17   17     1    0    0 00:15:17        0

实验步骤:

宣告一条路由

R1(config)#interface lo 0

R1(config-if)#ip address 1.1.1.1 255.255.255.255

R1(config)#router bgp 100

R1(config-router)#network 1.1.1.1 mask 255.255.255.255

{默认BGP宣告的是路由表的路由,除非开启auto-summary}

验证:

【实验分享】BGP消息类型实验_ide_05

【实验分享】BGP消息类型实验_ide_06

R2#show ip bgp

Network Next Hop            Metric LocPrf Weight Path

*> 1.1.1.1/32    12.1.1.1                 0             0 100 i

{说明此路由是最优的,并且能放如路由表\下一跳去往谁\通过Update数据报携带的med值为0\通过AS100区域获得\通过IGP获得}


实验步骤:

故意配置BGP错误

R1(config-router)#neighbor 12.1.1.2 remote-as 100

验证:

【实验分享】BGP消息类型实验_路由表_07

【实验分享】BGP消息类型实验_ccie_08


BGP常见错误情况:

情况1,邻居没有到达此路由器产生的BGP数据包源地址的路由条目或者认证失败

R1(config)#interface f0/0

R1(config-if)#shutdown

验证:

R2#show ip bgp summary 

Neighbor V  AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.1 4  100   170     171        0    0    0 00:00:10

Active{此时状态为Active}

情况2,邻居的对等体配置了错误的IP地址.

R1(config-router)#neighbor 12.1.1.22 remote-as 200

验证:

R2#show ip bgp summary{此时状态会Idle和active互相切换}

Neighbor V  AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.1 4  100     170     171        0    0    0 00:04:38 

Idle

R2#show ip bgp summary

Neighbor V   AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  

State/PfxRcd

12.1.1.1 4  100     170     171        0    0    0 00:04:42 

Active

情况3,邻居没有通过neighbor语句配置此邻居

R1(config-router)#no neighbor 12.1.1.2 remote-as 200

验证:

R2#show ip bgp summary 

BGP router identifier 2.2.2.2, local AS number 200

BGP table version is 1, main routing table version 1

Neighbor V   AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.1 4  100   170     171      0    0    0 00:08:06 

Active{产生active}

情况4,AS号码不匹配

R1(config-router)#neighbor 12.1.1.2 remote-as 300

验证

R2#show ip bgp summary

Neighbor V     AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.1 4     100   280    281     0    0    0 00:12:04 

Idle{出现Idle}

*Sep 27 11:52:54.123: %BGP-3-NOTIFICATION: received from neighbor 12.1.1.1 2/2 (peer in wrong AS) 2 bytes 00C8{Log提示AS错误}

举报

相关推荐

BGP实验

BGp实验

BGP小实验

实验四、BGP

BGP配置实验

BGP简单实验

BGP进阶实验

简单BGP实验

0 条评论