2018-10-15 15:00:57 -05:00
|
|
|
{% set ipv4_addresses = [] %}
|
|
|
|
{% set ipv6_addresses = [] %}
|
2018-10-25 15:13:26 -05:00
|
|
|
{% set ipv4_loopback_addresses = [] %}
|
|
|
|
{% set ipv6_loopback_addresses = [] %}
|
2020-08-31 19:35:48 -05:00
|
|
|
{% if DEVICE_METADATA['localhost']['sub_role'] == 'FrontEnd' or DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd'%}
|
|
|
|
{% set loopback_intf_names = ['Loopback0', 'Loopback4096'] %}
|
|
|
|
{% else %}
|
2021-04-07 11:58:12 -05:00
|
|
|
{% set loopback_intf_names = ['Loopback0', 'Loopback2', 'Loopback3'] %}
|
2020-08-31 19:35:48 -05:00
|
|
|
{% endif %}
|
2019-06-10 16:02:55 -05:00
|
|
|
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
|
2020-08-31 19:35:48 -05:00
|
|
|
{%- if prefix | ipv4 and name in loopback_intf_names %}
|
2018-10-15 15:00:57 -05:00
|
|
|
{%- set ipv4_addresses = ipv4_addresses.append(prefix) %}
|
2018-10-25 15:13:26 -05:00
|
|
|
{%- set ipv4_loopback_addresses = ipv4_loopback_addresses.append(prefix) %}
|
2017-09-30 13:03:32 -05:00
|
|
|
{%- endif %}
|
2020-08-31 19:35:48 -05:00
|
|
|
{%- if prefix | ipv6 and name in loopback_intf_names %}
|
2018-10-15 15:00:57 -05:00
|
|
|
{%- set ipv6_addresses = ipv6_addresses.append(prefix) %}
|
2018-10-25 15:13:26 -05:00
|
|
|
{%- set ipv6_loopback_addresses = ipv6_loopback_addresses.append(prefix) %}
|
2018-10-15 15:00:57 -05:00
|
|
|
{%- endif %}
|
|
|
|
{% endfor %}
|
2019-06-10 16:02:55 -05:00
|
|
|
{% for (name, prefix) in INTERFACE|pfx_filter %}
|
2018-10-15 15:00:57 -05:00
|
|
|
{%- if prefix | ipv4 %}
|
|
|
|
{%- set ipv4_addresses = ipv4_addresses.append(prefix) %}
|
|
|
|
{%- endif %}
|
|
|
|
{%- if prefix | ipv6 %}
|
|
|
|
{%- set ipv6_addresses = ipv6_addresses.append(prefix) %}
|
|
|
|
{%- endif %}
|
|
|
|
{% endfor %}
|
2019-06-10 16:02:55 -05:00
|
|
|
{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %}
|
2018-10-15 15:00:57 -05:00
|
|
|
{%- if prefix | ipv4 %}
|
|
|
|
{%- set ipv4_addresses = ipv4_addresses.append(prefix) %}
|
|
|
|
{%- endif %}
|
|
|
|
{%- if prefix | ipv6 %}
|
|
|
|
{%- set ipv6_addresses = ipv6_addresses.append(prefix) %}
|
|
|
|
{%- endif %}
|
|
|
|
{% endfor %}
|
2019-06-10 16:02:55 -05:00
|
|
|
{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %}
|
2018-10-15 15:00:57 -05:00
|
|
|
{%- if prefix | ipv4 %}
|
|
|
|
{%- set ipv4_addresses = ipv4_addresses.append(prefix) %}
|
|
|
|
{%- endif %}
|
|
|
|
{%- if prefix | ipv6 %}
|
|
|
|
{%- set ipv6_addresses = ipv6_addresses.append(prefix) %}
|
|
|
|
{%- endif %}
|
2017-09-30 13:03:32 -05:00
|
|
|
{% endfor %}
|
2017-04-21 16:28:30 -05:00
|
|
|
[
|
2018-10-25 15:13:26 -05:00
|
|
|
{% if ipv4_loopback_addresses %}
|
2017-04-21 16:28:30 -05:00
|
|
|
{
|
|
|
|
"TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : {
|
|
|
|
"tunnel_type":"IPINIP",
|
2020-12-28 22:53:12 -06:00
|
|
|
"dst_ip":"{% for prefix in ipv4_addresses|sort %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}",
|
2018-10-15 15:00:57 -05:00
|
|
|
"dscp_mode":"uniform",
|
2021-04-07 11:58:12 -05:00
|
|
|
{% if "mlnx" in DEVICE_METADATA.localhost.platform %}
|
2018-10-15 15:00:57 -05:00
|
|
|
"ecn_mode":"standard",
|
|
|
|
{% else %}
|
|
|
|
"ecn_mode":"copy_from_outer",
|
|
|
|
{% endif %}
|
|
|
|
"ttl_mode":"pipe"
|
|
|
|
},
|
|
|
|
"OP": "SET"
|
2020-12-28 22:53:12 -06:00
|
|
|
}
|
2018-10-15 15:00:57 -05:00
|
|
|
{% endif %}
|
2018-10-25 15:13:26 -05:00
|
|
|
{% if ipv4_loopback_addresses and ipv6_loopback_addresses %} ,
|
2018-10-15 15:00:57 -05:00
|
|
|
{% endif %}
|
2018-10-25 15:13:26 -05:00
|
|
|
{% if ipv6_loopback_addresses %}
|
2018-10-15 15:00:57 -05:00
|
|
|
{
|
|
|
|
"TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : {
|
|
|
|
"tunnel_type":"IPINIP",
|
2020-12-28 22:53:12 -06:00
|
|
|
"dst_ip":"{% for prefix in ipv6_addresses|sort %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}",
|
2017-04-21 16:28:30 -05:00
|
|
|
"dscp_mode":"uniform",
|
2021-04-07 11:58:12 -05:00
|
|
|
{% if "mlnx" in DEVICE_METADATA.localhost.platform %}
|
2017-04-21 16:28:30 -05:00
|
|
|
"ecn_mode":"standard",
|
|
|
|
{% else %}
|
|
|
|
"ecn_mode":"copy_from_outer",
|
|
|
|
{% endif %}
|
|
|
|
"ttl_mode":"pipe"
|
|
|
|
},
|
|
|
|
"OP": "SET"
|
|
|
|
}
|
2018-10-15 15:00:57 -05:00
|
|
|
{% endif %}
|
2017-04-21 16:28:30 -05:00
|
|
|
]
|