This document provides instructions for building an Open vSwitch RPM package on RHEL/CentOS 6 and setting up an OVS bridge. It outlines the procedure, potential troubleshooting issues, and setup of the OVS bridge. The procedure involves downloading the OVS tarball, extracting it, building the RPM package using rpmbuild, potentially troubleshooting a failed kernel module build, and configuring network scripts and services to use the OVS bridge.
3. Procedure
¡ñ
Download the tarball package
¡ñ
Under the Linux (RHEL 6/CentOS 6), make sure
needed tools (automake, cmake, rpmbuild...etc.)
are installed
¡ñ
Create folder ¡°rpmbuild/SOURCES¡± and put the
tarball package into the folder
¡ñ Extract the tarball package of OVS
¡ñ
Enter the extracted folder of OVS
¡ñ
Enter the folder ¡°rhel¡± to build OVS RPM package:
¨C rpmbuild -bb openvswitch.spec
¡ñ
After building the OVS package, start building
kernel module:
¨C rpmbuild -bb openvswitch-kmod-rhel6.spec
¡ñ In the rpmbuild/RPM/x86_64 folder, we'll get bulit
packages
4. Trouble shooting
¡ñ During building the kernel module, the process
would be failed due to lack of adding some
setting
¡ñ Solution: add the needed folder in the
openvswitch-kmod-rhel6.spec:
%files
/etc/*
/lib/*
¨C And then re-issue the command again
¡ñ If build RPM form gitHub's latest packages:
¨C In the openvswitch folder, issue :
./boot.sh ¡ú ./configure ¡ú make dist ¡ú rpmbuild -bb
rhel/<specfile>
5. Setup OVS bridge under the RHEL/CentOS 6
¡ñ Install the OVS packages and start ¡°openvswitch¡± service
¡ñ Disable the service : NetworkManager
¡ñ
In the /etc/sysconfig/network-scripts/ :
¨C If we choose eth0 as the OVS port ¨C
¡ñ Change ifcfg-eth0:
# Design for OVS bridge -- physical interface
DEVICE="eth0"
NAME="eth0"
ONBOOT="yes"
NETBOOT="yes"
IPV6INIT="no"
HWADDR="AA:BB:CC:DD:EE:FF"
TYPE="OVSPort"
DEVICETYPE="ovs"
NM_CONTROLLED="no"
OVS_BRIDGE="ovsbr0"
BRIDGE="ovsbr0"
6. Setup OVS bridge under the RHEL/CentOS 6
¡ñ Add new interface ¡°ovsbr0¡± in the new file ¡°ifcfg-
ovsbr0¡±:
# For OVS bridge to eth0
TYPE="OVSBridge"
NAME="ovsbr0"
DEVICE="ovsbr0"
ONBOOT="yes"
BOOTPROTO="none"
DEVICETYPE="ovs"
HOTPLUG="no"
USERCTL="no"
IPADDR="192.168.130.1"
PREFIX="24"
¡ñ Users need to restart the service ¡°network¡±