FRR BGP ADD-PATH实验

实验拓扑

如上图所示使用四个FRR容器在ubuntu-18.04上进行实验。

实验功能说明:

RTA,RTB,RTC在自治区65001中,其中RTA作为路由反射器,RTB和RTC作为客户端。
RTD在自治区65002中,与RTA建立ebgp,在RTA上开启ADDPATH TX功能。
在RTA和RTB上都发布2.2.2.0/24路由,期望RTA能通过ADDPATH功能将两个下一跳都发布给RTD,完成负载均衡功能。

配置

RTA路由反射器配置

ba95ecc17d59# show running-config 
Building configuration...

Current configuration:
!
frr version 7.1
frr defaults traditional
hostname ba95ecc17d59
log syslog informational
no ipv6 forwarding
service integrated-vtysh-config
!
router bgp 65001
 neighbor addpath peer-group
 neighbor addpath remote-as internal
 neighbor 10.1.1.2 peer-group addpath
 neighbor 10.1.1.3 peer-group addpath
 neighbor 10.1.1.4 remote-as external
 !
 address-family ipv4 unicast
  neighbor addpath route-reflector-client #设置RTA和RTB为路由反射器客户端
  neighbor 10.1.1.4 addpath-tx-all-paths  #使能add-path TX
 exit-address-family
!
line vty
!
end

RTB配置

192ea1b21d74# show running-config 
Building configuration...

Current configuration:
!
frr version 7.1
frr defaults traditional
hostname 192ea1b21d74
log syslog informational
no ipv6 forwarding
service integrated-vtysh-config
!
router bgp 65001
 neighbor 10.1.1.1 remote-as internal
!
line vty
!
end

RTC配置

cd5d50b3b002# show running-config 
Building configuration...

Current configuration:
!
frr version 7.1
frr defaults traditional
hostname cd5d50b3b002
log syslog informational
no ipv6 forwarding
service integrated-vtysh-config
!
router bgp 65001
 neighbor 10.1.1.1 remote-as internal
!
line vty
!
end

RTD配置

#add-path接收默认是开启的,不需要任何配置
5476d5704eeb# show running-config 
Building configuration...

Current configuration:
!
frr version 7.1
frr defaults traditional
hostname 5476d5704eeb
log syslog informational
no ipv6 forwarding
service integrated-vtysh-config
!
router bgp 65002
 bgp bestpath as-path multipath-relax
 neighbor 10.1.1.1 remote-as external
!
line vty
!
end

在RTB和RTC上发布路由

192ea1b21d74(config-router-af)# network 2.2.2.0/24 

查看路由信息

RTA

ba95ecc17d59# show ip route bgp 
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

B>* 2.2.2.0/24 [200/0] via 10.1.1.2, eth1, 00:01:36
  *                    via 10.1.1.3, eth1, 00:01:36
ba95ecc17d59# 
# 查看内核中安装的路由
root@ba95ecc17d59:/# ip route
default via 172.17.0.1 dev eth0 
2.2.2.0/24 proto bgp metric 20 
        nexthop via 10.1.1.2 dev eth1 weight 1 
        nexthop via 10.1.1.3 dev eth1 weight 1 
10.1.1.0/24 dev eth1 proto kernel scope link src 10.1.1.1 
172.17.0.0/16 dev eth0 proto kernel scope link src 172.17.0.2 
root@ba95ecc17d59:/# 

RTD

5476d5704eeb# show ip route bgp 
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

B>* 2.2.2.0/24 [20/0] via 10.1.1.2, eth1, 00:02:13
  *                   via 10.1.1.3, eth1, 00:02:13
5476d5704eeb# 
#查看内核中的路由信息
root@5476d5704eeb:/# ip route
default via 172.17.0.1 dev eth0 
2.2.2.0/24 proto bgp metric 20 
        nexthop via 10.1.1.2 dev eth1 weight 1 #下一跳不是RTA的接口
        nexthop via 10.1.1.3 dev eth1 weight 1 #下一跳不是RTA的接口
10.1.1.0/24 dev eth1 proto kernel scope link src 10.1.1.4 
172.17.0.0/16 dev eth0 proto kernel scope link src 172.17.0.5 
root@5476d5704eeb:/# 

报文分析

下一跳为RTB的路由

下一跳为RTC的路径

posted @ 2020-01-06 17:02  ouyangxibao  阅读(994)  评论(0)    收藏  举报