From 428ce8e80f7d5474ce2f0e77dc5d05650de19ed8 Mon Sep 17 00:00:00 2001 From: Damien Arnodo Date: Sat, 29 Nov 2025 18:48:29 +0000 Subject: [PATCH] Hybrid approach: ifupdown for bond0, ip commands for VLAN interfaces Interface files handle bond0 creation with LACP via ifupdown-ng. VLAN sub-interfaces created via ip link commands in exec due to ifupdown-ng limitations with VLAN interfaces on bonds. This combines the best of both approaches: - Persistent bond configuration in /etc/network/interfaces - Reliable VLAN interface creation via ip commands --- evpn-lab.clab.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/evpn-lab.clab.yml b/evpn-lab.clab.yml index b79a338..83b70f8 100644 --- a/evpn-lab.clab.yml +++ b/evpn-lab.clab.yml @@ -67,7 +67,6 @@ topology: startup-config: configs/leaf8.cfg # Host devices - DUAL-HOMED with LACP bonding to MLAG pairs - # Using binds to mount interface configuration files host1: kind: linux mgmt-ipv4: 172.16.0.101 @@ -75,14 +74,17 @@ topology: binds: - hosts/host1_interfaces:/etc/network/interfaces exec: - # Install required packages for bonding and VLAN support + # Install required packages - apk add --no-cache ifupdown bonding vlan - # Load bonding kernel module + # Load kernel modules - modprobe bonding - # Load 8021q module for VLAN support - modprobe 8021q - # Bring up interfaces using the mounted configuration + # Bring up bond0 via ifupdown - ifup -a + # Create VLAN interface manually (ifupdown-ng limitation) + - ip link add link bond0 name bond0.40 type vlan id 40 + - ip link set bond0.40 up + - ip addr add 10.40.40.101/24 dev bond0.40 host2: kind: linux @@ -95,6 +97,9 @@ topology: - modprobe bonding - modprobe 8021q - ifup -a + - ip link add link bond0 name bond0.34 type vlan id 34 + - ip link set bond0.34 up + - ip addr add 10.34.34.102/24 dev bond0.34 host3: kind: linux @@ -107,6 +112,9 @@ topology: - modprobe bonding - modprobe 8021q - ifup -a + - ip link add link bond0 name bond0.40 type vlan id 40 + - ip link set bond0.40 up + - ip addr add 10.40.40.103/24 dev bond0.40 host4: kind: linux @@ -119,6 +127,9 @@ topology: - modprobe bonding - modprobe 8021q - ifup -a + - ip link add link bond0 name bond0.78 type vlan id 78 + - ip link set bond0.78 up + - ip addr add 10.78.78.104/24 dev bond0.78 links: # Spine1 to Leaf connections (underlay fabric)