From 15d2358f5fef5389b8e0ee602344496a6895efaa Mon Sep 17 00:00:00 2001 From: Pavel Shirshov Date: Wed, 27 Nov 2019 15:14:42 -0800 Subject: [PATCH 1/3] Enable ipv6 prefixes over ipv4 BGPMON session --- dockers/docker-fpm-quagga/bgpd.conf.j2 | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/dockers/docker-fpm-quagga/bgpd.conf.j2 b/dockers/docker-fpm-quagga/bgpd.conf.j2 index 74d68ac5d73d..5bed20877a43 100644 --- a/dockers/docker-fpm-quagga/bgpd.conf.j2 +++ b/dockers/docker-fpm-quagga/bgpd.conf.j2 @@ -24,9 +24,9 @@ route-map FROM_BGP_SPEAKER_V4 permit 10 route-map TO_BGP_SPEAKER_V4 deny 10 ! {% if BGP_MONITORS is defined and BGP_MONITORS|length > 0 %} -route-map FROM_BGPMON_V4 deny 10 +route-map FROM_BGPMON deny 10 ! -route-map TO_BGPMON_V4 permit 10 +route-map TO_BGPMON permit 10 ! {% endif %} router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} @@ -102,22 +102,25 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% endblock bgp_peers_with_range %} {% block bgp_monitors %} {% if BGP_MONITORS is defined and BGP_MONITORS|length > 0 %} - neighbor BGPMON_V4 peer-group - neighbor BGPMON_V4 activate + neighbor BGPMON peer-group + neighbor BGPMON activate {% for (name, prefix) in LOOPBACK_INTERFACE %} {% if prefix | ipv4 and name == 'Loopback0' %} - neighbor BGPMON_V4 update-source {{ prefix | ip }} + neighbor BGPMON update-source {{ prefix | ip }} {% endif %} {% endfor %} - neighbor BGPMON_V4 route-map FROM_BGPMON_V4 in - neighbor BGPMON_V4 route-map TO_BGPMON_V4 out - neighbor BGPMON_V4 send-community - neighbor BGPMON_V4 maximum-prefix 1 + neighbor BGPMON route-map FROM_BGPMON in + neighbor BGPMON route-map TO_BGPMON out + neighbor BGPMON send-community + neighbor BGPMON maximum-prefix 1 {% for neighbor_addr, bgp_session in BGP_MONITORS.items() %} neighbor {{ neighbor_addr }} remote-as {{ DEVICE_METADATA['localhost']['bgp_asn'] }} - neighbor {{ neighbor_addr }} peer-group BGPMON_V4 + neighbor {{ neighbor_addr }} peer-group BGPMON neighbor {{ neighbor_addr }} description {{ bgp_session['name'] }} neighbor {{ neighbor_addr }} activate + address-family ipv6 + neighbor {{ neighbor_addr }} activate + exit-address-family {% endfor %} {% endif %} {% endblock bgp_monitors %} From db1133b71be6a79baa5bb45ad5ae1ddb833034b3 Mon Sep 17 00:00:00 2001 From: Pavel Shirshov Date: Wed, 27 Nov 2019 15:16:47 -0800 Subject: [PATCH 2/3] Fix testcases --- .../tests/sample_output/bgpd_quagga.conf | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/sonic-config-engine/tests/sample_output/bgpd_quagga.conf b/src/sonic-config-engine/tests/sample_output/bgpd_quagga.conf index 4a9e59039144..ee443e7454c2 100644 --- a/src/sonic-config-engine/tests/sample_output/bgpd_quagga.conf +++ b/src/sonic-config-engine/tests/sample_output/bgpd_quagga.conf @@ -16,9 +16,9 @@ route-map FROM_BGP_SPEAKER_V4 permit 10 ! route-map TO_BGP_SPEAKER_V4 deny 10 ! -route-map FROM_BGPMON_V4 deny 10 +route-map FROM_BGPMON deny 10 ! -route-map TO_BGPMON_V4 permit 10 +route-map TO_BGPMON permit 10 ! router bgp 65100 bgp log-neighbor-changes @@ -32,17 +32,20 @@ router bgp 65100 network fc00:1::32/64 exit-address-family network 192.168.0.1/27 - neighbor BGPMON_V4 peer-group - neighbor BGPMON_V4 activate - neighbor BGPMON_V4 update-source 10.1.0.32 - neighbor BGPMON_V4 route-map FROM_BGPMON_V4 in - neighbor BGPMON_V4 route-map TO_BGPMON_V4 out - neighbor BGPMON_V4 send-community - neighbor BGPMON_V4 maximum-prefix 1 + neighbor BGPMON peer-group + neighbor BGPMON activate + neighbor BGPMON update-source 10.1.0.32 + neighbor BGPMON route-map FROM_BGPMON_V4 in + neighbor BGPMON route-map TO_BGPMON_V4 out + neighbor BGPMON send-community + neighbor BGPMON maximum-prefix 1 neighbor 10.20.30.40 remote-as 65100 - neighbor 10.20.30.40 peer-group BGPMON_V4 + neighbor 10.20.30.40 peer-group BGPMON neighbor 10.20.30.40 description BGPMonitor neighbor 10.20.30.40 activate + address-family ipv6 + neighbor 10.20.30.40 activate + exit-address-family ! maximum-paths 64 ! From d3463d5f1b639c5e2d17c9fc62de1a9f7dbb0620 Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Wed, 27 Nov 2019 15:20:49 -0800 Subject: [PATCH 3/3] Update bgpd_quagga.conf --- src/sonic-config-engine/tests/sample_output/bgpd_quagga.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sonic-config-engine/tests/sample_output/bgpd_quagga.conf b/src/sonic-config-engine/tests/sample_output/bgpd_quagga.conf index ee443e7454c2..273d837865ef 100644 --- a/src/sonic-config-engine/tests/sample_output/bgpd_quagga.conf +++ b/src/sonic-config-engine/tests/sample_output/bgpd_quagga.conf @@ -35,8 +35,8 @@ router bgp 65100 neighbor BGPMON peer-group neighbor BGPMON activate neighbor BGPMON update-source 10.1.0.32 - neighbor BGPMON route-map FROM_BGPMON_V4 in - neighbor BGPMON route-map TO_BGPMON_V4 out + neighbor BGPMON route-map FROM_BGPMON in + neighbor BGPMON route-map TO_BGPMON out neighbor BGPMON send-community neighbor BGPMON maximum-prefix 1 neighbor 10.20.30.40 remote-as 65100