设为首页收藏本站language 语言切换
查看: 2195|回复: 2
收起左侧

[求助] 求助!有关BGP的一道题!挺有意思的。。

[复制链接]
 成长值: 51260
发表于 2014-6-23 09:53:33 | 显示全部楼层 |阅读模式
3鸿鹄币
BGP拓扑.jpg
首先这是拓扑..
其他的要求先略过,只提一下我百撕不得骑姐的一个问题!
R2,R3,R5 属于AS 235, 建立两条IBGP PEER: R5 与R2 AND R5 与R3
要求建立尽可能长的TCP 连接,
R4 属于AS 64512 , 要与R5 建立一条EBGP PEER,要求:
 要求用两台路由器的LO0 建立,
 在R4 上做配置,使它与R5 建立PEER 时,指向64513
以上是大环境

题目要求如此:
在R5 上增加一个LO105, IP ADD= 105.1.1.1/24 ,把它通过NETWORK 宣告进入
OSPF 及BGP, 此路由会传到R2,R3,此时你在R2,R3 的路由表及BGP 表里都可以
看到该路由.注意路由表里看到此路由需要是:24 的子网掩码. 要求:
 R3 上不可以使用NO SYN 指令,
在R3 的BGP 表中,应看到此路由应是最优路由,
此解决方案只能在R5 上实施.

然后问题就来了。。先贴一下R2、R3和R5的配置
R2(config-router)#do s run | se router
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
area 1 virtual-link 4.4.4.4
network 1.1.123.0 0.0.0.255 area 2
network 1.1.234.0 0.0.0.255 area 1
network 2.2.2.2 0.0.0.0 area 1
router bgp 235
synchronization
bgp router-id 2.2.2.2
bgp log-neighbor-changes
neighbor 5.5.5.5 remote-as 235
neighbor 5.5.5.5 update-source Loopback0
neighbor 5.5.5.5 next-hop-self
no auto-summary
这是R2的

R3(config-router)#do s run | se router
router ospf 1
router-id 3.3.3.3
log-adjacency-changes
network 1.1.123.0 0.0.0.255 area 2
network 1.1.234.0 0.0.0.255 area 1
network 3.3.3.3 0.0.0.0 area 2
router bgp 235
synchronization
bgp router-id 3.3.3.3
bgp log-neighbor-changes
neighbor 5.5.5.5 remote-as 235
neighbor 5.5.5.5 update-source Loopback0
neighbor 5.5.5.5 next-hop-self
no auto-summary
这是R3的

R5(config-router)#do s run | se router  
router ospf 1
log-adjacency-changes
network 1.1.45.0 0.0.0.255 area 0
network 5.5.5.5 0.0.0.0 area 0
network 105.1.1.0 0.0.0.255 area 0
distribute-list prefix 10 in
router bgp 235
no synchronization
bgp router-id 5.5.5.5
bgp log-neighbor-changes
bgp confederation identifier 64513
network 5.5.5.0 mask 255.255.255.0
network 105.1.1.0 mask 255.255.255.0
neighbor 2.2.2.2 remote-as 235
neighbor 2.2.2.2 update-source Loopback0
neighbor 2.2.2.2 next-hop-self
neighbor 3.3.3.3 remote-as 235
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 next-hop-self
neighbor 4.4.4.4 remote-as 64512
neighbor 4.4.4.4 ebgp-multihop 2
neighbor 4.4.4.4 update-source Loopback0
no auto-summary
最后这是R5的

然后查看R2和R3的路由表
R2(config-router)#do s ip ro os
     1.0.0.0/24 is subnetted, 4 subnets
O       1.1.1.0 [110/2] via 1.1.123.1, 00:30:24, FastEthernet0/0
O       1.1.45.0 [110/128] via 1.1.234.4, 00:19:56, Serial1/0
     3.0.0.0/24 is subnetted, 1 subnets
O       3.3.3.0 [110/2] via 1.1.123.3, 00:30:24, FastEthernet0/0
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/65] via 1.1.234.4, 00:19:56, Serial1/0
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/129] via 1.1.234.4, 00:19:56, Serial1/0
     105.0.0.0/24 is subnetted, 1 subnets
O       105.1.1.0 [110/129] via 1.1.234.4, 00:19:56, Serial1/0
以上是R2路由表

