FRRouting / frr

The FRRouting Protocol Suite
https://frrouting.org/
Other
3.33k stars 1.25k forks source link

BGP. inbound route-map doesnt change next-hop ip address #8863

Closed static33rus closed 3 years ago

static33rus commented 3 years ago

version of FRR: 8.0

Steps to reproduce: 1) Receive a route via bgp (in my example 11.11.11.11/32) 2) Create prefix list or access-list which matches this route 3) Create route-map with action permit, wich matches this prefix-list/access-list and sets new ip next hop 4) Check bgp table

Example: I had a route in bgp table

nfware# show ip bgp
BGP table version is 3, local router ID is 77.77.77.77, vrf id 0
Default local pref 100, local AS 65000
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
RPKI validation codes: V valid, I invalid, N Not found

   Network          Next Hop            Metric LocPrf Weight Path
*> 11.11.11.11/32   33.33.33.2               0             0 65001 ?

Then I tried to rewrite next-hop from 33.33.33.2 to 3.3.3.2:

router bgp 65000
 bgp router-id 77.77.77.77
 no bgp ebgp-requires-policy
 neighbor 11.11.11.11 remote-as 65001
 neighbor 11.11.11.11 ebgp-multihop 2
 neighbor 11.11.11.11 timers connect 1
 neighbor 33.33.33.2 remote-as 65001
 neighbor 33.33.33.2 timers connect 1
 !
 address-family ipv4 unicast
  neighbor 33.33.33.2 route-map test in
 exit-address-family
!
ip prefix-list test seq 5 permit 11.11.11.11/32
!
route-map test permit 10
 match ip address prefix-list
 set ip next-hop 3.3.3.2
!
end
nfware# show ip bgp
No BGP prefixes displayed, 0 exist
nfware# 

If i set weight instead of next-hop, Everything will be fine: I will receive route with new weight, so route-map is okey and works with other actions

static33rus commented 3 years ago

mistake in config