Skip to content

Commit ea88cfd

Browse files
committed
Don't render parts related to Loopback0 ipv6 addresses if we don't have it configured
1 parent 5edd39e commit ea88cfd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2

+4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
!
1010
ip prefix-list PL_LoopbackV4 permit {{ get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback0") | ip }}/32
1111
!
12+
{% if get_ipv6_loopback_address(LOOPBACK_INTERFACE, "Loopback0") != 'None' %}
1213
ipv6 prefix-list PL_LoopbackV6 permit {{ get_ipv6_loopback_address(LOOPBACK_INTERFACE, "Loopback0") | replace('/128', '/64') | ip_network }}/64
14+
{% endif %}
1315
!
1416
!
1517
{% if DEVICE_METADATA['localhost']['type'] == 'InternalFrontend' %}
@@ -48,9 +50,11 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
4850
{# advertise loopback #}
4951
network {{ get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback0") | ip }}/32
5052
!
53+
{% if get_ipv6_loopback_address(LOOPBACK_INTERFACE, "Loopback0") != 'None' %}
5154
address-family ipv6
5255
network {{ get_ipv6_loopback_address(LOOPBACK_INTERFACE, "Loopback0") | ip }}/64
5356
exit-address-family
57+
{% endif %}
5458
{% endblock bgp_init %}
5559
!
5660
{% block vlan_advertisement %}

src/sonic-config-engine/tests/sample_output/t2-chassis-fe-bgpd.conf

-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ router bgp 4000 vrf VnetFE
5252
!
5353
ip prefix-list PL_LoopbackV4 permit 4.0.0.0/32
5454
!
55-
ipv6 prefix-list PL_LoopbackV6 permit Invalid ip address None/64
5655
!
5756
!
5857
!
@@ -71,9 +70,6 @@ router bgp 4000
7170
!
7271
network 4.0.0.0/32
7372
!
74-
address-family ipv6
75-
network None/64
76-
exit-address-family
7773
!
7874
!
7975
!

0 commit comments

Comments
 (0)