]>
Commit | Line | Data |
---|---|---|
c434706a BP |
1 | How to Install Open vSwitch on Red Hat Enterprise Linux |
2 | ======================================================= | |
3 | ||
4 | This document describes how to build and install Open vSwitch on a Red | |
5 | Hat Enterprise Linux (RHEL) host. If you want to install Open vSwitch | |
f6eb6b20 | 6 | on a generic Linux host, see INSTALL instead. |
c434706a BP |
7 | |
8 | We have tested these instructions with RHEL 5.6 and RHEL 6.0. | |
9 | ||
10 | Building Open vSwitch for RHEL | |
11 | ------------------------------ | |
12 | ||
13 | You may build from an Open vSwitch distribution tarball or from an | |
14 | Open vSwitch Git tree. | |
15 | ||
16 | Before you begin, note the RPM source directory on your version of | |
17 | RHEL. On RHEL 5, the default RPM source directory is | |
18 | /usr/src/redhat/SOURCES. On RHEL 6, it is $HOME/rpmbuild/SOURCES. | |
19 | ||
8f5cb995 BP |
20 | 1. Install build prerequisites: |
21 | ||
22 | yum install gcc make python-devel openssl-devel kernel-devel \ | |
23 | kernel-debug-devel | |
24 | ||
25 | 2. Some versions of the RHEL 6 kernel-devel package contain a broken | |
26 | "build" symlink. If you are using such a version, you must fix | |
27 | the problem before continuing. | |
28 | ||
29 | To find out whether you are affected, run: | |
30 | ||
31 | cd /lib/modules/<version> | |
32 | ls -l build/ | |
33 | ||
34 | where <version> is the version number of the RHEL 6 kernel. (The | |
35 | trailing slash in the final command is important. Be sure to include | |
36 | it.) If the "ls" command produces a directory listing, your | |
37 | kernel-devel package is OK. If it produces a "No such file or | |
38 | directory" error, your kernel-devel package is buggy. | |
39 | ||
40 | If your kernel-devel package is buggy, then you can fix it with: | |
41 | ||
42 | cd /lib/modules/<version> | |
43 | rm build | |
44 | ln -s /usr/src/kernels/<target> build | |
45 | ||
46 | where <target> is the name of an existing directory under | |
47 | /usr/src/kernels, whose name should be similar to <version> but may | |
48 | contain some extra parts. Once you have done this, verify the fix with | |
49 | the same procedure you used above to check for the problem. | |
50 | ||
51 | 3. If you are building from an Open vSwitch Git tree, then you will | |
c434706a BP |
52 | need to first create a distribution tarball by running "./boot.sh; |
53 | ./configure; make dist" in the Git tree. | |
54 | ||
8f5cb995 | 55 | 4. Copy the distribution tarball into the RPM source directory. |
c434706a | 56 | |
8f5cb995 | 57 | 5. Unpack the distribution tarball into a temporary directory and "cd" |
c434706a BP |
58 | into the root of the distribution tarball. |
59 | ||
8f5cb995 | 60 | 6. To build Open vSwitch userspace, run: |
c434706a BP |
61 | |
62 | rpmbuild -bb rhel/openvswitch.spec | |
63 | ||
64 | This produces two RPMs: "openvswitch" and "openvswitch-debuginfo". | |
65 | ||
8f5cb995 BP |
66 | If the build fails with "configure: error: source dir |
67 | /lib/modules/2.6.32-279.el6.x86_64/build doesn't exist" or similar, | |
68 | then the kernel-devel package is missing or buggy. Go back to step | |
69 | 1 or 2 and fix the problem. | |
70 | ||
207941eb | 71 | 7. On RHEL 6, to build the Open vSwitch kernel module, copy |
9c12d2ec | 72 | rhel/openvswitch-kmod.files into the RPM source directory and run: |
c434706a BP |
73 | |
74 | rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec | |
75 | ||
6c9b8ee4 AF |
76 | You might have to specify a kernel version and/or variants, e.g.: |
77 | ||
78 | rpmbuild -bb \ | |
79 | -D "kversion 2.6.32-131.6.1.el6.x86_64" \ | |
80 | -D "kflavors default debug kdump" \ | |
81 | rhel/openvswitch-kmod-rhel6.spec | |
82 | ||
83 | This produces an "kmod-openvswitch" RPM for each kernel variant, | |
84 | in this example: "kmod-openvswitch", "kmod-openvswitch-debug", and | |
85 | "kmod-openvswitch-kdump". | |
c434706a | 86 | |
f9ee9dcb GS |
87 | A RHEL host has default firewall rules that prevent any Open vSwitch tunnel |
88 | traffic from passing through. If a user configures Open vSwitch tunnels like | |
89 | GRE, VXLAN, LISP etc., they will either have to manually add iptables firewall | |
90 | rules to allow the tunnel traffic or add it through a startup script (Please | |
91 | refer to the "enable-protocol" command in the ovs-ctl(8) manpage). | |
92 | ||
0fb42626 AF |
93 | Red Hat Network Scripts Integration |
94 | ----------------------------------- | |
95 | ||
96 | Simple integration with Red Hat network scripts has been implemented. | |
97 | Please read rhel/README.RHEL in the source tree or | |
98 | /usr/share/doc/openvswitch/README.RHEL in the installed openvswitch | |
99 | package for details. | |
100 | ||
c434706a BP |
101 | Reporting Bugs |
102 | -------------- | |
103 | ||
104 | Please report problems to bugs@openvswitch.org. |