linux ES1en ES2en installation and uninstallation operation
- 2020-11-30 08:45:07
- OfStack
1. ovs is installed from source code compilation:
Install dependencies:
# apt install make
# apt install gcc
# apt install build-essential
# apt install libssl-dev
# apt install libcap-ng-dev
# apt install python2.7
# apt install python-pip
# pip install six
# apt install autoconf
# apt install automake
# apt install libtool
Download source package
# apt install git
# git clone https://github.com/openvswitch/ovs.git (download git Project directory is ~/ovs )
Generate configuration files
# ./boot.sh (in the ovs Under the project root directory)
configuration
# ./configure -with-linux=/lib/modules/$(uname -r)/build
compile
# make
# make install
# make modules_install
# config_file="/etc/depmod.d/openvswitch.conf"
# for module in datapath/linux/*.ko; do
modname="\$(basename \${module})"
echo "override \${modname%.ko} * extra" >> "\$config_file"
echo "override \${modname%.ko} * weak-updates" >> "\$config_file"
done
# depmod -a
# /sbin/modprobe openvswitch
# /sbin/lsmod | grep openvswitch
Start the
export PATH=$PATH:/usr/local/share/openvswitch/scripts
# ovs-ctl start
test
# ovs-vsctl show
# ovs-vsctl add-br mybridge
# ovs-vsctl add-port mybridge eth0
2. Unloading of Ovs
After starting ovs, if you change the ovs source code and want to update the ovs service, do the following:
# ovs-ctl stop stop ovs service
# ovs-dpctl show Look at the kernel, there is 1 a ovs-system the datapath
# ovs-dpctl del-dp ovs-system Delete the 1 Step in the datapath Don't go ahead with it 1 Step, rmmod Error may be reported)
# rmmod openvswitch uninstall openvswitch Kernel module, used lsmod | grep openvswitch There is no openvswitch
# Enter the ovs Source code directory, follow the above compilation steps to recompile the installation
The resources
Open vSwitch on Linux, FreeBSD and NetBSD