From 91bf65108ffbb362ecdf72847ef96d39d9178774 Mon Sep 17 00:00:00 2001 From: Dan Ankers Date: Sat, 29 Jun 2024 10:42:13 +0100 Subject: [PATCH] In progress update for non-VXLAN roles --- juniper-macros.j2 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/juniper-macros.j2 b/juniper-macros.j2 index 67ef287..adc6b33 100644 --- a/juniper-macros.j2 +++ b/juniper-macros.j2 @@ -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 %}