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