BGP的NEXT-HOP-SELF试验

拓扑:

 

 

 

bgp的NEXT-HOP-SELF

 

 

R1 R2建立EBGP对等体,R2R1建立EBGP对等体, R3R2建立IBGP对等体与R4建立EBGP 对等体, R4R3EBGP对等体

R1通告1.1.10/24网络给EBGP对等体R2R2通告给R3R3会再转发给R4么???

答案是不会的,因为,当R3学到这一路由时,1.1.1.0/24这一网络的下一跳是10.1.1.1R3是不可到达的,此时可在R2上做next-hop-self来解决这一问题

R1配置

Router>EN

Router#conf t

R1(config)#int s1/1

R1(config-if)#ip add 10.1.1.1 255.255.255.0

R1(config-if)#no sh

R1(config-if)#int lo 0

R1(config-if)#ip add 1.1.1.1 255.255.255.0

R1(config-if)#no sh

R1(config-if)#exi

R1(config)#router bgp 100

R1(config-router)#net 1.1.1.0 mask 255.255.255.0

R1(config-router)#nei 10.1.1.2 remote 200

R2配置:

Router>en

Router#conf t

R2(config)#int s1/0

R2(config-if)#ip add 10.1.1.2 255.255.255.0

R2(config-if)#no sh

R2(config-if)#int s1/1

R2(config-if)#ip add 10.2.2.1 255.255.255.0

R2(config-if)#no sh

R2(config-if)#exi

R2(config)#router bgp 200

R2(config-router)#nei 10.1.1.1 remote 100

R2(config-router)#nei 10.2.2.2 remote 200

R3配置:

Router>en

Router#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#host R3

R3(config)#int s1/0

R3(config-if)#ip add 10.2.2.2 255.255.255.0

R3(config-if)#no sh

R3(config-if)#int s1/1

R3(config-if)#ip add 10.3.3.1 255.255.255.0

R3(config-if)#no sh

R3(config-if)#exi

R3(config)#router bgp 200

R3(config-router)#nei 10.2.2.1 remote 200

R3(config-router)#nei 10.3.3.2 remote 300

R4配置:

Router>en

Router#conf t

R4(config)#int s1/0

R4(config-if)#ip add 10.3.3.2 255.255.255.0

R4(config-if)#no sh

R4(config-if)#exi

R4(config)#router bgp 300

R4(config-router)#nei 10.3.3.1 remote 200

查看R3 R4 BGP 转发表:

R3#sh ip bgp

BGP table version is 1, local router ID is 10.3.3.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

* i1.1.1.0/24       10.1.1.1                 0    100      0 100

(标注为不是最优的)

就不会再转发这一路由,只有同时是*>才转发

R4#sh ip bgp

 

R4#sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route

 

Gateway of last resort is not set

 

     10.0.0.0/24 is subnetted, 1 subnets

C       10.3.3.0 is directly connected, Serial1/0

 

R4没学到1.1.1.0/24!!!!!!55555555

R2上做NEXT-HO-SELF

R2(config)#router bgp 200

R2(config-router)#nei 10.2.2.2 next-hop-self

再查看R4的转发表和路由表:

R4#sh ip bgp

BGP table version is 2, local router ID is 10.3.3.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

*> 1.1.1.0/24       10.3.3.1                               0 200

 

R4#sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route

 

Gateway of last resort is not set

 

     1.0.0.0/24 is subnetted, 1 subnets

B       1.1.1.0 [20/0] via 10.3.3.1, 00:01:32  (学的了咯!!!o(_)o…

     10.0.0.0/24 is subnetted, 1 subnets

C       10.3.3.0 is directly connected, Serial1/0

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: BGP Next-hop-local是指在BGP路由中,下一跳地址指向本地路由器的情况。这种情况通常发生在同一AS内的路由器之间,因为它们可以直接通信,而不需要经过其他AS的路由器。使用BGP Next-hop-local可以提高路由器之间的通信效率和可靠性。 ### 回答2: BGP是一种广域网路由协议,它在互联网中扮演着非常重要的角色。其作为一种强大的路由协议,自然具有许多的功能。其中BGP next-hop-local就是BGP的一种功能。 BGP next-hop-local是一种基于BGP协议的路由选择功能。它允许在BGP路由器之间创建一种本地路由选择功能,使得每个BGP路由器可以选择下一个路由器,而无需依赖于其他路由器的选择。 通常情况下,BGP协议所使用的下一跳路由器是处于AS边界的路由器。但是,在某些情况下,BGP路由器可能需要选择一种特定的本地路由选择方式。这时,BGP next-hop-local就显得非常有用。 举个例子,假设A、B、C三台路由器位于同一网络中,其中A为B、C的路由器。此时,B和C希望通过A进行通信。由于A位于B、C之间,因此根据BGP的原理,它应该被视为下一跳路由器。但是,如果B和C想要选择一种特定的本地路由选择方式,那么他们就可以使用BGP next-hop-local功能,来实现在A之间进行通信。 总的来说,BGP next-hop-local是BGP协议的一种非常实用的路由选择功能。它可以使得BGP路由器在选择下一跳路由器时,更加灵活和高效。同时也能够满足不同网络的需求,让网络通信更加智能化和高效化。 ### 回答3: BGP(Border Gateway Protocol)是用于在互联网中路由数据包的协议。BGP Next-hop-local是BGP路由协议中非常重要的一个概念,表示下一跳的地址是本地地址。 在BGP路由协议中,Next-hop是指该路由要发送到的下一个路由器的地址,而Next-hop-local指的是下一跳地址位于本地(也就是位于同一台路由器上)的路由。通常情况下,当路由器收到一个要转发的数据包时,它会先查找该数据包的目的IP地址所对应的路由表项,并确定下一跳的IP地址。若下一跳地址是本地地址,则该数据包将直接发往本地地址,不需要通过其他路由器中转。 BGP Next-hop-local的优点是能够提高路由器的转发效率,缩短数据包的转发路径,降低网络延迟。同时,BGP Next-hop-local可以用于优化网络拓扑结构,避免一些不必要的中转,提高网络可靠性和稳定性。另外,BGP Next-hop-local还可以防止路由器之间的循环转发(loop),保证数据包的正确转发。 需要注意的是,BGP Next-hop-local并不是所有的路由器都支持。在使用BGP协议的网络中,如果需要使用BGP Next-hop-local,需要先了解路由器的型号以及版本,确认其是否支持该功能,以免出现不兼容的情况。 总之,BGP Next-hop-local是BGP路由协议中一个非常重要的概念,可以提高网络的转发效率,优化网络拓扑结构,增强网络的可靠性和稳定性。它对于提高网络性能和管理网络都有很大的帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值