Configure Linux hosts for LACP bonding and VLANs
Use a network-multitool image and configure LACP bonding and VLANs using the `ip` command.
This commit is contained in:
@@ -70,50 +70,90 @@ topology:
|
|||||||
host1:
|
host1:
|
||||||
kind: linux
|
kind: linux
|
||||||
mgmt-ipv4: 172.16.0.101
|
mgmt-ipv4: 172.16.0.101
|
||||||
image: alpine:latest
|
image: ghcr.io/hellt/network-multitool
|
||||||
binds:
|
cap-add:
|
||||||
- hosts/host1_interfaces:/etc/network/interfaces
|
- NET_ADMIN
|
||||||
exec:
|
exec:
|
||||||
- apk add --no-cache ifupdown bonding vlan
|
- ip link add bond0 type bond mode 802.3ad
|
||||||
- modprobe bonding
|
- ip link set dev bond0 type bond xmit_hash_policy layer3+4
|
||||||
- modprobe 8021q
|
- ip link set dev eth1 down
|
||||||
- ifup -a
|
- ip link set dev eth2 down
|
||||||
|
- ip link set eth1 master bond0
|
||||||
|
- ip link set eth2 master bond0
|
||||||
|
- ip link set dev eth1 up
|
||||||
|
- ip link set dev eth2 up
|
||||||
|
- ip link set dev bond0 type bond lacp_rate fast
|
||||||
|
- ip link set dev bond0 up
|
||||||
|
- 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: ghcr.io/hellt/network-multitool
|
||||||
binds:
|
cap-add:
|
||||||
- hosts/host2_interfaces:/etc/network/interfaces
|
- NET_ADMIN
|
||||||
exec:
|
exec:
|
||||||
- apk add --no-cache ifupdown bonding vlan
|
- ip link add bond0 type bond mode 802.3ad
|
||||||
- modprobe bonding
|
- ip link set dev bond0 type bond xmit_hash_policy layer3+4
|
||||||
- modprobe 8021q
|
- ip link set dev eth1 down
|
||||||
- ifup -a
|
- ip link set dev eth2 down
|
||||||
|
- ip link set eth1 master bond0
|
||||||
|
- ip link set eth2 master bond0
|
||||||
|
- ip link set dev eth1 up
|
||||||
|
- ip link set dev eth2 up
|
||||||
|
- ip link set dev bond0 type bond lacp_rate fast
|
||||||
|
- ip link set dev bond0 up
|
||||||
|
- 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: ghcr.io/hellt/network-multitool
|
||||||
binds:
|
cap-add:
|
||||||
- hosts/host3_interfaces:/etc/network/interfaces
|
- NET_ADMIN
|
||||||
exec:
|
exec:
|
||||||
- apk add --no-cache ifupdown bonding vlan
|
- ip link add bond0 type bond mode 802.3ad
|
||||||
- modprobe bonding
|
- ip link set dev bond0 type bond xmit_hash_policy layer3+4
|
||||||
- modprobe 8021q
|
- ip link set dev eth1 down
|
||||||
- ifup -a
|
- ip link set dev eth2 down
|
||||||
|
- ip link set eth1 master bond0
|
||||||
|
- ip link set eth2 master bond0
|
||||||
|
- ip link set dev eth1 up
|
||||||
|
- ip link set dev eth2 up
|
||||||
|
- ip link set dev bond0 type bond lacp_rate fast
|
||||||
|
- ip link set dev bond0 up
|
||||||
|
- 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: ghcr.io/hellt/network-multitool
|
||||||
|
cap-add:
|
||||||
|
- NET_ADMIN
|
||||||
binds:
|
binds:
|
||||||
- hosts/host4_interfaces:/etc/network/interfaces
|
- hosts/host4_interfaces:/etc/network/interfaces
|
||||||
exec:
|
exec:
|
||||||
- apk add --no-cache ifupdown bonding vlan
|
- ip link add bond0 type bond mode 802.3ad
|
||||||
- modprobe bonding
|
- ip link set dev bond0 type bond xmit_hash_policy layer3+4
|
||||||
- modprobe 8021q
|
- ip link set dev eth1 down
|
||||||
- ifup -a
|
- ip link set dev eth2 down
|
||||||
|
- ip link set eth1 master bond0
|
||||||
|
- ip link set eth2 master bond0
|
||||||
|
- ip link set dev eth1 up
|
||||||
|
- ip link set dev eth2 up
|
||||||
|
- ip link set dev bond0 type bond lacp_rate fast
|
||||||
|
- ip link set dev bond0 up
|
||||||
|
- 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