summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLandry JUGE <contact@landryjuge.com>2025-04-15 03:06:13 +0200
committerLandry JUGE <contact@landryjuge.com>2025-04-15 03:06:13 +0200
commitea830dae01cfb898857fc0b639f46bc494fa411a (patch)
tree7b32f4524b2c8bda62ae68e4a3a6b8d4aa39c314 /src
parent20887e6165c363062bd8edab40443f4ebc1b420f (diff)
downloadvyos-1x-ea830dae01cfb898857fc0b639f46bc494fa411a.tar.gz
vyos-1x-ea830dae01cfb898857fc0b639f46bc494fa411a.zip
T7364: Fixing no error when config is set to a peer group directly
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index 42f86064c..a0c853bce 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -418,10 +418,14 @@ def verify(config_dict):
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: