summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-01 17:13:31 +0100
committerGitHub <noreply@github.com>2024-02-01 17:13:31 +0100
commit7f17daba3575463d0f5be1761d801a8376716be0 (patch)
treee2042bfccb4a76bc5e0dbb4ecc8395d09efeaab7 /src/conf_mode
parent76f85f5cfe0a9c7376ee865c8f6916f107f7b18a (diff)
parentcd5abd1a0eb5ca162d1e05157411423382d43170 (diff)
downloadvyos-1x-7f17daba3575463d0f5be1761d801a8376716be0.tar.gz
vyos-1x-7f17daba3575463d0f5be1761d801a8376716be0.zip
Merge pull request #2915 from vyos/mergify/bp/sagitta/pr-2914
bgp: T5930: Denied using rt vpn 'export/import' with 'both' together (backport #2914)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index f6f3370c3..d90dfe45b 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2020-2023 VyOS maintainers and contributors
+# Copyright (C) 2020-2024 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -509,6 +509,14 @@ def verify(bgp):
if verify_vrf_as_import(vrf_name, afi, bgp['dependent_vrfs']):
raise ConfigError(
'Command "import vrf" conflicts with "route-target vpn both" command!')
+ if dict_search('route_target.vpn.export', afi_config):
+ raise ConfigError(
+ 'Command "route-target vpn export" conflicts '\
+ 'with "route-target vpn both" command!')
+ if dict_search('route_target.vpn.import', afi_config):
+ raise ConfigError(
+ 'Command "route-target vpn import" conflicts '\
+ 'with "route-target vpn both" command!')
if dict_search('route_target.vpn.import', afi_config):
if verify_vrf_as_import(vrf_name, afi, bgp['dependent_vrfs']):