R3(config-router)#do s ip ro os
     1.0.0.0/24 is subnetted, 4 subnets
O       1.1.1.0 [110/2] via 1.1.123.1, 00:01:15, FastEthernet0/0
O IA    1.1.45.0 [110/128] via 1.1.234.4, 00:01:15, Serial1/0
     2.0.0.0/24 is subnetted, 1 subnets
O       2.2.2.0 [110/65] via 1.1.234.2, 00:01:15, Serial1/0
     4.0.0.0/32 is subnetted, 1 subnets
O IA    4.4.4.4 [110/65] via 1.1.234.4, 00:01:15, Serial1/0
     5.0.0.0/32 is subnetted, 1 subnets
O IA    5.5.5.5 [110/129] via 1.1.234.4, 00:01:15, Serial1/0
     105.0.0.0/24 is subnetted, 1 subnets
O IA    105.1.1.0 [110/129] via 1.1.234.4, 00:01:15, Serial1/0
以上是R3的路由表

最后结果。。。
R2(config-router)#do s ip bgp
BGP table version is 7, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
* i5.5.5.0/24       5.5.5.5                  0    100      0 i
r>i105.1.1.0/24     5.5.5.5                  0    100      0 i

R3(config-router)#do s ip bgp
BGP table version is 3, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
* i5.5.5.0/24       5.5.5.5                  0    100      0 i
* i105.1.1.0/24     5.5.5.5                  0    100      0 i

哈哈哈,是不是很有意思。。。同样的配置却得不到同样的结果。R3去往下一跳以及105网段的路由都有,但是就是没有>

然后我在R3上做了一个这个   R3(config-router)#area 1 virtual-link 4.4.4.4
R3(config-router)#
*Mar  1 00:57:42.259: %BGP-5-ADJCHANGE: neighbor 5.5.5.5 Up
R3(config-router)#do s ip bgp
BGP table version is 4, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
* i5.5.5.0/24       5.5.5.5                  0    100      0 i
r>i105.1.1.0/24     5.5.5.5                  0    100      0 i
竟然有了!!! 谁能告诉我这是为什么。。

我感觉是我自己的配置方面有问题,但是又找不出问题来。。。而且两次实验出现两次相同的结果。。
求帮助{:soso_e109:}

最佳答案

查看完整内容

"同样的配置却得不到同样的结果",配置不一样啊: network 2.2.2.2 0.0.0.0 area 1 network 3.3.3.3 0.0.0.0 area 2 看出来了吧?这样配完,R5上可以学到2.2.2.2,却学不到3.3.3.3 所以你R3和R4建虚链路之后,R5和R3的bgp才起来。
发表于 2014-6-23 09:53:34 | 显示全部楼层
"同样的配置却得不到同样的结果",配置不一样啊:
network 2.2.2.2 0.0.0.0 area 1
network 3.3.3.3 0.0.0.0 area 2
看出来了吧?这样配完,R5上可以学到2.2.2.2,却学不到3.3.3.3
所以你R3和R4建虚链路之后,R5和R3的bgp才起来。
沙发 2014-6-23 09:53:34 回复 收起回复
回复

使用道具 举报

 成长值: 51260
发表于 2014-6-23 21:00:33 | 显示全部楼层
大叔,我仔细想了一下。。。
建立IBGP邻居需要满足的条件就是可达性,保证能建立TCP连接,能互相发送OPEN报文
R2和R4之间建立了虚链路,所以R5可以收到Area2的3.3.3.0/24的路由
同时R3也收到了Area0的路由,所以R5和R3可以建立IBGP邻居。
满足最优的条件是下一跳可达性,同步原则
R3上开启同步后,在BGP表里显示不是最优,而在关闭同步之后却显示最优。。(我有把lookback接口指定P2P模式)
但是路由表里却明明白白的写着有打O IA标记的105.1.1.0/24和5.5.5.0/24的路由!这就是我最纳闷的地方。。
我试了很多办法,好象其中就包括用物理接口建立邻居,貌似最后结果不理想

我相信你说的,问题肯定还是出在AREA2那里。。也许R3不是一个ABR这些问题就都没了对么?
等我周末有时间的时候再去确认一下这个问题。
板凳 2014-6-23 21:00:33 回复 收起回复
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-5-11 02:58 , Processed in 0.117113 second(s), 29 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表