安装依赖包
yum install gcc make git python-devel openssl-devel kernel-devel graphviz kernel-debug-devel autoconf automake rpm-build redhat-rpm-config libtool -y
设置正确的内核开发包
cd /lib/modules/`uname -r`
rm -rf build
ln -s /usr/src/kernels/2.6.32-573.8.1.el6.x86_64 build
安装autoconf
http://ftp.gnu.org/gnu/autoconf/
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar zxvf autoconf-2.69.tar.gz
cd autoconf-2.69
./configure
make -j 4
make install
下载
git clone -b branch-2.4 https://github.com/openvswitch/ovs.git
一定要用branch-2.4, 不要问为什么,我撸了一下午的master, 2.4.90, 2.3.2了, 说多了都是泪...
生成dist包
cd ovs
./boot.sh
./configure
make dist
安装OVS
-
解压复制
mkdir -p ~/rpmbuild/SOURCES cp openvswitch-2.4.1.tar.gz ~/rpmbuild/SOURCES/ cd ~/rpmbuild/SOURCES/ tar zxvf openvswitch-2.4.1.tar.gz cd openvswitch-2.4.1
-
生成rpm rpmbuild -bb —without check rhel/openvswitch.spec
cp rhel/openvswitch-kmod.files ~/rpmbuild/SOURCES/ rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec
-
安装
cd ~/rpmbuild/RPMS/x86_64/ yum localinstall openvswitch-2.4.1-1.x86_64.rpm kmod-openvswitch-2.4.1-1.el6.x86_64.rpm
检查
service openvswitch start
service openvswitch status
lsmod | grep openvswitch
ovs-vsctl --version