2017-03-02 13:33:46 -06:00
|
|
|
!
|
|
|
|
{% block banner %}
|
|
|
|
! =========== Managed by sonic-cfggen DO NOT edit manually! ====================
|
2017-09-12 16:13:27 -05:00
|
|
|
! generated by templates/quagga/zebra.conf.j2 using config DB data
|
2017-03-02 13:33:46 -06:00
|
|
|
! file: zebra.conf
|
|
|
|
!
|
|
|
|
{% endblock banner %}
|
|
|
|
!
|
|
|
|
{% block sys_init %}
|
2017-09-12 16:13:27 -05:00
|
|
|
hostname {{ DEVICE_METADATA['localhost']['hostname'] }}
|
2017-03-02 13:33:46 -06:00
|
|
|
password zebra
|
|
|
|
enable password zebra
|
|
|
|
{% endblock sys_init %}
|
|
|
|
!
|
|
|
|
{% block interfaces %}
|
|
|
|
! Enable link-detect (default disabled)
|
2019-06-10 16:02:55 -05:00
|
|
|
{% for (name, prefix) in INTERFACE|pfx_filter %}
|
2017-09-12 16:13:27 -05:00
|
|
|
interface {{ name }}
|
2017-03-30 17:25:31 -05:00
|
|
|
link-detect
|
|
|
|
!
|
|
|
|
{% endfor %}
|
2017-09-12 16:13:27 -05:00
|
|
|
{% for pc in PORTCHANNEL %}
|
|
|
|
interface {{ pc }}
|
2017-03-02 13:33:46 -06:00
|
|
|
link-detect
|
|
|
|
!
|
|
|
|
{% endfor %}
|
|
|
|
{% endblock interfaces %}
|
|
|
|
!
|
|
|
|
{% block default_route %}
|
|
|
|
! set static default route to mgmt gateway as a backup to learned default
|
2019-06-10 16:02:55 -05:00
|
|
|
{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %}
|
2017-09-12 16:13:27 -05:00
|
|
|
{% if prefix | ipv4 %}
|
|
|
|
ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2017-03-02 13:33:46 -06:00
|
|
|
{% endblock default_route %}
|
|
|
|
!
|
|
|
|
{% block source_loopback %}
|
2017-09-12 16:13:27 -05:00
|
|
|
{% set lo_ipv4_addrs = [] %}
|
2017-03-02 13:33:46 -06:00
|
|
|
{% set lo_ipv6_addrs = [] %}
|
2017-09-12 16:13:27 -05:00
|
|
|
{% if LOOPBACK_INTERFACE %}
|
2019-06-10 16:02:55 -05:00
|
|
|
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
|
2017-09-12 16:13:27 -05:00
|
|
|
{% if prefix | ipv6 %}
|
|
|
|
{% if lo_ipv6_addrs.append(prefix) %}
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
{% if lo_ipv4_addrs.append(prefix) %}
|
2017-03-02 13:33:46 -06:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2017-09-12 16:13:27 -05:00
|
|
|
! Set ip source to loopback for bgp learned routes
|
|
|
|
route-map RM_SET_SRC permit 10
|
|
|
|
set src {{ lo_ipv4_addrs[0] | ip }}
|
|
|
|
!
|
2017-03-02 13:33:46 -06:00
|
|
|
{% if lo_ipv6_addrs|length > 0 %}
|
|
|
|
route-map RM_SET_SRC6 permit 10
|
2017-09-12 16:13:27 -05:00
|
|
|
set src {{ lo_ipv6_addrs[0] | ip }}
|
2017-03-02 13:33:46 -06:00
|
|
|
!
|
|
|
|
{% endif %}
|
|
|
|
ip protocol bgp route-map RM_SET_SRC
|
|
|
|
!
|
|
|
|
{% if lo_ipv6_addrs|length > 0 %}
|
|
|
|
ipv6 protocol bgp route-map RM_SET_SRC6
|
|
|
|
!
|
|
|
|
{% endif %}
|
|
|
|
{% endblock source_loopback %}
|
|
|
|
!
|
|
|
|
{% block logging %}
|
|
|
|
log syslog informational
|
|
|
|
log facility local4
|
|
|
|
{% endblock logging %}
|
|
|
|
!
|
|
|
|
|