BGP routing black hole

BGP routing black hole
The IP address is shown in the figure;
AR1 and AR2 are configured with EBGP, AR4 and AR5 are also configured with EBGP, and AR2 and AR4 are configured with IBGP;
according to BGP routing principle 4: (A route learned from IBGP is sent to BGP neighbors through IGP. Know the route, that is, IGP is synchronized with BGP). On Huawei routers, the synchronization check between BGP and IGP is turned off by default. The reason is to realize the normal notification of IBGP routes. But turning off synchronization will cause a "routing black hole". Therefore, there are two solutions: 1. Import BGP routing into IGP, 2. IBGP routers must be fully interconnected.
BGP configuration

AR1配置:
bgp 10
 router-id 10.0.1.1
 peer 10.0.12.2 as-number 20 
 ipv4-family unicast
  undo synchronization
  network 10.0.1.1 255.255.255.255 
  network 10.0.12.0 255.255.255.0 
  peer 10.0.12.2 enable

The reason for configuring next-hop-local is: IBGP learns from EBGP that the next hop of the route remains unchanged, which will cause the next hop to be unreachable. Therefore, IBGP configures local to inform the next hop that it is itself.

AR2:
bgp 20
router-id 10.0.2.2
 peer 10.0.4.4 as-number 20 
 peer 10.0.4.4 connect-interface LoopBack0
 peer 10.0.12.1 as-number 10 
 ipv4-family unicast
  undo synchronization
  peer 10.0.4.4 enable
  peer 10.0.4.4 next-hop-local 
  peer 10.0.12.1 enable
AR4:
bgp 20
 router-id 10.0.4.4
 peer 10.0.2.2 as-number 20 
 peer 10.0.2.2 connect-interface LoopBack0
 peer 10.0.45.5 as-number 30 
 ipv4-family unicast
  undo synchronization
  peer 10.0.2.2 enable
  peer 10.0.2.2 next-hop-local 
  peer 10.0.45.5 enable
AR5:
bgp 30
 router-id 10.0.5.5
 peer 10.0.45.4 as-number 20 
 ipv4-family unicast
  undo synchronization
  network 10.0.5.5 255.255.255.255 
  network 10.0.45.0 255.255.255.0 
  peer 10.0.45.4 enable    

AR2, AR3, AR4 configure OSPF 1

ospf 1 router-id 10.0.0.2 
 area 0.0.0.0 
  network 10.0.2.2 0.0.0.0 
  network 10.0.23.0 0.0.0.255 

ospf 1 router-id 10.0.0.3
 area 0.0.0.0 
  network 10.0.3.3 0.0.0.0 
  network 10.0.23.0 0.0.0.255 
  network 10.0.34.0 0.0.0.255

ospf 1 router-id 10.0.0.4
 area 0.0.0.0 
  network 10.0.4.4 0.0.0.0 
  network 10.0.34.0 0.0.0.255
根据BGP第四条选路原则,当IBGP学到的路由传递给BGP邻居之前通过IGP必须知道该路由,也就是说,AR2学习到的AR1的的路由传递给AR4时,改路由经过AR3,AR3必须知道AR1的路由;同理也必须知道AR5的路由,可以通过IBGP全互联和OSPF 引入BGP解决此问题;
办法1 ospf引入bgp(如果是公网bgp,不建议这么搞,除非你路由器和运维能力很牛逼):

AR2 and AR4 respectively:
bgp 20
import-route bgp

Method 2 IBGP full interconnection:

AR2:
bgp 20
 router-id 10.0.2.2
 peer 10.0.3.3 as-number 20 
 peer 10.0.3.3 connect-interface LoopBack0
 peer 10.0.4.4 as-number 20 
 peer 10.0.4.4 connect-interface LoopBack0
 ipv4-family unicast
  undo synchronization
  peer 10.0.3.3 enable
  peer 10.0.3.3 next-hop-local 
  peer 10.0.4.4 enable
  peer 10.0.4.4 next-hop-local 
AR3:
bgp 20
 router-id 10.0.3.3
 peer 10.0.2.2 as-number 20 
 peer 10.0.2.2 connect-interface LoopBack0
 peer 10.0.4.4 as-number 20 
 peer 10.0.4.4 connect-interface LoopBack0
 ipv4-family unicast
  undo synchronization
  peer 10.0.2.2 enable
  peer 10.0.4.4 enable
  AR4:bgp 20
 router-id 10.0.4.4
 peer 10.0.2.2 as-number 20 
 peer 10.0.2.2 connect-interface LoopBack0
 peer 10.0.3.3 as-number 20 
 peer 10.0.3.3 connect-interface LoopBack0
 ipv4-family unicast
  undo synchronization
  peer 10.0.2.2 enable
  peer 10.0.2.2 next-hop-local 
  peer 10.0.3.3 enable
  peer 10.0.3.3 next-hop-local

Guess you like

Origin blog.51cto.com/19940820/2536316