In progress update for non-VXLAN roles

netbox
Dan Ankers 2024-06-29 10:42:13 +01:00
parent 8b8733e8f9
commit 91bf65108f
1 changed files with 18 additions and 0 deletions

View File

@ -85,6 +85,11 @@ chassis {
{% if interface.mtu and not interface.lag %}
mtu {{ interface.mtu }};
{% endif %}
{% if interface.tags.filter(name__in=['vpls-core','vpls-edge']).count() %}
flexible-vlan-tagging;
native-vlan-id 1;
encapsulation flexible-ethernet-services;
{% endif %}
{% if interface.lag %}
ether-options {
802.3ad {{ interface.lag.name }};
@ -112,11 +117,15 @@ chassis {
{% endif %}
{% if interface.ip_addresses.count() > 0 %}
unit 0 {
{% if interface.tags.filter(name__in=['vpls-core']).count() %}
vlan-id 1;
{% endif %}
family inet {
{% if interface.ip_addresses.first().status == 'reserved' %}inactive: {% endif %}address {{ interface.ip_addresses.first().address }};
}
}
{% endif %}
{% if device.role.name in ['Leaf','Spine'] %}
{% if interface.mode != '' %}
unit 0 {
family ethernet-switching {
@ -139,6 +148,15 @@ chassis {
storm-control default;
}
}
{% elif device.role.name in ['Provider Core'] %}
{% if interface.tags.filter(name__in=['vpls-edge']).count() %}
{% for vlan in interface.tagged_vlans %}
unit {{ vlan.vid }} {
encapsulation vlan-vpls;
vlan-id {{ vlan.vid }};
}
{% endfor %}
{% endif %}
{% endif %}
}
{%- endmacro %}