2023-11-20 11:56:34 +00:00
|
|
|
{# Keep vmbr0 named as is and in the main interfaces file so Proxmox can find it. #}
|
|
|
|
{% set bridge = interfaces | selectattr('type') | selectattr('type.value', '==', 'bridge') | first %}
|
|
|
|
{% set my_vlan_ids = bridge.tagged_vlans | default([]) | map(attribute='vid') | sort -%}
|
2023-10-18 13:01:02 +00:00
|
|
|
|
|
|
|
# Bridge for V(X)LANs.
|
2023-11-20 11:56:34 +00:00
|
|
|
auto {{ bridge.name }}
|
|
|
|
iface {{ bridge.name }} inet manual
|
2023-10-18 13:01:02 +00:00
|
|
|
bridge-vlan-aware yes
|
2023-10-19 08:18:50 +00:00
|
|
|
bridge-ports regex (vni.*)
|
2023-10-18 13:01:02 +00:00
|
|
|
bridge-stp off
|
|
|
|
bridge-fd 0
|
|
|
|
|
2023-11-20 11:56:34 +00:00
|
|
|
{% for vid in my_vlan_ids %}
|
|
|
|
auto vni{{ vid }}
|
|
|
|
iface vni{{ vid }} inet static
|
|
|
|
vxlan-id {{ vid }}
|
|
|
|
bridge-access {{ vid }}
|
2023-10-18 13:01:02 +00:00
|
|
|
mstpctl-bpduguard yes
|
|
|
|
mstpctl-portbpdufilter yes
|
|
|
|
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
# In place of vni* interfaces above this should work also but does not.
|
|
|
|
# Might start working after proxmox upgrades their ifupdown2.
|
|
|
|
#auto vxlan
|
|
|
|
#iface vxlan inet static
|
2023-11-20 11:56:34 +00:00
|
|
|
# bridge-vlan-vni-map {{ my_vlan_ids | zip(my_vlan_ids) | map('join', '=') | join(' ') }}
|
2023-10-18 13:01:02 +00:00
|
|
|
# bridge-learning off
|
|
|
|
|
|
|
|
source /etc/network/interfaces.d/*
|