summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorViacheslav Hletenko <vgletenko@vyos.io>2022-03-13 12:48:46 +0000
committerViacheslav Hletenko <vgletenko@vyos.io>2022-03-13 12:48:46 +0000
commita7a7e38049d4601d55dd032b7d3aecf96c7e8781 (patch)
treed4f8c5d5ca2e7c7ab002b0fc751d9f8ab73ea143 /src/conf_mode
parent56febd155792b579d88281940acc97f95a10a712 (diff)
downloadvyos-1x-a7a7e38049d4601d55dd032b7d3aecf96c7e8781.tar.gz
vyos-1x-a7a7e38049d4601d55dd032b7d3aecf96c7e8781.zip
bgp: T4290: Add verify source-interface for none ip neighbor
When we use neighbor as interface we must not use option 'source-interface' for example: neighbor eth0 source-interface eth0 Such option can be used for IP/IPv6 neighbors
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index d8704727c..9e59177a8 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -166,6 +166,8 @@ def verify(bgp):
raise ConfigError(f'peer-group must be set under the interface node of "{peer}"')
if 'remote_as' in peer_config:
raise ConfigError(f'remote-as must be set under the interface node of "{peer}"')
+ if 'source_interface' in peer_config['interface']:
+ raise ConfigError(f'"source-interface" option not allowed for neighbor "{peer}"')
for afi in ['ipv4_unicast', 'ipv4_multicast', 'ipv4_labeled_unicast', 'ipv4_flowspec',
'ipv6_unicast', 'ipv6_multicast', 'ipv6_labeled_unicast', 'ipv6_flowspec',