proxmox: use multiple non-VLAN-aware bridges

The Proxmox SDN feature does not play nice with our FRR and VXLAN setup.
With a single bridge we can’t have interface aliases. So use a bridge
for each VLAN. Actually don’t even have VLANs, just bridges mainlined
into VXLAN tunnels.

Read the list of VLANs carried by Proxmox nodes from a custom field on
the cluster in NetBox. Remove the vmbr0 device from individual nodes.
This commit is contained in:
Timotej Lazar 2024-02-20 16:40:13 +01:00
parent c1344e8f59
commit fbfdc83ee5

View file

@ -1,30 +1,22 @@
{# 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 -%}
{% set my_cluster = query('netbox.netbox.nb_lookup', 'clusters', raw_data=true,
api_filter='name='~cluster) | first -%}
# Bridge for V(X)LANs.
auto {{ bridge.name }}
iface {{ bridge.name }} inet manual
bridge-vlan-aware yes
bridge-ports regex (vni.*)
# bridges must be named vmbrN for proxmox to care
{% for vlan in my_cluster.custom_fields.vlans | sort(attribute='vid') %}
auto vmbr{{ vlan.vid }}
iface vmbr{{ vlan.vid }} inet manual
# {{ vlan.name }}
bridge-vlan-aware no
bridge-ports vni{{ vlan.vid }}
bridge-stp off
bridge-fd 0
{% for vid in my_vlan_ids %}
auto vni{{ vid }}
iface vni{{ vid }} inet static
vxlan-id {{ vid }}
bridge-access {{ vid }}
auto vni{{ vlan.vid }}
iface vni{{ vlan.vid }} inet static
vxlan-id {{ vlan.vid }}
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
# bridge-vlan-vni-map {{ my_vlan_ids | zip(my_vlan_ids) | map('join', '=') | join(' ') }}
# bridge-learning off
source /etc/network/interfaces.d/*