Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented as per the feature description given in the source link. Descriprion: The BGP conditional advertisement feature uses the non-exist-map or exist-map and the advertise-map keywords of the neighbor advertise-map command in order to track routes by the route prefix. non-exist-map : If a route prefix is not present in output of the non-exist-map command, then the route specified by the advertise-map command is announced. exist-map : If a route prefix is present in output of the exist-map command, then the route specified by the advertise-map command is announced. The conditional BGP announcements are sent in addition to the normal announcements that a BGP router sends to its peers. The conditional advertisement process is triggered by the BGP scanner process, which runs every 60 seconds. This means that the maximum time for the conditional advertisement to take effect is 60 seconds. The conditional advertisement can take effect sooner, depending on when the tracked route is removed from the BGP table and when the next instance of the BGP scanner occurs. Sample Configuration on DUT --------------------------- Router2# show running-config Building configuration... Current configuration: ! frr version 7.6-dev-MyOwnFRRVersion frr defaults traditional hostname router log file /var/log/frr/bgpd.log log syslog informational hostname Router2 service integrated-vtysh-config ! debug bgp updates in debug bgp updates out ! debug route-map ! ip route 130.130.0.0/16 blackhole ! interface enp0s9 ip address 10.10.10.2/24 ! interface enp0s10 ip address 10.10.20.2/24 ! interface lo ip address 128.16.16.1/24 ! router bgp 2 bgp log-neighbor-changes no bgp ebgp-requires-policy neighbor 10.10.10.1 remote-as 1 neighbor 10.10.20.3 remote-as 3 ! address-family ipv4 unicast network 128.16.16.0/24 network 130.130.0.0/16 neighbor 10.10.10.1 soft-reconfiguration inbound neighbor 10.10.10.1 advertise-map ADVERTISE non-exist-map CONDITION neighbor 10.10.20.3 soft-reconfiguration inbound exit-address-family ! access-list 60 seq 5 permit 128.16.16.0/24 exact-match access-list 65 seq 5 permit 192.168.50.0/24 exact-match access-list CONDITION seq 5 permit 192.168.50.0/24 access-list ADVERTISE seq 5 permit 128.16.16.0/24 ! route-map ADVERTISE permit 10 match ip address ADVERTISE ! route-map CONDITION permit 10 match ip address CONDITION ! line vty ! end Router2# Sample output ------------- Router2# show ip bgp neighbors 10.10.10.1 BGP neighbor is 10.10.10.1, remote AS 1, local AS 2, external link !--- Output suppressed. For address family: IPv4 Unicast Update group 1, subgroup 1 Packet Queue length 0 Inbound soft reconfiguration allowed Community attribute sent to this neighbor(all) Condition NON_EXIST, Condition-map *CONDITION, Advertise-map *ADVERTISE, status: Withdraw 1 accepted prefixes Connections established 1; dropped 0 Last reset 00:21:05, Waiting for peer OPEN !--- Output suppressed. Router2# Router2# show ip bgp BGP table version is 6, local router ID is 128.16.16.1, vrf id 0 Default local pref 100, local AS 2 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 *> 128.16.16.0/24 0.0.0.0 0 32768 i *> 130.130.0.0/16 0.0.0.0 0 32768 i *> 192.168.50.0/24 10.10.20.3 0 0 3 i *> 200.200.200.0/24 10.10.10.1 0 0 1 i Displayed 4 routes and 4 total paths Router2# Here 128.16.16.0/24(prefix in advertise-map) is withdrawn by conditional advertisement scanner as the prefix(192.168.50.0/24) specified by non-exist-map is present in BGP table. Router2# show ip bgp neighbors 10.10.10.1 advertised-routes BGP table version is 6, local router ID is 128.16.16.1, vrf id 0 Default local pref 100, local AS 2 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 *> 130.130.0.0/16 0.0.0.0 0 32768 i *> 192.168.50.0/24 0.0.0.0 0 3 i *> 200.200.200.0/24 0.0.0.0 0 1 i Total number of prefixes 3 Router2# After Removing 192.168.50.0/24(prefix present in non-exist-map), prefix present in advertise-map(128.16.16.0/24) is advertised Router2# show ip bgp BGP table version is 7, local router ID is 128.16.16.1, vrf id 0 Default local pref 100, local AS 2 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 *> 128.16.16.0/24 0.0.0.0 0 32768 i *> 130.130.0.0/16 0.0.0.0 0 32768 i *> 200.200.200.0/24 10.10.10.1 0 0 1 i Displayed 3 routes and 3 total paths Router2# Router2# Router2# show ip bgp neighbors 10.10.10.1 advertised-routes BGP table version is 7, local router ID is 128.16.16.1, vrf id 0 Default local pref 100, local AS 2 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 *> 128.16.16.0/24 0.0.0.0 0 32768 i *> 130.130.0.0/16 0.0.0.0 0 32768 i *> 200.200.200.0/24 0.0.0.0 0 1 i Total number of prefixes 3 Router2# Router2# Router2# Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>
- Loading branch information