1 README.Debian for openvswitch-switch
2 ---------------------------------
4 To use the Linux kernel-based switch implementation, you will need an
5 Open vSwitch kernel module. There are multiple ways to obtain one.
6 In order of increasing manual effort, these are:
8 * Use a Linux kernel 3.3 or later, which has an integrated Open
11 The upstream Linux kernel module lacks a few features that
12 are in the third-party module. For details, please see the
13 FAQ, "What features are not available in the Open vSwitch
14 kernel datapath that ships as part of the upstream Linux
17 * Install the "openvswitch-datapath-dkms" Debian package that
18 you built earlier. This should automatically build and
19 install the Open vSwitch kernel module for your running
22 This option requires that you have a compiler and toolchain
23 installed on the machine where you run Open vSwitch, which
24 may be unacceptable in some production server environments.
26 * Install the "openvswitch-datapath-source" Debian package, use
27 "module-assistant" to build a Debian package of the Open
28 vSwitch kernel module for your kernel, and then install that
31 You can install the kernel module Debian packages that you
32 build this way on the same machine where you built it or on
33 another machine or machines, which means that you don't
34 necessarily have to have any build infrastructure on the
35 machines where you use the kernel module.
37 /usr/share/doc/openvswitch-datapath-source/README.Debian has
38 details on the build process.
40 * Build and install the kernel module by hand.
43 Debian network scripts integration
44 ----------------------------------
45 This package lets a user to optionally configure Open vSwitch bridges
46 and ports from /etc/network/interfaces. Please refer to the interfaces(5)
47 manpage for more details regarding /etc/network/interfaces.
49 The stanzas that configure the OVS bridges should begin with "allow-ovs"
50 followed by name of the bridge. Here is an example.
53 The stanzas that configure the OVS ports should begin with
54 "allow-${bridge-name}" followed by name of the port. Here is an example.
57 The following OVS specific "command" options are supported:
59 - ovs_type: This can either be OVSBridge, OVSPort, OVSIntPort, OVSBond,
60 OVSPatchPort or OVSTunnel depending on whether you configure a bridge,
61 port, an internal port, a bond, a patch port or a tunnel. This is a
64 - ovs_ports: This option specifies all the ports that belong to a bridge.
66 - ovs_bridge: This options specifies a bridge to which a port belongs.
67 This is a required option for a port.
69 - ovs_bonds: This option specifies the list of physical interfaces to be
72 - ovs_patch_peer: For "OVSPatchPort" interfaces, this field specifies
73 the patch's peer on the other bridge.
75 - ovs_tunnel_type: For "OVSTunnel" interfaces, the type of the tunnel.
76 For example, "gre", "vxlan", etc.
78 - ovs_tunnel_options: For "OVSTunnel" interfaces, this field should be
79 used to specify the tunnel options like remote_ip, key, etc.
81 - ovs_options: This option lets you add extra arguments to a ovs-vsctl
82 command. See examples.
84 - ovs_extra: This option lets you run additional ovs-vsctl commands,
85 separated by "--" (double dash). Variables can be part of the "ovs_extra"
86 option. You can provide all the standard environmental variables
87 described in the interfaces(5) man page. You can also pass shell
90 More implementation specific details can be seen in the examples.
94 ex 1: A standalone bridge.
102 ex 2: A bridge with one port.
110 iface eth0 inet manual
114 ex 3: A bridge with multiple physical ports.
122 iface eth0 inet manual
127 iface eth1 inet manual
131 ex 4: A bridge with an OVS internal port.
134 iface br1 inet static
136 netmask 255.255.255.0
141 iface vlan100 inet manual
145 ovs_extra set interface ${IFACE} external-ids:iface-id=$(hostname -s)
150 iface br2 inet static
152 netmask 255.255.255.0
157 iface bond0 inet manual
161 ovs_options bond_mode=balance-tcp lacp=active
166 iface br0 inet manual
171 iface patch0 inet manual
173 ovs_type OVSPatchPort
174 ovs_patch_peer patch1
177 iface br1 inet manual
182 iface patch1 inet manual
184 ovs_type OVSPatchPort
185 ovs_patch_peer patch0
190 iface br1 inet static
192 netmask 255.255.255.0
197 iface gre1 inet manual
201 ovs_tunnel_options options:remote_ip=182.168.1.2 options:key=1
203 ex 8: Create and destroy bridges.
205 ifup --allow=ovs $list_of_bridges
206 ifdown --allow=ovs $list_of_bridges
208 Notes on dependencies:
209 ---------------------
211 openvswitch-switch depends on $network, $named $remote_fs and $syslog to start.
212 This creates some startup dependency issues.
214 * Since openvswitch utilities are placed in /usr and /usr can be mounted
215 through NFS, openvswitch has to start after it. But if a user uses openvswitch
216 for all his networking needs and hence to mount NFS, there will be a deadlock.
217 So, if /usr is mounted through NFS and openvswitch is used for all networking,
218 the administrator should figure out a way to mount NFS before starting OVS.
219 One way to do this is in initramfs.
221 * Since openvswitch starts after $network, $remote_fs and $syslog, any startup
222 script that depends on openvswitch but starts before it, needs to be changed
223 to depend on openvswitch-switch too.
225 * Ideally, an admin should not add openvswitch bridges in the 'auto'
226 section of the 'interfaces' file. This is because, when ifupdown starts
227 working on bridges listed in 'auto', openvswitch has not yet started.
229 But, if the admin wants to go down this route and adds openvswitch bridges
230 in the 'auto' section, openvswitch-switch will forcefully be started when
231 ifupdown kicks in. In a case like this, the admin needs to make sure that /usr
232 has already been mounted and that a remote $syslog (if used) is ready to
233 receive openvswitch logs.