CentOS7上安装OpenvSwitch

1.安装依赖包:

yum -y install make gcc openssl-devel autoconf automake rpm-build redhat-rpm-config
yum -y install python-devel openssl-devel kernel-devel kernel-debug-devel libtool wget

2.预处理:

ovs下载地址:http://www.openvswitch.org/download/

mkdir -p ~/rpmbuild/SOURCES
wget http://openvswitch.org/releases/openvswitch-2.5.0.tar.gz
cp openvswitch-2.5.0.tar.gz ~/rpmbuild/SOURCES/
tar xfz openvswitch-2.5.0.tar.gz
sed 's/openvswitch-kmod, //g' openvswitch-2.5.0/rhel/openvswitch.spec > openvswitch-2.5.0/rhel/openvswitch_no_kmod.spec

3.构建RPM包:

rpmbuild -bb --nocheck ~/rpmbuild/SOURCES/openvswitch-2.5.0/rhel/openvswitch_no_kmod.spec

4.安装:

yum localinstall ~/rpmbuild/RPMS/x86_64/openvswitch-2.5.0-1.x86_64.rpm

5.启动相关服务:

systemctl enable openvswitch.service
systemctl start openvswitch.service
systemctl status openvswitch.service

 查看ovs版本

ovs-appctl --version

发表回复