diff options
author | aapostoliuk <a.apostoliuk@vyos.io> | 2024-02-01 11:55:47 +0200 |
---|---|---|
committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2024-02-01 15:05:14 +0000 |
commit | cd5abd1a0eb5ca162d1e05157411423382d43170 (patch) | |
tree | 14d07df760d6000f2137755d0ebbd49f83b48d6d /src/conf_mode | |
parent | f87b69095028ce49892e8d33c013e1a04bae08e7 (diff) | |
download | vyos-1x-cd5abd1a0eb5ca162d1e05157411423382d43170.tar.gz vyos-1x-cd5abd1a0eb5ca162d1e05157411423382d43170.zip |
bgp: T5930: Denied using rt vpn 'export/import' with 'both' together
Denied using command 'route-target vpn export/import'
with 'both' together in bgp configuration.
(cherry picked from commit 32a13411f47beffcbe4b49a869c99cb42374d729)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/protocols_bgp.py | 10 |
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']): |