BGP route-refresh功能实验


实验拓扑

实验说明:配置RTA和RTB互为邻居,在RTB上使用network命令发布两条路由给RTA,改变RTB的路由策略,触发RTA向RTB发送route-refresh消息

配置

步骤1

RTA

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

RTB

Current configuration:
!
frr version 7.1
frr defaults traditional
hostname 1fb9e963c62c
log syslog informational
no ipv6 forwarding
service integrated-vtysh-config
!
router bgp 65002
 neighbor 10.1.1.1 remote-as external
 !
 address-family ipv4 unicast
  network 6.6.6.0/24
  network 6.6.7.0/24
 exit-address-family
!
line vty
!
end

查看RTA上的邻居信息

31ae5a7ab4e1# show bgp neighbors 10.1.1.2      
BGP neighbor is 10.1.1.2, remote AS 65002, local AS 65001, external link
Hostname: 1fb9e963c62c
  BGP version 4, remote router ID 172.17.0.3, local router ID 172.17.0.2
  BGP state = Established, up for 00:46:08
  Last read 00:00:08, Last write 00:00:08
  Hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    4 Byte AS: advertised and received
    AddPath:
      IPv4 Unicast: RX advertised IPv4 Unicast and received
    Route refresh: advertised and received(old & new)

从上面可以看出,RTB是支持route-refresh的。frr默认开启route-refresh功能。

查看RTA上的路由信息

31ae5a7ab4e1# show ip bgp  
BGP table version is 10, local router ID is 172.17.0.2, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 6.6.6.0/24       10.1.1.2                 0             0 65002 i
*> 6.6.7.0/24       10.1.1.2                 0             0 65002 i

Displayed  2 routes and 2 total paths
31ae5a7ab4e1# 

步骤2

在RTA上配置route-map触发路由策略变化

31ae5a7ab4e1(config)# 
31ae5a7ab4e1(config)# route-map METRIC permit 10
31ae5a7ab4e1(config-route-map)# set metric 222
31ae5a7ab4e1(config-route-map)# exit
31ae5a7ab4e1(config)# router bgp 65001                     
31ae5a7ab4e1(config-router)# address-family ipv4 unicast 
31ae5a7ab4e1(config-router-af)# neighbor 10.1.1.2 route-map METRIC in    
31ae5a7ab4e1(config-router-af)# 

查看RTA上的路由信息

31ae5a7ab4e1# show ip bgp 
BGP table version is 12, local router ID is 172.17.0.2, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 6.6.6.0/24       10.1.1.2               222             0 65002 i
*> 6.6.7.0/24       10.1.1.2               222             0 65002 i

Displayed  2 routes and 2 total paths
31ae5a7ab4e1# 

从两个路由信息可以看出,路由的Metric从0变到了222,路由进行了刷新。

抓包查看



从上面的报文可以看出,RTA给RTB发送了route-refresh消息,RTB重发了原来的两条路由前缀。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM