summaryrefslogtreecommitdiff
path: root/src/conf_mode/protocols_bgp.py
diff options
context:
space:
mode:
authorsever-sever <v.gletenko@vyos.io>2021-02-26 20:56:49 +0000
committersever-sever <v.gletenko@vyos.io>2021-02-26 20:56:49 +0000
commit38c0d78922d68b6385b44253913eaceceb6ac322 (patch)
tree93cf9d652f166a8eb3be420aff976a490d497fa1 /src/conf_mode/protocols_bgp.py
parentdcd4ae3fbf45169ca062df439a36f911e1bcfb8f (diff)
downloadvyos-1x-38c0d78922d68b6385b44253913eaceceb6ac322.tar.gz
vyos-1x-38c0d78922d68b6385b44253913eaceceb6ac322.zip
bgp: T3225: Move is_addr_assigned check to netighbor
Diffstat (limited to 'src/conf_mode/protocols_bgp.py')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index 185e5d42f..1ce2d3e7c 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -108,10 +108,6 @@ def verify(bgp):
if 'password' in peer_config and ' ' in peer_config['password']:
raise ConfigError('You can\'t use spaces in the password')
- # Check if neighbor address is assigned as system interface address
- if is_addr_assigned(peer):
- raise ConfigError(f'Can\'t configure local address as neighbor "{peer}"')
-
# Some checks can/must only be done on a neighbor and not a peer-group
if neighbor == 'neighbor':
# remote-as must be either set explicitly for the neighbor
@@ -119,6 +115,10 @@ def verify(bgp):
if not verify_remote_as(peer_config, asn_config):
raise ConfigError(f'Neighbor "{peer}" remote-as must be set!')
+ # Check if neighbor address is assigned as system interface address
+ if is_addr_assigned(peer):
+ raise ConfigError(f'Can\'t configure local address as neighbor "{peer}"')
+
for afi in ['ipv4_unicast', 'ipv6_unicast', 'l2vpn_evpn']:
# Bail out early if address family is not configured
if 'address_family' not in peer_config or afi not in peer_config['address_family']: