BGP的路由反射与BGP联盟

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了BGP的路由反射与BGP联盟相关的知识,希望对你有一定的参考价值。

技术分享图片
配置思路:

  1. 首先把IGP配置通 就是把路由配置好 然后才可以建立邻居
  2. AR1 和 AR2 建立内部邻居 先配置小 AS 号然后再指定大 AS 号 然后用虚拟端口loopback IP 地址建立邻居
    注:不要忘记 指向邻居的端口改为loopback端口
    AR2 和 AR1 建立内部邻居 先配置小 AS 号然后再指定大 AS 号 然后用虚拟端口loopback IP 地址建立邻居
    AR2 和 AR3 建立内部邻居 先配置小 AS 号然后再指定大 AS 号 然后用虚拟端口loopback IP 地址建立邻居
    并把 AR1 当做自己的客户端 同时自己成为路由反射器
    注:不要忘记 指向邻居的端口改为loopback端口
    AR3 与 AR2 建立内部邻居 先配置小 AS 号然后再指定大 AS 号 然后用虚拟端口loopback IP 地址建立邻居
    AR3 与 AR4 建立外部邻居 先配置小 AS 号然后再指定大 AS 号 并 confederation peer-as 64513 联盟 邻居 as 64513
    然后用端口 IP 地址建立邻居
    AR4 与 AR3 建立外部邻居 先配置小 AS 号然后再指定大 AS 号 并 confederation peer-as 64512 联盟 邻居 as 64512
    然后用端口 IP 地址建立邻居
    AR4 与 AR5 建立内部邻居 先配置小 AS 号然后再指定大 AS 号 然后用虚拟端口loopback IP 地址建立邻居
    AR5 与 AR4 建立内部邻居 先配置小 AS 号然后再指定大 AS 号 然后用虚拟端口loopback IP 地址建立邻居
    在大 AS外部路由传路由到内部大 AS 的时候 下一跳是变化的
    内部传路由下一跳是不变的
    所以在每个 AS 边界路由器上需要把下一跳改成自己的
    所改的下一跳地址就是与内部建立邻居的那个地址
    peer x.x.x.x next-hop-local

每个路由器配置:

R1配置:
#
interface GigabitEthernet0/0/0
ip address 192.168.16.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.12.1 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 192.168.17.1 255.255.255.0
#
interface NULL0
#
interface LoopBack0
ip address 10.10.1.1 255.255.255.0
#
bgp 64512
router-id 1.1.1.1
confederation id 100
peer 10.10.2.2 as-number 64512
peer 10.10.2.2 connect-interface LoopBack0
peer 192.168.16.6 as-number 200
peer 192.168.17.7 as-number 200
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.10.2.2 enable
peer 10.10.2.2 next-hop-local
peer 192.168.16.6 enable
peer 192.168.17.7 enable
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 10.10.1.1 0.0.0.0
network 192.168.12.0 0.0.0.255

AR2配置:
#
interface GigabitEthernet0/0/0
ip address 192.168.12.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.23.2 255.255.255.0
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 10.10.2.2 255.255.255.0
#
bgp 64512
router-id 2.2.2.2
confederation id 100
peer 10.10.1.1 as-number 64512
peer 10.10.1.1 connect-interface LoopBack0
peer 10.10.3.3 as-number 64512
peer 10.10.3.3 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 10.10.1.1 enable
peer 10.10.1.1 reflect-client
peer 10.10.3.3 enable
#
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 10.10.2.2 0.0.0.0
network 192.168.12.0 0.0.0.255
network 192.168.23.0 0.0.0.255

AR3配置:
#
interface GigabitEthernet0/0/0
ip address 192.168.23.3 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.34.3 255.255.255.0
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 10.10.3.3 255.255.255.0
#
bgp 64512
router-id 3.3.3.3
confederation id 100
confederation peer-as 64513
peer 10.10.2.2 as-number 64512
peer 10.10.2.2 connect-interface LoopBack0
peer 192.168.34.4 as-number 64513
#
ipv4-family unicast
undo synchronization
peer 10.10.2.2 enable
peer 192.168.34.4 enable
#
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 10.10.3.3 0.0.0.0
network 192.168.23.0 0.0.0.255
network 192.168.34.0 0.0.0.255

