From 702a11fd5a0296b10f4aa5b4ce3a1a7b93b293a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sp=C3=B6hel?= Date: Tue, 12 Jan 2021 10:37:19 +0100 Subject: Using openvswitch instead of linux bridges. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Spöhel --- libexec/container/start | 4 +- share/doc/host-setup.txt | 104 +++++++++++++++++------------------------------ 2 files changed, 39 insertions(+), 69 deletions(-) diff --git a/libexec/container/start b/libexec/container/start index f899446..6ec44f4 100755 --- a/libexec/container/start +++ b/libexec/container/start @@ -394,8 +394,8 @@ cat > "/etc/network/interfaces.d/${INTERFACE}" << EOF allow-hotplug ${INTERFACE} iface ${INTERFACE} inet manual pre-up ip link set ${INTERFACE} up - post-up ip link set ${INTERFACE} master ${BRIDGE} - pre-down ip link set ${INTERFACE} nomaster + post-up ovs-vsctl add-port "${BRIDGE}" "${INTERFACE}" + pre-down ovs-vsctl --with-iface del-port "${BRIDGE}" "${INTERFACE}" post-down ip link set ${INTERFACE} down EOF diff --git a/share/doc/host-setup.txt b/share/doc/host-setup.txt index 9a9ec94..efd4077 100644 --- a/share/doc/host-setup.txt +++ b/share/doc/host-setup.txt @@ -5,7 +5,7 @@ compute-tools: Host Setup 1. Debian Packages ------------------- -apt install bridge-utils ifenslave vlan +apt install ifenslave vlan openvswitch-switch 2. Boot Parameters @@ -53,14 +53,15 @@ source /etc/network/interfaces.d/* auto lo iface lo inet loopback +allow-bridge0 eno1 iface eno1 inet manual + ovs_bridge bridge0 + ovs_type OVSPort -auto bridge0 +allow-ovs bridge0 iface bridge0 inet dhcp - bridge_ports eno1 - bridge_fd 0 - bridge_maxwait 0 - bridge_stp 0 + ovs_type OVSBridge + ovs_ports eno1 EOF @@ -75,53 +76,23 @@ source /etc/network/interfaces.d/* auto lo iface lo inet loopback +allow-bridge0 eno1 iface eno1 inet manual + ovs_bridge bridge0 + ovs_type OVSPort -auto bridge0 +allow-ovs bridge0 iface bridge0 inet static address 10.0.0.2 gateway 10.0.0.1 netmask 24 - pre-up ip link set eno1 down - pre-up ip link set eno1 up - - bridge_ports eno1 - bridge_fd 0 - bridge_maxwait 0 - bridge_stp 0 -EOF - - -3.1.3 Bridge: 2 logical Interfaces, subnet, static -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -cat > /etc/network/interfaces << EOF -# /etc/network/interfaces - -source /etc/network/interfaces.d/* - -auto lo -iface lo inet loopback - -allow-hotplug eno1 -iface eno1 inet dhcp - -auto bridge0 -iface bridge0 inet static - address 10.0.0.1 - netmask 24 - - pre-up ip link add name bridge0 type bridge - post-down ip link delete bridge0 type bridge - - bridge_fd 0 - bridge_maxwait 0 - bridge_stp 0 + ovs_type OVSBridge + ovs_ports eno1 EOF -3.1.4 Bridge: 3 physical Interfaces, vlan, bonding, static +3.2.3 Bridge: 3 physical Interfaces, vlan, bonding, static ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cat > /etc/network/interfaces << EOF @@ -135,36 +106,35 @@ iface lo inet loopback allow-hotplug eno1 iface eno1 inet dhcp +allow-bond0 eno2 iface eno2 inet manual + ovs_type OVSPort + ovs_bonds bond0 +allow-bond0 eno3 iface eno3 inet manual + ovs_type OVSPort + ovs_bonds bond0 -auto bond0 +allow-bridge0 bond0 iface bond0 inet manual - up ip link set bond0 up - down ip link set bond0 down - - slaves eno2 eno3 - - bond-mode 4 - bond-miimon 100 - bond-downdelay 200 - bond-updelay 200 - bond-lacp-rate 1 - bond-xmit-hash-policy layer2+3 - -iface bond0.100 inet manual - vlan-raw-device bond0 - -auto bridge-100 + ovs_bridge bridge0 + ovs_type OVSBond + ovs_bonds eno2 eno3 + ovs_options bond_mode=balance-tcp lacp=active other_config:lacp-time=fast other_config:bond-detect-mode=miimon other_config:bond-miimon-interval=100 other_config:bond_updelay=200 + +allow-ovs bridge0 +iface bridge0 inet manual + ovs_type OVSBridge + ovs_ports bond0 bridge-100 + +# fake bridge for vlan 100 +allow-bridge0 bridge-100 iface bridge-100 inet static - address 10.100.0.2 - netmask 24 - - bridge_ports bond0.100 - bridge_fd 0 - bridge_maxwait 0 - bridge_stp 0 + ovs_type OVSBridge + ovs_options bridge0 100 + address 10.100.0.2 + netmask 24 EOF -- cgit v1.2.3