cisco学习笔记

      CCIE之路中。。。。其实我是一个天才,可惜天妒英才!o(∩_∩)o...哈哈

  IT博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  39 随笔 :: 5 文章 :: 36 评论 :: 0 Trackbacks

BGPNEXT-HO-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

posted on 2008-09-27 14:34 cisco交流平台 阅读(4905) 评论(3)  编辑 收藏 引用 所属分类: BGP

评论

# re: BGP的NEXT-HOP-SELF试验 2009-02-02 10:06
说错了吧,如果配置得当的话,可以向r4发布这条路由,而且不需要使用next hop self属性。而且不需要igp。把初始配置给出来看看  回复  更多评论
  

# re: BGP的NEXT-HOP-SELF试验 2011-12-11 12:07 Scandy
应该 发布的  回复  更多评论
  

# re: BGP的NEXT-HOP-SELF试验 2012-11-07 10:46 NewType
@沈
IGP是要的,除非R2和R3互相有静态路由通告自身所有网段  回复  更多评论
  

只有注册用户登录后才能发表评论。