{# This logic is not used, just for completeness #}

/network-instance default type default

{# TODO support system0 for VXLAN #}
/interface lo0 subinterface 0
{% if 'ipv4' in loopback %}
 ipv4 address {{ loopback.ipv4 }} primary
{% endif %}
{% if 'ipv6' in loopback %}
 ipv6 address {{ loopback.ipv6 }}
{% endif %}
/network-instance default interface lo0.0

{% for l in interfaces|default([]) %}
/interface {{ l.ifname }}
{% if l.name is defined %}
 description "{{ l.name|replace('->','~') }}{{ " ("+l.role+")" if l.role is defined else '' }}"
{% elif l.type|default("") == "stub" %}
 description "Stub interface"
{% endif %}
subinterface 0
{% if l.ipv4 is defined %}
 ipv4 address {{ l.ipv4 }}
{% endif %}
{% if l.ipv6 is defined %}
 ipv6 address {{ l.ipv6 }}
 # ipv6 nd ra-interval 5
 # no ipv6 nd suppress-ra
{% endif %}
{% if l.bandwidth is defined %}
 # bandwidth {{ l.bandwidth  }}
{% endif %}
/network-instance default interface {{ l.ifname }}.0
{% endfor %}
