summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-12-18 17:19:05 +0100
committerGitHub <noreply@github.com>2023-12-18 17:19:05 +0100
commitceec796a3d3d999ffca90e57fc42fd0fa3f21ec3 (patch)
treeb9fd44576821ab94308146130dd72367774993b9 /src
parentf991faab2c0d95cbec5d46996b154145955572d7 (diff)
parent8a17966ed7ed13a5da8a17e4d67b6f163d260088 (diff)
downloadvyos-1x-ceec796a3d3d999ffca90e57fc42fd0fa3f21ec3.tar.gz
vyos-1x-ceec796a3d3d999ffca90e57fc42fd0fa3f21ec3.zip
Merge pull request #2652 from vyos/mergify/bp/sagitta/pr-2627
T4163: Add BGP Monitoring Protocol BMP feature (backport #2627)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index 557f0a9e9..5a503a9b7 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -30,6 +30,7 @@ from vyos.template import render_to_string
from vyos.utils.dict import dict_search
from vyos.utils.network import get_interface_vrf
from vyos.utils.network import is_addr_assigned
+from vyos.utils.process import process_named_running
from vyos import ConfigError
from vyos import frr
from vyos import airbag
@@ -247,6 +248,19 @@ def verify(bgp):
if 'system_as' not in bgp:
raise ConfigError('BGP system-as number must be defined!')
+ # Verify BMP
+ if 'bmp' in bgp:
+ # check bmp flag "bgpd -d -F traditional --daemon -A 127.0.0.1 -M rpki -M bmp"
+ if not process_named_running('bgpd', 'bmp'):
+ raise ConfigError(
+ f'"bmp" flag is not found in bgpd. Configure "set system frr bmp" and restart bgp process'
+ )
+ # check bmp target
+ if 'target' in bgp['bmp']:
+ for target, target_config in bgp['bmp']['target'].items():
+ if 'address' not in target_config:
+ raise ConfigError(f'BMP target "{target}" address must be defined!')
+
# Verify vrf on interface and bgp section
if 'interface' in bgp:
for interface in bgp['interface']: