diff options
author | aapostoliuk <a.apostoliuk@vyos.io> | 2024-02-01 11:55:47 +0200 |
---|---|---|
committer | aapostoliuk <a.apostoliuk@vyos.io> | 2024-02-01 12:18:50 +0200 |
commit | 32a13411f47beffcbe4b49a869c99cb42374d729 (patch) | |
tree | 312098d3657f6cd3acf0e8870757e16a91d05296 /src/conf_mode | |
parent | e13d901fd903f69dad4c02152ebb4ff4ad858c7c (diff) | |
download | vyos-1x-32a13411f47beffcbe4b49a869c99cb42374d729.tar.gz vyos-1x-32a13411f47beffcbe4b49a869c99cb42374d729.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.
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']): |