]>
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 | ||
71 | 7a. On RHEL 5, to build the Open vSwitch kernel module, copy | |
c434706a BP |
72 | rhel/kmodtool-openvswitch-el5.sh into the RPM source directory and |
73 | run: | |
74 | ||
75 | rpmbuild -bb --target=i686-unknown-linux \ | |
76 | rhel/openvswitch-kmod-rhel5.spec | |
77 | ||
78 | You might have to specify a kernel version, e.g.: | |
79 | ||
80 | rpmbuild -bb -D "kversion 2.6.18-238.12.1.el5" \ | |
81 | --target=i686-unknown-linux \ | |
82 | rhel/openvswitch-kmod-rhel5.spec | |
83 | ||
84 | This produces a "kmod-openvswitch" RPM for each kernel variant, | |
85 | which is usually: "kmod-openvswitch", "kmod-openvswitch-xen", and | |
86 | "kmod-openvswitch-PAE". | |
87 | ||
9c12d2ec GS |
88 | 7b. On RHEL 6, to build the Open vSwitch kernel module, copy |
89 | rhel/openvswitch-kmod.files into the RPM source directory and run: | |
c434706a BP |
90 | |
91 | rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec | |
92 | ||
6c9b8ee4 AF |
93 | You might have to specify a kernel version and/or variants, e.g.: |
94 | ||
95 | rpmbuild -bb \ | |
96 | -D "kversion 2.6.32-131.6.1.el6.x86_64" \ | |
97 | -D "kflavors default debug kdump" \ | |
98 | rhel/openvswitch-kmod-rhel6.spec | |
99 | ||
100 | This produces an "kmod-openvswitch" RPM for each kernel variant, | |
101 | in this example: "kmod-openvswitch", "kmod-openvswitch-debug", and | |
102 | "kmod-openvswitch-kdump". | |
c434706a | 103 | |
f9ee9dcb GS |
104 | A RHEL host has default firewall rules that prevent any Open vSwitch tunnel |
105 | traffic from passing through. If a user configures Open vSwitch tunnels like | |
106 | GRE, VXLAN, LISP etc., they will either have to manually add iptables firewall | |
107 | rules to allow the tunnel traffic or add it through a startup script (Please | |
108 | refer to the "enable-protocol" command in the ovs-ctl(8) manpage). | |
109 | ||
0fb42626 AF |
110 | Red Hat Network Scripts Integration |
111 | ----------------------------------- | |
112 | ||
113 | Simple integration with Red Hat network scripts has been implemented. | |
114 | Please read rhel/README.RHEL in the source tree or | |
115 | /usr/share/doc/openvswitch/README.RHEL in the installed openvswitch | |
116 | package for details. | |
117 | ||
c434706a BP |
118 | Reporting Bugs |
119 | -------------- | |
120 | ||
121 | Please report problems to bugs@openvswitch.org. |