• 本篇文章为大家分享下华为路由BGP邻居、联盟、路由反射器综合实验配置,通过BGP邻居建立、联盟、路由反射器,实现BGP内部邻居之间路由条目的传递,最终实现R1的LoopBack 0与R6的LoopBack 0网络互通。

    ** 实验拓扑图如下:**

《深入浅出 —— BGP邻居、联盟、路由反射器综合配置》

**第一步,基本网络配置如下:**

R1
sysname R1
interface g0/0/0
ip address 192.168.12.1 24
interface LoopBack 0
ip address 10.10.1.1 24
quit
R2
sysname R2
interface g0/0/1
ip address 192.168.12.2 24
interface g0/0/0
ip address 192.168.27.2 24
quit
interface LoopBack 0
ip address 10.10.2.2 24
quit
R7
sysname R7
interface g0/0/1
ip address 192.168.27.7 24
interface g0/0/0
ip address 192.168.37.7 24
interface LoopBack 0
ip address 10.10.7.7 24
quit
R3
sysname R3
interface g0/0/1
ip address 192.168.37.3 24
interface g0/0/0
ip address 192.168.34.3 24
interface LoopBack 0
ip address 10.10.3.3 24
quit
R4
sysname R4
interface g0/0/1
ip address 192.168.34.4 24
interface g0/0/0
ip address 192.168.45.4 24
interface LoopBack 0
ip address 10.10.4.4 24
quit
R5
sysname R5
interface g0/0/1
ip address 192.168.45.5 24
interface g0/0/0
ip address 192.168.56.5 24
quit
interface LoopBack 0
ip address 10.10.5.5 24
quit
R6
sysname R6
interface g0/0/1
ip address 192.168.56.6 24
interface LoopBack 0
ip address 10.10.6.6 24
quit

第二步,中间区域配置IGP路由协议OSPF,配置如下:
R2
ospf 1 router-id 2.2.2.2
area 0
network 192.168.27.0 0.0.0.255
network 10.10.2.0 0.0.0.255
quit
quit
R7
ospf 1 router-id 7.7.7.7
area 0
network 192.168.37.0 0.0.0.255
network 192.168.27.0 0.0.0.255
network 10.10.7.0 0.0.0.255
quit
quit
R3
ospf 1 router-id 3.3.3.3
area 0
network 192.168.37.0 0.0.0.255
network 192.168.34.0 0.0.0.255
network 10.10.3.0 0.0.0.255
quit
quit
R4
ospf 1 router-id 4.4.4.4
area 0
network 192.168.45.0 0.0.0.255
network 192.168.34.0 0.0.0.255
network 10.10.4.0 0.0.0.255
quit
quit
R5
ospf 1 router-id 5.5.5.5
area 0
network 192.168.45.0 0.0.0.255
network 10.10.5.0 0.0.0.255
quit
quit

第三步,本步骤是重点,我们来配置BGP:BGP联盟与路由反射器 

**R1上配置BGP,AS编号为100**

bgp 100
router-id 1.1.1.1
peer 192.168.12.2 as-number 200
network 10.10.1.0 255.255.255.0
quit

    **R2上配置BGP,AS编号为64523,联盟编号200**

bgp 64523
router-id 2.2.2.2
confederation id 200
peer 192.168.12.1 as-number 100
peer 10.10.7.7 as-number 64523
peer 10.10.7.7 connect-interface LoopBack0
peer 10.10.7.7 next-hop-local
quit

**R7上配置BGP,AS编号为64523,联盟编号200**

bgp 64523
router-id 7.7.7.7
confederation id 200
peer 10.10.2.2 as-number 64523
peer 10.10.3.3 as-number 64523
peer 10.10.2.2 reflect-client
peer 10.10.3.3 reflect-client
quit

**R3上配置BGP,AS编号为64523,联盟编号200,与64545建立邻居关系**

bgp 64523
router-id 3.3.3.3
confederation id 200
confederation peer-as 64545
peer 10.10.7.7 as-number 64523
peer 10.10.7.7 connect-interface LoopBack0
peer 10.10.4.4 as-number 64545
peer 10.10.4.4 connect-interface LoopBack0
peer 10.10.4.4 ebgp-max-hop
quit

**R4上配置BGP,AS编号为64545,联盟编号200**

bgp 64545
router-id 4.4.4.4
confederation id 200
confederation peer-as 64523
peer 10.10.3.3 as-number 64523
peer 10.10.3.3 connect-interface LoopBack0
peer 10.10.3.3 ebgp-max-hop
peer 10.10.5.5 as-number 64545
quit

 **R5上配置BGP,AS编号为64545,联盟编号200**

bgp 64545
router-id 5.5.5.5
confederation id 200
peer 192.168.56.6 as-number 600
peer 10.10.4.4 as-number 64545
peer 10.10.4.4 connect-interface LoopBack 0
peer 10.10.4.4 next-hop-local
quit

 **R6上配置BGP,AS编号为600**

bgp 600
router-id 6.6.6.6
peer 192.168.56.5 as-number 200
import-route direct
quit

最终测试R1的LoopBack 0与R6的LoopBack 0网络互通,如下图:

《深入浅出 —— BGP邻居、联盟、路由反射器综合配置》