]> git.proxmox.com Git - ovs.git/blame - INSTALL.RHEL.md
netdev-dpdk: Change phy rx burst size.
[ovs.git] / INSTALL.RHEL.md
CommitLineData
542cc9bb
TG
1How to Install Open vSwitch on Red Hat Enterprise Linux
2=======================================================
c434706a
BP
3
4This document describes how to build and install Open vSwitch on a Red
5Hat Enterprise Linux (RHEL) host. If you want to install Open vSwitch
9feb1017 6on a generic Linux host, see [INSTALL.md] instead.
c434706a
BP
7
8We have tested these instructions with RHEL 5.6 and RHEL 6.0.
9
10Building Open vSwitch for RHEL
11------------------------------
12
13You may build from an Open vSwitch distribution tarball or from an
14Open vSwitch Git tree.
15
1547f8e3
FL
16The default RPM build directory (_topdir) has five directories in
17the top-level:
181. BUILD/ Where the software is unpacked and built.
192. RPMS/ Where the newly created binary package files are written.
203. SOURCES/ Contains the original sources, patches, and icon files.
214. SPECS/ Contains the spec files for each package to be built.
225. SRPMS/ Where the newly created source package files are written.
23
24Before you begin, note the RPM sources directory on your version of
3c49da46 25RHEL. The command "rpmbuild --showrc" will show the configuration
1547f8e3
FL
26for each of those directories. Alternatively, the command "rpm --eval
27 '%{_topdir}'" shows the current configuration for the top level
28directory and the command "rpm --eval '%{_sourcedir}'" does the same
29for the sources directory. On RHEL 5, the default RPM _topdir is
30/usr/src/redhat and the default RPM sources directory is
31/usr/src/redhat/SOURCES. On RHEL 6, the default _topdir is
32$HOME/rpmbuild and the default RPM sources directory is
33$HOME/rpmbuild/SOURCES.
c434706a 34
935cdc95
BP
351. Install build prerequisites:
36
542cc9bb 37 ```
935cdc95
BP
38 yum install gcc make python-devel openssl-devel kernel-devel graphviz \
39 kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \
40 libtool
542cc9bb 41 ```
935cdc95
BP
42
432. If you are building from a distribution tarball, skip to step 3.
44 Otherwise, you must be building from an Open vSwitch Git tree.
45 Determine what version of Autoconf is installed (e.g. run "autoconf
46 --version"). If it is not at least version 2.63, then you have two
6fdbeaa6
BP
47 choices:
48
0877a018 49 a. Install Autoconf 2.63 or later, one way or another.
6fdbeaa6
BP
50
51 b. Create a distribution tarball on some other machine, by
52 running "./boot.sh; ./configure; make dist" in the Git tree.
53 You must run this on a machine that has the tools listed in
9feb1017
TG
54 [INSTALL.md] as prerequisites for building from a Git tree.
55 Afterward, proceed with the rest of the instructions using
542cc9bb 56 the distribution tarball.
6fdbeaa6 57
6fdbeaa6 583. Some versions of the RHEL 6 kernel-devel package contain a broken
8f5cb995
BP
59 "build" symlink. If you are using such a version, you must fix
60 the problem before continuing.
61
62 To find out whether you are affected, run:
63
542cc9bb 64 ```
8f5cb995
BP
65 cd /lib/modules/<version>
66 ls -l build/
542cc9bb 67 ```
8f5cb995 68
542cc9bb 69 where `<version>` is the version number of the RHEL 6 kernel. (The
8f5cb995
BP
70 trailing slash in the final command is important. Be sure to include
71 it.) If the "ls" command produces a directory listing, your
72 kernel-devel package is OK. If it produces a "No such file or
73 directory" error, your kernel-devel package is buggy.
74
75 If your kernel-devel package is buggy, then you can fix it with:
76
542cc9bb 77 ```
8f5cb995
BP
78 cd /lib/modules/<version>
79 rm build
80 ln -s /usr/src/kernels/<target> build
542cc9bb 81 ```
8f5cb995 82
542cc9bb
TG
83 where `<target>` is the name of an existing directory under
84 /usr/src/kernels, whose name should be similar to `<version>` but may
8f5cb995
BP
85 contain some extra parts. Once you have done this, verify the fix with
86 the same procedure you used above to check for the problem.
87
935cdc95
BP
884. If you are building from a distribution tarball, skip to step 5.
89 Otherwise, create a distribution tarball from the root of the Git
90 tree by running:
91
542cc9bb 92 ```
935cdc95
BP
93 ./boot.sh
94 ./configure
95 make dist
542cc9bb 96 ```
935cdc95
BP
97
985. Now you have a distribution tarball, named something like
99 openvswitch-x.y.z.tar.gz. Copy this file into the RPM sources
100 directory, e.g.:
101
542cc9bb 102 `cp openvswitch-x.y.z.tar.gz $HOME/rpmbuild/SOURCES`
c434706a 103
935cdc95
BP
1046. Make another copy of the distribution tarball in a temporary
105 directory. Then unpack the tarball and "cd" into its root, e.g.:
c434706a 106
542cc9bb 107 ```
935cdc95
BP
108 tar xzf openvswitch-x.y.z.tar.gz
109 cd openvswitch-x.y.z
542cc9bb 110 ```
c434706a 111
6fdbeaa6 1127. To build Open vSwitch userspace, run:
c434706a 113
542cc9bb 114 `rpmbuild -bb rhel/openvswitch.spec`
c434706a
BP
115
116 This produces two RPMs: "openvswitch" and "openvswitch-debuginfo".
117
329cf232
GS
118 The above command automatically runs the Open vSwitch unit tests.
119 To disable the unit tests, run:
120
542cc9bb 121 `rpmbuild -bb --without check rhel/openvswitch.spec`
329cf232 122
8f5cb995
BP
123 If the build fails with "configure: error: source dir
124 /lib/modules/2.6.32-279.el6.x86_64/build doesn't exist" or similar,
125 then the kernel-devel package is missing or buggy. Go back to step
126 1 or 2 and fix the problem.
127
6fdbeaa6 1288. On RHEL 6, to build the Open vSwitch kernel module, copy
935cdc95 129 rhel/openvswitch-kmod.files into the RPM sources directory and run:
c434706a 130
542cc9bb 131 `rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec`
c434706a 132
935cdc95 133 You might have to specify a kernel version and/or variants, e.g.:
6c9b8ee4 134
542cc9bb 135 ```
6c9b8ee4
AF
136 rpmbuild -bb \
137 -D "kversion 2.6.32-131.6.1.el6.x86_64" \
138 -D "kflavors default debug kdump" \
139 rhel/openvswitch-kmod-rhel6.spec
542cc9bb 140 ```
6c9b8ee4 141
935cdc95
BP
142 This produces an "kmod-openvswitch" RPM for each kernel variant, in
143 this example: "kmod-openvswitch", "kmod-openvswitch-debug", and
144 "kmod-openvswitch-kdump".
c434706a 145
f9ee9dcb
GS
146A RHEL host has default firewall rules that prevent any Open vSwitch tunnel
147traffic from passing through. If a user configures Open vSwitch tunnels like
271e6bc7
JG
148Geneve, GRE, VXLAN, LISP etc., they will either have to manually add iptables
149firewall rules to allow the tunnel traffic or add it through a startup script
150(Please refer to the "enable-protocol" command in the ovs-ctl(8) manpage).
f9ee9dcb 151
0fb42626
AF
152Red Hat Network Scripts Integration
153-----------------------------------
154
155Simple integration with Red Hat network scripts has been implemented.
9feb1017 156Please read [rhel/README.RHEL] in the source tree or
0fb42626
AF
157/usr/share/doc/openvswitch/README.RHEL in the installed openvswitch
158package for details.
159
c434706a
BP
160Reporting Bugs
161--------------
162
163Please report problems to bugs@openvswitch.org.
9feb1017
TG
164
165[INSTALL.md]:INSTALL.md
166[rhel/README.RHEL]:rhel/README.RHEL