summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-21 20:16:40 +0200
committerChristian Poessinger <christian@poessinger.com>2022-04-21 20:16:40 +0200
commit9fae51a905436dd28853556f78dbae89ea536057 (patch)
tree5aa552a0a3905e473969f2ba14496f0fc51c6ff3 /src/conf_mode
parent200133efbd5bc496ccc77350068354b86d2b4f8e (diff)
downloadvyos-1x-9fae51a905436dd28853556f78dbae89ea536057.tar.gz
vyos-1x-9fae51a905436dd28853556f78dbae89ea536057.zip
bgp: T4385: peer-group member cannot override remote-as of peer-group
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index 8d9d3e99a..a9173ab87 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -164,6 +164,12 @@ def verify(bgp):
if not verify_remote_as(peer_config, bgp):
raise ConfigError(f'Neighbor "{peer}" remote-as must be set!')
+ # Peer-group member cannot override remote-as of peer-group
+ if 'peer_group' in peer_config:
+ peer_group = peer_config['peer_group']
+ if 'remote_as' in peer_config and 'remote_as' in bgp['peer_group'][peer_group]:
+ raise ConfigError(f'Peer-group member "{peer}" cannot override remote-as of peer-group "{peer_group}"!')
+
# Only checks for ipv4 and ipv6 neighbors
# Check if neighbor address is assigned as system interface address
vrf = None