@@ -32,16 +32,15 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
32
32
bgp graceful-restart
33
33
{% endif %}
34
34
{% for (name , prefix ) in LOOPBACK_INTERFACE %}
35
- {# TODO: use v4 lo for backward compatibility, will revisit the case with multiple lo interfaces #}
36
- {% if prefix | ipv 4 %}
35
+ {% if prefix | ipv 4 and name == 'Loopback0' %}
37
36
bgp router-id {{ prefix | ip }}
38
37
{% endif %}
39
38
{% endfor %}
40
39
{# advertise loopback #}
41
40
{% for (name , prefix ) in LOOPBACK_INTERFACE %}
42
- {% if prefix | ipv 4 %}
41
+ {% if prefix | ipv 4 and name == 'Loopback0' %}
43
42
network {{ prefix | ip }}/32
44
- {% elif prefix | ipv 6 %}
43
+ {% elif prefix | ipv 6 and name == 'Loopback0' %}
45
44
address-family ipv6
46
45
network {{ prefix | ip }}/64
47
46
exit-address-family
@@ -97,7 +96,11 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
97
96
neighbor {{ bgp_peer['name'] }} remote-as {{ deployment_id_asn_map[DEVICE_METADATA['localhost'] ['deployment_id']] }}
98
97
neighbor {{ bgp_peer['name'] }} ebgp-multihop 255
99
98
neighbor {{ bgp_peer['name'] }} soft-reconfiguration inbound
100
- neighbor {{ bgp_peer['name'] }} update-source Loopback0
99
+ {% for (name , prefix ) in LOOPBACK_INTERFACE %}
100
+ {% if name == 'Loopback1' %}
101
+ neighbor {{ bgp_peer['name'] }} update-source {{ prefix | ip }}
102
+ {% endif %}
103
+ {% endfor %}
101
104
neighbor {{ bgp_peer['name'] }} route-map FROM_BGP_SPEAKER_V4 in
102
105
neighbor {{ bgp_peer['name'] }} route-map TO_BGP_SPEAKER_V4 out
103
106
{% for ip_range in bgp_peer ['ip_range' ] %}
0 commit comments