Page MenuHomeVyOS Platform

VRF BGP daemon route-map command missing
Closed, ResolvedPublicBUG

Description

Hey guys,

global route-map setting for bgp daemon within VRF is missing.

BGP daemon default vrf:

set protocols bgp route-map 'route-map'

BGP deamon within VRF

vyos@# set vrf name vrf-name protocols bgp route

  Configuration path: vrf name internet protocols bgp [route] is not valid

Looks like this option is missing. Global route-map is perfect to rewrite source ip.

Can you fix that?

THanks

Details

Difficulty level
Easy (less than an hour)
Version
VyOS 1.4-rolling-202105050912
Why the issue appeared?
Other
Is it a breaking change?
Perfectly compatible

Event Timeline

@ernstjo
Is it supported by FRR?
Can you provide an example?

Update I find an example

!
vrf foo
 ip protocol bgp route-map RMAP
 exit-vrf
!
router bgp 64500 vrf foo
 no bgp ebgp-requires-policy
 no bgp network import-check
!
c-po changed the task status from Open to In progress.May 6 2021, 5:06 PM
c-po claimed this task.

It seems a bug with frr-reload

!
router bgp 64500 vrf foo
 no bgp ebgp-requires-policy
 no bgp network import-check
 exit
!
vrf foo
 ip protocol bgp route-map RMAP
 exit-vrf
!
route-map RMAP permit 10
 set tag 555
!
line vty
!

It can't exit correctly from section vrf bgp

root@r6-roll:/home/vyos#  /usr/lib/frr/frr-reload.py --daemon=bgpd --test frr.txt --debug 
2021-05-06 16:58:01,551  INFO: Called via "Namespace(bindir='/usr/bin', confdir='/etc/frr', daemon='bgpd', debug=True, filename='frr.txt', input=None, log_level='info', overwrite=False, pathspace=None, reload=False, rundir='/var/run/frr', stdout=False, test=True, vty_socket=None)"
2021-05-06 16:58:01,551  INFO: Loading Config object from file frr.txt
2021-05-06 16:58:01,650 DEBUG: LINE router bgp 64500 vrf foo                          : entering new context, ['router bgp 64500 vrf foo']                      
2021-05-06 16:58:01,650 DEBUG: LINE no bgp ebgp-requires-policy                       : append to current_context_lines, ['router bgp 64500 vrf foo']                      
2021-05-06 16:58:01,650 DEBUG: LINE no bgp network import-check                       : append to current_context_lines, ['router bgp 64500 vrf foo']                      
2021-05-06 16:58:01,650 DEBUG: LINE vrf foo                                           : append to current_context_lines, ['router bgp 64500 vrf foo']  <=== THERE ===                  
2021-05-06 16:58:01,650 DEBUG: LINE ip protocol bgp route-map RMAP                    : append to current_context_lines, ['router bgp 64500 vrf foo']  <=== THERE ===                     
2021-05-06 16:58:01,651 DEBUG: LINE exit-vrf                                          : append to current_context_lines, ['router bgp 64500 vrf foo']  <=== THERE ===                     
2021-05-06 16:58:01,651 DEBUG: LINE end                                               : exiting old context, []                                                
2021-05-06 16:58:01,651 DEBUG: LINE route-map RMAP permit 10                          : entering new context, ['route-map RMAP permit 10']                      
2021-05-06 16:58:01,651 DEBUG: LINE set tag 555                                       : append to current_context_lines, ['route-map RMAP permit 10']                      
2021-05-06 16:58:01,651 DEBUG: LINE end                                               : exiting old context, ['route-map RMAP permit 10']                      
2021-05-06 16:58:01,651 DEBUG: LINE line vty                                          : entering new context, ['line vty']                                      
2021-05-06 16:58:01,651 DEBUG: LINE end                                               : exiting old context, ['line vty']                                      
2021-05-06 16:58:01,651  INFO: Loading Config object from vtysh show running
2021-05-06 16:58:01,839 DEBUG: LINE frr version 7.5.1-20210505-00-ge1a73c5ce          : entering new context, ['frr version 7.5.1-20210505-00-ge1a73c5ce']      
2021-05-06 16:58:01,839 DEBUG: LINE frr defaults traditional                          : entering new context, ['frr defaults traditional']                      
2021-05-06 16:58:01,839 DEBUG: LINE hostname r6-roll                                  : entering new context, ['hostname r6-roll']                              
2021-05-06 16:58:01,839 DEBUG: LINE service integrated-vtysh-config                   : entering new context, ['service integrated-vtysh-config']               
2021-05-06 16:58:01,839 DEBUG: LINE router bgp 64500 vrf foo                          : entering new context, ['router bgp 64500 vrf foo']                      
2021-05-06 16:58:01,839 DEBUG: LINE no bgp ebgp-requires-policy                       : append to current_context_lines, ['router bgp 64500 vrf foo']                      
2021-05-06 16:58:01,839 DEBUG: LINE no bgp network import-check                       : append to current_context_lines, ['router bgp 64500 vrf foo']                      
2021-05-06 16:58:01,839 DEBUG: LINE end                                               : exiting old context, ['router bgp 64500 vrf foo']                      
2021-05-06 16:58:01,839 DEBUG: LINE route-map RMAP permit 10                          : entering new context, ['route-map RMAP permit 10']                      
2021-05-06 16:58:01,839 DEBUG: LINE set tag 555                                       : append to current_context_lines, ['route-map RMAP permit 10']                      
2021-05-06 16:58:01,839 DEBUG: LINE end                                               : exiting old context, ['route-map RMAP permit 10']                      
2021-05-06 16:58:01,839 DEBUG: LINE line vty                                          : entering new context, ['line vty']                                      
2021-05-06 16:58:01,839 DEBUG: LINE end                                               : exiting old context, ['line vty']                                      
2021-05-06 16:58:01,840  INFO: "frr version 7.5.1-20210505-00-ge1a73c5ce" cannot be removed
2021-05-06 16:58:01,840  INFO: "frr defaults traditional" cannot be removed
2021-05-06 16:58:01,840  INFO: "service integrated-vtysh-config" cannot be removed

Lines To Delete
===============
no hostname r6-roll

Lines To Add
============
router bgp 64500 vrf foo
 vrf foo
router bgp 64500 vrf foo
 ip protocol bgp route-map RMAP

@Viacheslav it must be added in the proper order and contexts need to be entered - exited appropriately

I'm going to implement this for the other VRF routing protocols, too

c-po triaged this task as Low priority.May 6 2021, 5:30 PM
c-po changed Difficulty level from Unknown (require assessment) to Easy (less than an hour).
c-po changed Why the issue appeared? from Will be filled on close to Other.
c-po changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.