在 Centos 上安装 ovs

安装ovs之前,先保证如下软件已被安装:

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

 必要的设置步骤:

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

Build RPM

#rpmbuild -bb --nocheck ~/openvswitch-2.5.1/rhel/openvswitch_no_kmod.spec

安装RPM 

#ls -l ~/rpmbuild/RPMS/x86_64/
#yum localinstall ~/rpmbuild/RPMS/x86_64/openvswitch-2.5.1-1.x86_64.rpm
Start the OVS service and enable it for the next boot

安装后设置

# mkdir -p /etc/openvswitch
# ovsdb-tool create /etc/openvswitch/conf.db \
    vswitchd/vswitch.ovsschema

 安装Policycoreutils

#yum install policycoreutils-python.x86_64 0:2.2.5-11.el7

#restorecon -Rv /etc/openvswitch

 启动 OVS

#systemctl start openvswitch.service
#systemctl -l status openvswitch.service

你可能感兴趣的:(网络技术)