diff options
author | Daniil Baturin <daniil@vyos.io> | 2025-05-01 14:28:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-01 14:28:25 +0100 |
commit | 625c6a1ad6a37a808ec766000cedae827e53daf1 (patch) | |
tree | a452bdc77ca347dd3fa7f7da4cadf1ce654a4ae9 /src | |
parent | 41109339e1cf25d322981da3505340926dbb0512 (diff) | |
parent | ea830dae01cfb898857fc0b639f46bc494fa411a (diff) | |
download | vyos-1x-625c6a1ad6a37a808ec766000cedae827e53daf1.tar.gz vyos-1x-625c6a1ad6a37a808ec766000cedae827e53daf1.zip |
Merge pull request #4452 from Hanarion/patch-1
T7364: Fixing Route reflector client check not working for peer-group
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/protocols_bgp.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py index 53e83c3b4..a0c853bce 100755 --- a/src/conf_mode/protocols_bgp.py +++ b/src/conf_mode/protocols_bgp.py @@ -413,15 +413,19 @@ def verify(config_dict): verify_route_map(afi_config['route_map'][tmp], bgp) if 'route_reflector_client' in afi_config: - peer_group_as = peer_config.get('remote_as') + peer_as = peer_config.get('remote_as') - if peer_group_as is None or (peer_group_as != 'internal' and peer_group_as != bgp['system_as']): + if peer_as is not None and (peer_as != 'internal' and peer_as != bgp['system_as']): raise ConfigError('route-reflector-client only supported for iBGP peers') else: + # Check into the peer group for the remote as, if we are in a peer group, check in peer itself if 'peer_group' in peer_config: peer_group_as = dict_search(f'peer_group.{peer_group}.remote_as', bgp) - if peer_group_as is None or (peer_group_as != 'internal' and peer_group_as != bgp['system_as']): - raise ConfigError('route-reflector-client only supported for iBGP peers') + elif neighbor == 'peer_group': + peer_group_as = peer_config.get('remote_as') + + if peer_group_as is None or (peer_group_as != 'internal' and peer_group_as != bgp['system_as']): + raise ConfigError('route-reflector-client only supported for iBGP peers') # T5833 not all AFIs are supported for VRF if 'vrf' in bgp and 'address_family' in peer_config: |