sonic-buildimage/dockers/docker-orchagent/ipinip.json.j2
Taoyu Li bebb7a0fa2 [zebra.conf] Fix template issue with multiple lo addresses (#1662)
* [zebra.conf] Fix template issue with multiple lo addresses

* Add unitest for Loopback1
2018-05-01 20:53:47 -07:00

26 lines
874 B
Django/Jinja

{# only IPv4 decapsulation is supported #}
{% set ipv4_loopback_addresses = [] %}
{% for (name, prefix) in LOOPBACK_INTERFACE %}
{%- if prefix | ipv4 and name == 'Loopback0' %}
{%- set ipv4_loopback_addresses = ipv4_loopback_addresses.append(prefix) %}
{%- endif %}
{% endfor %}
[
{
"TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : {
"tunnel_type":"IPINIP",
"src_ip":"{{ ipv4_loopback_addresses | first | ip }}",
"dst_ip":"{% for prefix in ipv4_loopback_addresses %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}",
{% if "mlnx" in DEVICE_METADATA.localhost.platform %}
"dscp_mode":"uniform",
"ecn_mode":"standard",
{% else %}
"dscp_mode":"pipe",
"ecn_mode":"copy_from_outer",
{% endif %}
"ttl_mode":"pipe"
},
"OP": "SET"
}
]