2020-04-23 11:42:22 -05:00
!
! template: bgpd/templates/general/instance.conf.j2
!
2019-10-24 09:35:14 -05:00
neighbor {{ neighbor_addr }} remote-as {{ bgp_session['asn'] }}
neighbor {{ neighbor_addr }} description {{ bgp_session['name'] }}
{# set the bgp neighbor timers if they have not default values #}
{% if (bgp_session['keepalive'] is defined and bgp_session['keepalive'] | int != 60)
or (bgp_session['holdtime'] is defined and bgp_session['holdtime'] | int != 180) %}
2020-06-25 16:54:02 -05:00
neighbor {{ neighbor_addr }} timers {{ bgp_session['keepalive'] | default("60") }} {{ bgp_session['holdtime'] | default("180") }}
2019-10-24 09:35:14 -05:00
{% endif %}
2020-04-23 11:42:22 -05:00
!
2020-11-05 12:01:43 -06:00
{% if 'admin_status' in bgp_session and bgp_session['admin_status'] == 'down' or 'admin_status' not in bgp_session and 'default_bgp_status' in CONFIG_DB__DEVICE_METADATA['localhost'] and CONFIG_DB__DEVICE_METADATA['localhost']['default_bgp_status'] == 'down' %}
2019-10-24 09:35:14 -05:00
neighbor {{ neighbor_addr }} shutdown
{% endif %}
2020-04-23 11:42:22 -05:00
!
2019-10-24 09:35:14 -05:00
{% if neighbor_addr | ipv4 %}
address-family ipv4
neighbor {{ neighbor_addr }} peer-group PEER_V4
2020-06-25 16:54:02 -05:00
!
2019-10-24 09:35:14 -05:00
{% elif neighbor_addr | ipv6 %}
address-family ipv6
neighbor {{ neighbor_addr }} peer-group PEER_V6
2020-06-25 16:54:02 -05:00
!
2019-10-24 09:35:14 -05:00
{% endif %}
2020-04-23 11:42:22 -05:00
!
2020-11-05 12:01:43 -06:00
{% if 'rrclient' in bgp_session and bgp_session['rrclient'] | int != 0 %}
2019-10-24 09:35:14 -05:00
neighbor {{ neighbor_addr }} route-reflector-client
2020-06-25 16:54:02 -05:00
{% endif %}
2020-04-23 11:42:22 -05:00
!
2020-11-05 12:01:43 -06:00
{% if 'nhopself' in bgp_session and bgp_session['nhopself'] | int != 0 %}
2019-10-24 09:35:14 -05:00
neighbor {{ neighbor_addr }} next-hop-self
2020-06-25 16:54:02 -05:00
{% endif %}
!
neighbor {{ neighbor_addr }} activate
exit-address-family
2020-04-23 11:42:22 -05:00
!
{% if bgp_session["asn"] == bgp_asn and CONFIG_DB__DEVICE_METADATA['localhost']['type'] == "SpineChassisFrontendRouter" %}
2019-10-31 20:22:58 -05:00
address-family l2vpn evpn
neighbor {{ neighbor_addr }} activate
advertise-all-vni
exit-address-family
2019-10-24 09:35:14 -05:00
{% endif %}
2020-04-23 11:42:22 -05:00
!
! end of template: bgpd/templates/general/instance.conf.j2
!