summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-06-28 22:45:11 +0200
committerChristian Poessinger <christian@poessinger.com>2021-06-28 22:45:11 +0200
commit5a5c0cd2e6f5d6c459a7f0e2da777834fb4362b2 (patch)
tree777b1657e4ad4b83cd1d34e72e8346a38db04b06 /src
parent09efa0550dd169e30a851513781b611dd84e9c79 (diff)
downloadvyos-1x-5a5c0cd2e6f5d6c459a7f0e2da777834fb4362b2.tar.gz
vyos-1x-5a5c0cd2e6f5d6c459a7f0e2da777834fb4362b2.zip
bgp: T3657: fix remote-as validator for IPv6 link-local peering
The "v6only" CLI tree was not taken into account during validation. vyos@vyos:~$ show configuration commands | grep bgp set protocols bgp local-as '200' set protocols bgp neighbor eth0.204 address-family ipv6-unicast set protocols bgp neighbor eth0.204 interface v6only remote-as '100' vyos@vyos:~$ show bgp ipv6 sum IPv6 Unicast Summary: BGP router identifier 172.18.254.201, local AS number 200 vrf-id 0 BGP table version 0 RIB entries 0, using 0 bytes of memory Peers 1, using 21 KiB of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt eth0.204 4 100 99 99 0 0 0 01:35:07 0 0 Total number of neighbors 1
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index 74253c2d7..95f277d74 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -88,6 +88,10 @@ def verify_remote_as(peer_config, bgp_config):
tmp = dict_search(f'peer_group.{peer_group_name}.remote_as', bgp_config)
if tmp: return tmp
+ if 'v6only' in peer_config['interface']:
+ if 'remote_as' in peer_config['interface']['v6only']:
+ return peer_config['interface']['v6only']['remote_as']
+
return None
def verify(bgp):