本篇文章为大家分享下华为路由BGP联盟的基本配置,通过BGP联盟最终实验BGP内部邻居之间路由条目的传递,最终实现网络互通。
     实验拓扑图如下:

华为路由器BGP联盟详解_第1张图片

实验说明:
    路由器R2、R3、R4、R5路由器所在配置为联盟区域,联盟AS号码为200,R1的AS号为100,R6的AS号为600。

实验要求:
    1.IBGP通过回环口建立邻居;
    2.EBGP通过直连接口建立邻居。
    3.最终实现R1的 LoopBack0接口和R6的 LoopBack0接口网络互通。

每个基本网络配置:

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.23.2 24
quit
interface LoopBack 0
ip address 10.10.2.2 24
quit
R3
sysname R3
interface g0/0/1
ip address 192.168.23.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

路由器R2、R3、R4、R5路由器通过内部网关协议(IGP)OSP实现内网互通,配置如下:

R2
ospf 1 router-id 2.2.2.2
area 0
network 192.168.23.0 0.0.0.255
network 10.10.2.0 0.0.0.255
quit
quit
R3
ospf 1 router-id 3.3.3.3
area 0
network 192.168.23.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 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 64523
router-id 2.2.2.2
confederation id 200
peer 192.168.12.1 as-number 100
peer 10.10.3.3 as-number 64523
peer 10.10.3.3 connect-interface LoopBack0
peer 10.10.3.3 next-hop-local
quit
R3
bgp 64523
router-id 3.3.3.3
confederation id 200
confederation peer-as 64545
peer 10.10.2.2 as-number 64523
peer 10.10.2.2 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 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
peer 10.10.5.5 connect-interface LoopBack0
quit
R5
bgp 64545
router-id 5.5.5.5
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 600
router-id 6.6.6.6
peer 192.168.56.5 as-number 200
import-route direct
quit

验证测试:R1的 LoopBack0接口和R6的 LoopBack0接口网络互通。
结果如下图:

华为路由器BGP联盟详解_第2张图片

验证成功!!!