access: support native VLAN on tagged interfaces for D-Link switches

This commit is contained in:
Timotej Lazar 2025-02-10 17:07:32 +01:00
parent f57023b0f0
commit dd30e2ab1c
2 changed files with 10 additions and 3 deletions

View file

@ -39,7 +39,14 @@ interface {{ iface.name }}
{%+ elif iface.mode and iface.mode.value == 'tagged' %}
switchport mode trunk
switchport trunk allowed vlan {{ (iface.tagged_vlans or vlans) | map(attribute='vid') | compact_numlist }}
{% if iface.untagged_vlan %}
{% set iface_vlans = (iface.tagged_vlans or vlans) + [iface.untagged_vlan] %}
switchport trunk native vlan {{ iface.untagged_vlan.vid }}
{% else %}
{% set iface_vlans = (iface.tagged_vlans or vlans) %}
no switchport trunk native vlan
{% endif %}
switchport trunk allowed vlan {{ iface_vlans | map(attribute='vid') | compact_numlist }}
{%+ else %}
@ -99,4 +106,4 @@ no ip dhcp snooping
ip route 0.0.0.0 0.0.0.0 {{ mgmt.gw | ipaddr('address') }} primary
{% endif %}
no ddp
no ddp