From 7af546908fa6382f8839d9d9315b87237775e351 Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Thu, 18 Jul 2019 16:34:26 -0700 Subject: [PATCH] [bgp]: Fix isolate/unisolate command for ipv6 peers (#3183) * Fix isolate/unisolate command for ipv6 peers --- dockers/docker-fpm-frr/isolate.j2 | 6 ++++++ dockers/docker-fpm-frr/unisolate.j2 | 6 ++++++ dockers/docker-fpm-quagga/isolate.j2 | 6 ++++++ dockers/docker-fpm-quagga/unisolate.j2 | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/dockers/docker-fpm-frr/isolate.j2 b/dockers/docker-fpm-frr/isolate.j2 index cfcd023ea1..9d19f9f409 100755 --- a/dockers/docker-fpm-frr/isolate.j2 +++ b/dockers/docker-fpm-frr/isolate.j2 @@ -10,7 +10,13 @@ exit $? configure terminal router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% for neighbor_addr in BGP_NEIGHBOR %} +{% if neighbor_addr | ipv4 %} neighbor {{ neighbor_addr }} route-map ISOLATE out +{% else %} + address-family ipv6 + neighbor {{ neighbor_addr }} route-map ISOLATE out + exit-address-family +{% endif %} {% endfor %} exit exit diff --git a/dockers/docker-fpm-frr/unisolate.j2 b/dockers/docker-fpm-frr/unisolate.j2 index 2a0780745d..abd6a912c0 100755 --- a/dockers/docker-fpm-frr/unisolate.j2 +++ b/dockers/docker-fpm-frr/unisolate.j2 @@ -10,7 +10,13 @@ exit $? configure terminal router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% for neighbor_ip in BGP_NEIGHBOR %} +{% if neighbor_ip | ipv4 %} no neighbor {{ neighbor_ip }} route-map ISOLATE out +{% else %} + address-family ipv6 + no neighbor {{ neighbor_ip }} route-map ISOLATE out + exit-address-family +{% endif %} {% endfor %} exit exit diff --git a/dockers/docker-fpm-quagga/isolate.j2 b/dockers/docker-fpm-quagga/isolate.j2 index cfcd023ea1..9d19f9f409 100755 --- a/dockers/docker-fpm-quagga/isolate.j2 +++ b/dockers/docker-fpm-quagga/isolate.j2 @@ -10,7 +10,13 @@ exit $? configure terminal router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% for neighbor_addr in BGP_NEIGHBOR %} +{% if neighbor_addr | ipv4 %} neighbor {{ neighbor_addr }} route-map ISOLATE out +{% else %} + address-family ipv6 + neighbor {{ neighbor_addr }} route-map ISOLATE out + exit-address-family +{% endif %} {% endfor %} exit exit diff --git a/dockers/docker-fpm-quagga/unisolate.j2 b/dockers/docker-fpm-quagga/unisolate.j2 index 2a0780745d..abd6a912c0 100755 --- a/dockers/docker-fpm-quagga/unisolate.j2 +++ b/dockers/docker-fpm-quagga/unisolate.j2 @@ -10,7 +10,13 @@ exit $? configure terminal router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% for neighbor_ip in BGP_NEIGHBOR %} +{% if neighbor_ip | ipv4 %} no neighbor {{ neighbor_ip }} route-map ISOLATE out +{% else %} + address-family ipv6 + no neighbor {{ neighbor_ip }} route-map ISOLATE out + exit-address-family +{% endif %} {% endfor %} exit exit