summaryrefslogtreecommitdiff
path: root/src/conf_mode/protocols_bgp.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-01 16:04:08 +0100
committerGitHub <noreply@github.com>2024-02-01 16:04:08 +0100
commit1e91e5ef9cc25a990e795e30859d058e3a25a9bc (patch)
tree4802911ab852c5d69504b2835cb29b4c0c5d0b88 /src/conf_mode/protocols_bgp.py
parent97db72a4e2c6cae5b0883495236c4c69c9a4187a (diff)
parent32a13411f47beffcbe4b49a869c99cb42374d729 (diff)
downloadvyos-1x-1e91e5ef9cc25a990e795e30859d058e3a25a9bc.tar.gz
vyos-1x-1e91e5ef9cc25a990e795e30859d058e3a25a9bc.zip
Merge pull request #2914 from aapostoliuk/T5930-circinus
bgp: T5930: Denied using rt vpn 'export/import' with 'both' together
Diffstat (limited to 'src/conf_mode/protocols_bgp.py')
-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']):