1.组网需求

  所有路由器运行BGP协议,Switch A与Switch B和Switch C建立EBGP连接,Switch B、Switch C和Switch D之间建立IBGP连接,Route D与Route E建立IBGP连接。

  Switch D作为路由反射器,Switch E为Switch D的客户机。

  配置Add-Path功能,使Switch E通过Switch D学到Switch B和Switch C转发的前缀相同下一跳不同的路由信息。

    

 2.配置步骤

  1) 配置各接口的IP地址。

  2)配置BGP连接

# 配置Switch A。
[SwitchA] bgp 10
[SwitchA-bgp-default] peer 10.1.1.2 as-number 20
[SwitchA-bgp-default] peer 20.1.1.2 as-number 20
[SwitchA-bgp-default] address-family ipv4 unicast
[SwitchA-bgp-default-ipv4] peer 10.1.1.2 enable
[SwitchA-bgp-default-ipv4] peer 20.1.1.2 enable
# 配置Switch B。
[SwitchB] bgp 20
[SwitchB-bgp-default] peer 10.1.1.1 as-number 10
[SwitchB-bgp-default] peer 30.1.1.1 as-number 20
[SwitchB-bgp-default] address-family ipv4 unicast
[SwitchB-bgp-default-ipv4] peer 10.1.1.1 enable
[SwitchB-bgp-default-ipv4] peer 30.1.1.1 enable
# 配置Switch C。
[SwitchC] bgp 20
[SwitchC-bgp-default] peer 20.1.1.1 as-number 10
[SwitchC-bgp-default] peer 40.1.1.1 as-number 20
[SwitchC-bgp-default] address-family ipv4 unicast
[SwitchC-bgp-default-ipv4] peer 10.1.1.1 enable
[SwitchC-bgp-default-ipv4] peer 30.1.1.1 enable
# 配置Switch D。
[SwitchD] bgp 20
[SwitchD-bgp-default] peer 30.1.1.2 as-number 20
[SwitchD-bgp-default] peer 40.1.1.2 as-number 20
[SwitchD-bgp-default] peer 50.1.1.2 as-number 20
[SwitchD-bgp-default] address-family ipv4 unicast
[SwitchD-bgp-default-ipv4] peer 30.1.1.2 enable
[SwitchD-bgp-default-ipv4] peer 40.1.1.2 enable
[SwitchD-bgp-default-ipv4] peer 50.1.1.2 enable
# 配置Switch E。
[SwitchE] bgp 20
[SwitchE-bgp-default] peer 50.1.1.1 as-number 20
[SwitchE-bgp-default] address-family ipv4 unicast
[SwitchE-bgp-default-ipv4] peer 50.1.1.1 enable

  3)  配置发布本地路由

# 配置Switch A发布本地10.1.1.0 24 的路由信息
[SwitchA-bgp-default-ipv4] network 10.1.1.0 24

  4)将下一跳的属性修改成自身的地址

# 配置Switch B。
[SwitchB-bgp-default-ipv4] peer 30.1.1.1 next-hop-local
# 配置Switch C。
[SwitchC-bgp-default-ipv4] peer 40.1.1.1 next-hop-local

  5)配置路由反射器

# 配置Switch D。
[SwitchD-bgp-default-ipv4] peer 50.1.1.2 reflect-client

  6) 配置Add-Path

# 配置Switch D使能Add-Path发送能力,配置Add-Path优选路由的最大条数为2,配置向对等体50.1.1.2发送Add-Path优选路由的最大条数为2。
[SwitchD-bgp-default-ipv4] peer 50.1.1.2 additional-paths send
[SwitchD-bgp-default-ipv4] additional-paths select-best 2
[SwitchD-bgp-default-ipv4] peer 50.1.1.2 advertise additional-paths best 2

# 配置Switch E使能Add-Path接收能力。
[SwitchE-bgp-default-ipv4] peer 50.1.1.1 additional-paths receive

3.验证配置

# 查看Switch E的BGP路由信息。
[Switch E] display bgp routing-table ipv4
 Total number of routes: 2
 BGP local Switch ID is 50.1.1.2
 Status codes: * - valid, > - best, d - dampened, h - history
               s - suppressed, S - stale, i - internal, e - external
               a - additional-path
       Origin: i - IGP, e - EGP, ? - incomplete
     Network            NextHop         MED        LocPrf     PrefVal Path/Ogn
   i 10.1.1.0/24        30.1.1.2        0          100        0       10i
   i                    40.1.1.2        0          100        0       10i
可以看到从Switch D学到的两条前缀相同下一跳不同的路由信息。

 

posted on 2022-01-13 15:42  星痕1216  阅读(603)  评论(0编辑  收藏  举报