Update topology to use binds for host interface configuration
Replace exec commands with binds mounting /etc/network/interfaces files. This provides cleaner, more maintainable configuration that properly handles LACP bonding and VLAN tagging on Alpine Linux hosts. All hosts now: - Mount their interface config from hosts/ directory - Install required packages (ifupdown, bonding, vlan) - Load kernel modules (bonding, 8021q) - Bring up interfaces with ifup -a
This commit is contained in:
@@ -67,88 +67,58 @@ topology:
|
|||||||
startup-config: configs/leaf8.cfg
|
startup-config: configs/leaf8.cfg
|
||||||
|
|
||||||
# Host devices - DUAL-HOMED with LACP bonding to MLAG pairs
|
# Host devices - DUAL-HOMED with LACP bonding to MLAG pairs
|
||||||
|
# Using binds to mount interface configuration files
|
||||||
host1:
|
host1:
|
||||||
kind: linux
|
kind: linux
|
||||||
mgmt-ipv4: 172.16.0.101
|
mgmt-ipv4: 172.16.0.101
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
|
binds:
|
||||||
|
- hosts/host1_interfaces:/etc/network/interfaces
|
||||||
exec:
|
exec:
|
||||||
# Dual-homed LACP bond to leaf1 + leaf2 for L2 VXLAN test (VLAN 40)
|
# Install required packages for bonding and VLAN support
|
||||||
# Using mode 4 (802.3ad) explicitly for Alpine Linux compatibility
|
- apk add --no-cache ifupdown bonding vlan
|
||||||
- ip link add bond0 type bond mode 4
|
# Load bonding kernel module
|
||||||
- ip link set address 00:c1:ab:00:00:11 dev bond0
|
- modprobe bonding
|
||||||
- ip link set eth1 down
|
# Load 8021q module for VLAN support
|
||||||
- ip link set eth2 down
|
- modprobe 8021q
|
||||||
- ip link set eth1 master bond0
|
# Bring up interfaces using the mounted configuration
|
||||||
- ip link set eth2 master bond0
|
- ifup -a
|
||||||
- ip link set eth1 up
|
|
||||||
- ip link set eth2 up
|
|
||||||
- ip link set bond0 up
|
|
||||||
# VLAN interface on bond
|
|
||||||
- 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:
|
host2:
|
||||||
kind: linux
|
kind: linux
|
||||||
mgmt-ipv4: 172.16.0.102
|
mgmt-ipv4: 172.16.0.102
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
|
binds:
|
||||||
|
- hosts/host2_interfaces:/etc/network/interfaces
|
||||||
exec:
|
exec:
|
||||||
# Dual-homed LACP bond to leaf3 + leaf4 for L3 VXLAN test (VLAN 34, VRF gold)
|
- apk add --no-cache ifupdown bonding vlan
|
||||||
- ip link add bond0 type bond mode 4
|
- modprobe bonding
|
||||||
- ip link set address 00:c1:ab:00:00:22 dev bond0
|
- modprobe 8021q
|
||||||
- ip link set eth1 down
|
- ifup -a
|
||||||
- ip link set eth2 down
|
|
||||||
- ip link set eth1 master bond0
|
|
||||||
- ip link set eth2 master bond0
|
|
||||||
- ip link set eth1 up
|
|
||||||
- ip link set eth2 up
|
|
||||||
- ip link set bond0 up
|
|
||||||
# VLAN interface on bond
|
|
||||||
- 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
|
|
||||||
- ip route add default via 10.34.34.1
|
|
||||||
|
|
||||||
host3:
|
host3:
|
||||||
kind: linux
|
kind: linux
|
||||||
mgmt-ipv4: 172.16.0.103
|
mgmt-ipv4: 172.16.0.103
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
|
binds:
|
||||||
|
- hosts/host3_interfaces:/etc/network/interfaces
|
||||||
exec:
|
exec:
|
||||||
# Dual-homed LACP bond to leaf5 + leaf6 for L2 VXLAN test (VLAN 40)
|
- apk add --no-cache ifupdown bonding vlan
|
||||||
- ip link add bond0 type bond mode 4
|
- modprobe bonding
|
||||||
- ip link set address 00:c1:ab:00:00:33 dev bond0
|
- modprobe 8021q
|
||||||
- ip link set eth1 down
|
- ifup -a
|
||||||
- ip link set eth2 down
|
|
||||||
- ip link set eth1 master bond0
|
|
||||||
- ip link set eth2 master bond0
|
|
||||||
- ip link set eth1 up
|
|
||||||
- ip link set eth2 up
|
|
||||||
- ip link set bond0 up
|
|
||||||
# VLAN interface on bond
|
|
||||||
- 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:
|
host4:
|
||||||
kind: linux
|
kind: linux
|
||||||
mgmt-ipv4: 172.16.0.104
|
mgmt-ipv4: 172.16.0.104
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
|
binds:
|
||||||
|
- hosts/host4_interfaces:/etc/network/interfaces
|
||||||
exec:
|
exec:
|
||||||
# Dual-homed LACP bond to leaf7 + leaf8 for L3 VXLAN test (VLAN 78, VRF gold)
|
- apk add --no-cache ifupdown bonding vlan
|
||||||
- ip link add bond0 type bond mode 4
|
- modprobe bonding
|
||||||
- ip link set address 00:c1:ab:00:00:44 dev bond0
|
- modprobe 8021q
|
||||||
- ip link set eth1 down
|
- ifup -a
|
||||||
- ip link set eth2 down
|
|
||||||
- ip link set eth1 master bond0
|
|
||||||
- ip link set eth2 master bond0
|
|
||||||
- ip link set eth1 up
|
|
||||||
- ip link set eth2 up
|
|
||||||
- ip link set bond0 up
|
|
||||||
# VLAN interface on bond
|
|
||||||
- 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
|
|
||||||
- ip route add default via 10.78.78.1
|
|
||||||
|
|
||||||
links:
|
links:
|
||||||
# Spine1 to Leaf connections (underlay fabric)
|
# Spine1 to Leaf connections (underlay fabric)
|
||||||
|
|||||||
Reference in New Issue
Block a user