2.0 KiB
2.0 KiB
LFCS 2.7: Bridges and bonding
An active-backup bond, a bridge carrying the host's address, and a guest attached to the bridge.
Before you start
Instead of extra network cards, the lab gives this VM four extra interfaces, each cabled to a small lab network:
le-b0andle-b1both go to one switch, where a machine answers at10.96.0.254.le-p0goes to another network,10.95.0.0/24, where a machine calledlanhas10.95.0.2.le-p0has this VM's address there,10.95.0.1/24: a NetworkManager profile calledle-p0on the RHEL family,/etc/netplan/60-le-lab.yamlon Ubuntu.le-vnet0is a guest's cable, the way libvirt connects a VM through avnetinterface. The guest has10.95.0.50/24; it's connected to nothing yet.
Run commands on the switch, lan and the guest with
sudo ip netns exec le-sw|le-lan|le-guest COMMAND. Your SSH connection
doesn't use any of these interfaces.
Tasks
- RHEL family: create an active-backup bond,
bond0, fromle-b0andle-b1, with the static address10.96.0.1/24, persistently. - Ubuntu: do the same with netplan.
- Create a bridge
br0withle-p0as its port and this VM's address on that network,10.95.0.1/24, moved to the bridge, persistently. - Attach the guest to
br0(addle-vnet0as a second port), so it's on the10.95.0.0/24network andlancan reach it at10.95.0.50.
Hints
nmcli connection add type bond ... bond.options "mode=...,miimon=...", then onetype ethernetprofile per member withmaster.bonds:withinterfaces:andparameters:in netplan; members underethernets:.cat /proc/net/bonding/bond0; to test failover, take the active member's other end down:sudo ip netns exec le-sw ip link set le-b0s down(orle-b1s), ping10.96.0.254, then bring it back up.nmcli connection add type bridge ... bridge.stp no, orbridges:in netplan withstp: false; take the address offle-p0's own profile.bridge link,ip -br addr,sudo ip netns exec le-lan ping 10.95.0.50.