commit 8098b37f6faded7f7fd7cc95cbf79038ae348c84 Author: Eliezer Croitoru Date: Mon Jul 15 22:44:33 2024 +0000 1 diff --git a/install-openvswitch.sh b/install-openvswitch.sh new file mode 100755 index 0000000..4f154e3 --- /dev/null +++ b/install-openvswitch.sh @@ -0,0 +1,129 @@ +#!/usr/bin/env sh + +apk add openvswitch openvswitch-bash-completion bash bash-completion openvswitch-doc openvswitch-openrc vim tcpdump ruby ruby-rdoc git +sed -i -e "s@mouse\=a@mouse=r@g" /usr/share/vim/vim*/defaults.vim +grep "mouse=a" /usr/share/vim/vim*/defaults.vim + +RES="$?" + +if [ "${RES}" -gt "0" ] +then +cat <> /etc/network/interfacees +auto eth1 +iface eth1 inet manual +auto eth2 +iface eth2 inet manual +auto eth3 +iface eth3 inet manual +auto eth4 +iface eth4 inet manual +auto eth5 +iface eth5 inet manual +auto eth6 +iface eth6 inet manual +auto eth7 +iface eth7 inet manual +auto eth8 +iface eth8 inet manual +auto eth9 +iface eth9 inet manual +auto eth10 +iface eth10 inet manual +auto eth11 +iface eth11 inet manual +auto eth12 +iface eth12 inet manual +auto eth13 +iface eth13 inet manual +auto eth14 +iface eth14 inet manual +auto eth15 +iface eth15 inet manual +auto eth16 +iface eth16 inet manual +auto eth17 +iface eth17 inet manual +auto eth18 +iface eth18 inet manual +auto eth19 +iface eth19 inet manual +auto eth20 +iface eth20 inet manual +auto eth21 +iface eth21 inet manual +auto eth22 +iface eth22 inet manual +auto eth23 +iface eth23 inet manual +EOF + +fi + +rc-update add ovs-modules +rc-update add ovsdb-server +rc-update add ovs-vswitchd +rc-service ovs-modules start +rc-service ovsdb-server start +rc-service ovs-vswitchd start + +### +ovs-vsctl add-br switch0 +ovs-vsctl set bridge switch0 stp_enable=true + +### +ovs-vsctl add-port switch0 eth1 +ovs-vsctl add-port switch0 eth2 +ovs-vsctl add-port switch0 eth3 +ovs-vsctl add-port switch0 eth4 +ovs-vsctl add-port switch0 eth5 +ovs-vsctl add-port switch0 eth6 +ovs-vsctl add-port switch0 eth7 +ovs-vsctl add-port switch0 eth8 +ovs-vsctl add-port switch0 eth9 +ovs-vsctl add-port switch0 eth10 +ovs-vsctl add-port switch0 eth11 +ovs-vsctl add-port switch0 eth12 +ovs-vsctl add-port switch0 eth13 +ovs-vsctl add-port switch0 eth14 +ovs-vsctl add-port switch0 eth15 +ovs-vsctl add-port switch0 eth16 +ovs-vsctl add-port switch0 eth17 +ovs-vsctl add-port switch0 eth18 +ovs-vsctl add-port switch0 eth19 +ovs-vsctl add-port switch0 eth20 +ovs-vsctl add-port switch0 eth21 +ovs-vsctl add-port switch0 eth22 +ovs-vsctl add-port switch0 eth23 + +### +ip link set dev eth1 up +ip link set dev eth2 up +ip link set dev eth3 up +ip link set dev eth4 up +ip link set dev eth5 up +ip link set dev eth6 up +ip link set dev eth7 up +ip link set dev eth8 up +ip link set dev eth9 up +ip link set dev eth10 up +ip link set dev eth11 up +ip link set dev eth12 up +ip link set dev eth13 up +ip link set dev eth14 up +ip link set dev eth15 up +ip link set dev eth16 up +ip link set dev eth17 up +ip link set dev eth18 up +ip link set dev eth19 up +ip link set dev eth20 up +ip link set dev eth21 up +ip link set dev eth22 up +ip link set dev eth23 up + + +### +ovs-vsctl list-br + +ovs-vsctl list-ports switch0 + +ovs-vsctl show