BGP-route flap经典案例

 
R1s2/1 >s2/1R2s2/2 >s2/1R3s2/2 >s2/1R4s2/2 >s2/2R 5f 0/0 >f0/0R1
AS234 内跑 eigrp
R1#sh run | b r b
router bgp 100
 no synchronization
 bgp router-id 1.1.1 .1
network 1.1.1 .1 mask 255.255.255.255
 network 12.0.0 .0 mask 255.255.255.0
 neighbor 12.0.0 .2 remote-as 234
 neighbor 15.0.0 .5 remote-as 500
 no auto-summary
 
 
 
R2#sh run | b r e
router eigrp 90
 network 2.2.2 .0 0.0.0.255
 network 23.0.0 .0 0.0.0.255
 no auto-summary
!
router bgp 234
 no synchronization
 bgp router-id 2.2.2 .2
neighbor 3.3.3 .3 remote-as 234
 neighbor 3.3.3 .3 update-source Loopback0
 neighbor 12.0.0 .1 remote-as 100
 no auto-summary
 
 
 
R3#sh run | b r e
router eigrp 90
 network 3.3.3 .0 0.0.0.255
 network 23.0.0 .0 0.0.0.255
 network 34.0.0.0 0.0.0 .255
 no auto-summary
!
router bgp 234
 no synchronization
 bgp router-id 3.3.3 .3
neighbor 2.2.2 .2 remote-as 234
 neighbor 2.2.2 .2 update-source Loopback0
 neighbor 4.4.4 .4 remote-as 234
 neighbor 4.4.4 .4 update-source Loopback0
 no auto-summary
 
R4#sh run | b r e
router eigrp 90
 network 4.4.4 .0 0.0.0.255
 network 34.0.0.0 0.0.0 .255
 no auto-summary
router bgp 234
 no synchronization
 bgp router-id 4.4.4 .4
neighbor 3.3.3 .3 remote-as 234
 neighbor 3.3.3 .3 update-source Loopback0
 neighbor 3.3.3 .3 next-hop-self
 neighbor 45.0.0.5 remote-as 500
 no auto-summary
 
 
R5#sh run | b r b
router bgp 500
 no synchronization
 bgp router-id 5.5.5 .5
neighbor 15.0.0 .1 remote-as 100
 neighbor 45.0.0.4 remote-as 234
 no auto-summary
观察 R3 上的 bgp 路由变化
 
   Network          Next Hop            Metric LocPrf Weight Path
*>i 1.1.1 .1/32       4.4.4 .4                  0    100      0 500 100 i
* i                 12.0.0 .1                 0    100      0 100 i
 
   Network          Next Hop            Metric LocPrf Weight Path
* i 1.1.1 .1/32       4.4.4 .4                  0    100      0 500 100 i
*>i                 12.0.0 .1                 0    100      0 100 i
* i 12.0.0 .0/24      4.4.4 .4                  0    100      0 500 100 i
*>i                 12.0.0 .1                 0    100      0 100 i
 
 
   Network          Next Hop            Metric LocPrf Weight Path
*>i 1.1.1 .1/32       4.4.4 .4                  0    100      0 500 100 i
* i                 12.0.0 .1                 0    100      0 100 i
*>i 12.0.0 .0/24      4.4.4 .4                  0    100      0 500 100 i
* i                 12.0.0 .1                 0    100      0 100 i
 
 
   Network          Next Hop            Metric LocPrf Weight Path
* i 1.1.1 .1/32       4.4.4 .4                  0    100      0 500 100 i
*>i                 12.0.0 .1                 0    100      0 100 i
* i 12.0.0 .0/24      4.4.4 .4                  0    100      0 500 100 i
*>i                 12.0.0 .1                 0    100      0 100 i
R3(config-router)#do sh ip cef 1.1.1 .1
1.1.1 .1/32, version 34, epoch 0
0 packets, 0 bytes
  vi a 12.0.0 .1, 0 dependencies, recursive
    unresolved
 
 
   Network          Next Hop            Metric LocPrf Weight Path
*>i 1.1.1 .1/32       4.4.4 .4                  0    100      0 500 100 i
* i                 12.0.0 .1                 0    100      0 100 i
*>i 12.0.0 .0/24      4.4.4 .4                  0    100      0 500 100 i
* i                 12.0.0 .1                 0    100      0 100 i
R3(config-router)#do sh ip cef 1.1.1 .1
1.1.1 .1/32, version 36, epoch 0, cached adjacency to Serial2/2
0 packets, 0 bytes
  vi a 4.4.4 .4, 0 dependencies, recursive
    next hop 34.0.0.4, Serial2/2 vi a 4.4.4 .0/24
valid cached adjacency
注:
先宣告 bgp 路由 1.1.1 .1 R1 R3 学到的 bgp 路由 1.1.1.1 是从 R4 学来的,因为下一跳可达, R4 上做了 nei 3.3.3.3 next hop self
再宣告 12.0.0 .0bgp 路由到 R1 ,观察 R3 学到的 bgp 路由, bgp 路由翻动,下一跳是 12.0.0.1 ,这个路由是从 5->4->3 这个方向学到的, R3 扫描发现 12.0.0.1 下一跳不可达,因为 R2 上没有做 nei 3.3.3.3 next hop self bgp 路由又翻动了,走下一跳 4.4.4.4 了。
 
最后还有一个问题 r> 12.0.0 .0/24      12.0.0 .1          0             0 100 i
R2#sh ip bgp
BGP table version is 4, 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
*> 1.1.1 .1/32       12.0.0 .1                 0             0 100 i
r> 12.0.0 .0/24      12.0.0 .1                 0             0 100 i

你可能感兴趣的:(职场,route,休闲,BGP,flap)