BGP的next-hop-self问题
一直都是在自学的如有表述错误还请指正首先请大家看一张图:下面是各路由器配置
R1:
router bgp 100
no synchronization
bgp log-neighbor-changes
network 1.1.1.0 mask 255.255.255.0
network 192.168.1.0
neighbor 192.168.1.2 remote-as 200
no auto-summary
R2:
router ospf 100
log-adjacency-changes
network 2.2.2.0 0.0.0.255 area 0
network 192.168.2.0 0.0.0.255 area 0
network 192.168.3.0 0.0.0.255 area 0
!
router bgp 200
no synchronization
bgp log-neighbor-changes
network 2.2.2.0 mask 255.255.255.0
network 22.22.22.0 mask 255.255.255.0
network 192.168.1.0
neighbor 3.3.3.3 remote-as 200
neighbor 3.3.3.3 **-source Loopback0
neighbor 3.3.3.3 next-hop-self
neighbor 4.4.4.4 remote-as 200
neighbor 4.4.4.4 **-source Loopback0
neighbor 4.4.4.4 next-hop-self
neighbor 192.168.1.1 remote-as 100
no auto-summary
R3:
router ospf 100
log-adjacency-changes
network 3.3.3.0 0.0.0.255 area 0
network 192.168.2.0 0.0.0.255 area 0
network 192.168.4.0 0.0.0.255 area 0
!
router bgp 200
no synchronization
bgp log-neighbor-changes
network 3.3.3.0 mask 255.255.255.0
network 33.33.33.0 mask 255.255.255.0
neighbor 2.2.2.2 remote-as 200
neighbor 2.2.2.2 **-source Loopback0
neighbor 5.5.5.5 remote-as 200
neighbor 5.5.5.5 **-source Loopback0
no auto-summary
R4:
router ospf 100
log-adjacency-changes
network 4.4.4.0 0.0.0.255 area 0
network 192.168.3.0 0.0.0.255 area 0
network 192.168.5.0 0.0.0.255 area 0
!
router bgp 200
no synchronization
bgp log-neighbor-changes
network 4.4.4.0 mask 255.255.255.0
network 44.44.44.0 mask 255.255.255.0
neighbor 2.2.2.2 remote-as 200
neighbor 2.2.2.2 **-source Loopback0
neighbor 5.5.5.5 remote-as 200
neighbor 5.5.5.5 **-source Loopback0
no auto-summary
现在的问题是R4ping不通R1的1.1.1.1但是R1却可以ping通R4的4.4.4.4也可以ping通R4的loopback 1的44.44.44.44,,
R3ping不通R1的1.1.1.1但是R1却可以ping通R4的3.3.3.3也可以ping通R3的loopback 1的33.33.33.33
下面是R1的BGP表 TCP表
R1#show ip bgp
BGP table version is 9, local router ID is 1.1.2.1
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
*> 1.1.1.0/24 0.0.0.0 0 32768 i
*> 2.2.2.0/24 192.168.1.2 0 0 200 i
*> 3.3.3.0/24 192.168.1.2 0 200 i
*> 4.4.4.0/24 192.168.1.2 0 200 i
*> 22.22.22.0/24 192.168.1.2 0 0 200 i
*> 33.33.33.0/24 192.168.1.2 0 200 i
*> 44.44.44.0/24 192.168.1.2 0 200 i
*192.168.1.0 192.168.1.2 0 0 200 i
*> 0.0.0.0 0 32768 i
R1#show tcp bri
TCB Local Address Foreign Address (state)
63E47D50192.168.1.1.36536 192.168.1.2.179 ESTAB
R2:
R2#show ip bgp
BGP table version is 9, local router ID is 22.22.22.22
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
*> 1.1.1.0/24 192.168.1.1 0 0 100 i
*> 2.2.2.0/24 0.0.0.0 0 32768 i
*>i3.3.3.0/24 3.3.3.3 0 100 0 i
*>i4.4.4.0/24 4.4.4.4 0 100 0 i
*> 22.22.22.0/24 0.0.0.0 0 32768 i
*>i33.33.33.0/24 3.3.3.3 0 100 0 i
*>i44.44.44.0/24 4.4.4.4 0 100 0 i
*192.168.1.0 192.168.1.1 0 0 100 i
*> 0.0.0.0 0 32768 i
R2#show tcp bri
TCB Local Address Foreign Address (state)
63EA87602.2.2.2.179 3.3.3.3.41651 ESTAB
63ED2C88192.168.1.2.179 192.168.1.1.36536 ESTAB
63EA8C042.2.2.2.57766 4.4.4.4.179 ESTAB
R4和R3是一样的情况我只复制R4的给大家看看吧
R4#show ip bgp
BGP table version is 12, local router ID is 44.44.44.44
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
*>i1.1.1.0/24 2.2.2.2 0 100 0 100 i
*>i2.2.2.0/24 2.2.2.2 0 100 0 i
*> 4.4.4.0/24 0.0.0.0 0 32768 i
*>i5.5.5.0/24 5.5.5.5 0 100 0 i
*>i6.6.6.0/24 192.168.6.2 0 100 0 300 i
*>i22.22.22.0/24 2.2.2.2 0 100 0 i
*> 44.44.44.0/24 0.0.0.0 0 32768 i
*>i55.55.55.0/24 5.5.5.5 0 100 0 i
*>i192.168.1.0 2.2.2.2 0 100 0 i
*>i192.168.6.0 5.5.5.5 0 100 0 i
R4#show tcp bri
TCB Local Address Foreign Address (state)
63EA7B244.4.4.4.179 5.5.5.5.12273 ESTAB
63EA683C4.4.4.4.179 2.2.2.2.57766 ESTAB
zhenglidl 发表于 2012-5-16 09:09 static/image/common/back.gif
R3、R4pingR1的时候带源地址ping了吗?带源地址ping应该能通
是的带源地址为loopback就能通,已经解决了宣告了互连接口不用加源就可以通了 BGP 在ISP的应用还是非常广的,楼主保持。 楼主的问题是ping的时候数据包的源地址是出接口的地址,对于R1不知道192.168.2.0和192.168.3.0这网段的路由,所以数据包无法正常封装,需要在BGP进程中宣告相关互联网段就可以ping通了。 其实银行网络也是经常使用BGP的~ 当从ebgp邻居收到的路由传给自己的ibgp邻居时,ibgp邻居收到的这条路由的下一跳仍旧是ebgp邻居
next-hop-self一般设定在AS边界,AS边界这台路由器对属于本AS的ibgp邻居打上这条,ibgp邻居看到的ebgp路由的下一跳就会是AS边界的那台路由器了。 哥们儿,R2到R3和R4的时候,没有必要next-hop-self,,而R3和R4分别neighbor R5的时候应该next-hop-self,哥们儿,你这里没有搞懂什么时间应该手动设置下一跳,哈哈 哥们儿,你这里面问题不少啊,貌似好像就是不通而已,你的好几个下一跳对吗?
在起EBGP的路由之间没有必要起next-hop-self,在内部起IBGP的路由之间需要next-hop-self,因为在从外部路由过来的路由表项中,下一跳没有自动改过来,才需要手动更改为自身。 你在R5上sh ip bgp,你就会发现,下一跳是错的,就更ping 不通了
页:
[1]
2