[zebra.conf] Avoid zebra crash upon empty configuration (#2203)

This commit is contained in:
Taoyu Li 2018-10-28 22:32:31 -07:00 committed by lguohan
parent 1ab23016fb
commit 6a37365d93

View File

@ -52,9 +52,11 @@ ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200
{% endfor %}
{% endif %}
! Set ip source to loopback for bgp learned routes
{% if lo_ipv4_addrs|length > 0 -%}
route-map RM_SET_SRC permit 10
set src {{ lo_ipv4_addrs[0] | ip }}
!
{% endif %}
{% if lo_ipv6_addrs|length > 0 %}
route-map RM_SET_SRC6 permit 10
set src {{ lo_ipv6_addrs[0] | ip }}