AR4配置:
#
interface GigabitEthernet0/0/0
ip address 192.168.34.4 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.45.4 255.255.255.0
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 10.10.4.4 255.255.255.0
#
bgp 64513
confederation id 100
confederation peer-as 64512
peer 10.10.5.5 as-number 64513
peer 10.10.5.5 connect-interface LoopBack0
peer 192.168.34.3 as-number 64512
#
ipv4-family unicast
undo synchronization
peer 10.10.5.5 enable
peer 192.168.34.3 enable
#
ospf 1 router-id 4.4.4.4
area 0.0.0.0
network 10.10.4.4 0.0.0.0
network 192.168.34.0 0.0.0.255
network 192.168.45.0 0.0.0.255

AR5配置:
#
interface GigabitEthernet0/0/0
ip address 192.168.45.5 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.59.5 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 192.168.20.254 255.255.255.0
#
interface NULL0
#
interface LoopBack0
ip address 10.10.5.5 255.255.255.0
#
bgp 64513
confederation id 100
peer 10.10.4.4 as-number 64513
peer 10.10.4.4 connect-interface LoopBack0
peer 192.168.59.9 as-number 900
#
ipv4-family unicast
undo synchronization
network 192.168.20.0
peer 10.10.4.4 enable
peer 10.10.4.4 next-hop-local
peer 192.168.59.9 enable
#
ospf 1 router-id 5.5.5.5
area 0.0.0.0
network 10.10.5.5 0.0.0.0
network 192.168.45.0 0.0.0.255

AR6配置:
#
interface GigabitEthernet0/0/0
ip address 192.168.68.6 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.16.6 255.255.255.0
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 10.10.6.6 255.255.255.0
#
bgp 200
peer 10.10.8.8 as-number 200
peer 10.10.8.8 connect-interface LoopBack0
peer 192.168.16.2 as-number 100
#
ipv4-family unicast
undo synchronization
peer 10.10.8.8 enable
peer 10.10.8.8 next-hop-local
peer 192.168.16.2 enable
#
rip 1
version 2
network 10.0.0.0
network 192.168.68.0

AR7配置:
#
interface GigabitEthernet0/0/0
ip address 192.168.78.7 255.255.255.0
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
ip address 192.168.17.7 255.255.255.0
#
interface NULL0
#
interface LoopBack0
ip address 10.10.7.7 255.255.255.0
#
bgp 200
peer 10.10.8.8 as-number 200
peer 10.10.8.8 connect-interface LoopBack0
peer 192.168.17.1 as-number 100
#
ipv4-family unicast
undo synchronization
peer 10.10.8.8 enable
peer 10.10.8.8 next-hop-local
peer 192.168.17.1 enable
#
rip 1
version 2
network 10.0.0.0
network 192.168.78.0

AR8配置:
#
interface GigabitEthernet0/0/0
ip address 192.168.68.8 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.78.8 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 192.168.30.254 255.255.255.0
#
interface NULL0
#
interface LoopBack0
ip address 10.10.8.8 255.255.255.0
#
bgp 200
peer 10.10.6.6 as-number 200
peer 10.10.6.6 connect-interface LoopBack0
peer 10.10.7.7 as-number 200
peer 10.10.7.7 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
network 192.168.30.0
peer 10.10.6.6 enable
peer 10.10.7.7 enable
#
rip 1
version 2
network 10.0.0.0
network 192.168.78.0
network 192.168.68.0

AR9配置:
#
interface GigabitEthernet0/0/0
ip address 192.168.40.254 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.59.9 255.255.255.0
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
bgp 900
peer 192.168.59.5 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 192.168.59.5 enable

以上是关于BGP的路由反射与BGP联盟的主要内容,如果未能解决你的问题,请参考以下文章

BGP反射和联盟

BGP反射和联盟

BGP反射器联盟属性选路

BGP的反射器和联盟

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

华为路由器BGP联盟详解