]> git.proxmox.com Git - mirror_ovs.git/blame - INSTALL.KVM
datapath: Remove a debugging message.
[mirror_ovs.git] / INSTALL.KVM
CommitLineData
6cdd6a87
TD
1 How to Use Open vSwitch with KVM
2 =================================
3
4This document describes how to use Open vSwitch with the Kernel-based
5Virtual Machine (KVM). This document assumes that you have read and
f6eb6b20 6followed INSTALL to get Open vSwitch setup on your Linux system.
6cdd6a87
TD
7
8Setup
9-----
10
f6eb6b20 11First, follow the setup instructions in INSTALL to get a working
6cdd6a87
TD
12Open vSwitch installation.
13
14KVM uses tunctl to handle various bridging modes, which you can
15install with the Debian/Ubuntu package uml-utilities.
16
17 % apt-get install uml-utilities
18
19Next, you will need to modify or create custom versions of the qemu-ifup
20and qemu-ifdown scripts. In this guide, we'll create custom versions
21that make use of example open vSwitch bridges that we'll describe in this
22guide.
23
24Create the following two files and store them in known locations.
25
05d09469 26For example /etc/ovs-ifup and /etc/ovs-ifdown
6cdd6a87
TD
27
28/etc/ovs-ifup
29--------------------------------------------------------------------
30#!/bin/sh
31
32switch='br0'
33/sbin/ifconfig $1 0.0.0.0 up
34ovs-vsctl add-port ${switch} $1
35--------------------------------------------------------------------
36
37/etc/ovs-ifdown
38--------------------------------------------------------------------
39#!/bin/sh
40
41switch='br0'
42/sbin/ifconfig $1 0.0.0.0 down
43ovs-vsctl del-port ${switch} $1
44--------------------------------------------------------------------
45
f6eb6b20 46At the end of INSTALL, it describes basic usage of creating
6cdd6a87
TD
47bridges and ports. If you haven't already, create a bridge named
48br0 with the following command:
49
50 % ovs-vsctl add-br br0
51
52Then, add a port to the bridge for the NIC that you want your guests
53to communicate over (e.g. eth0):
54
55 % ovs-vsctl add-port br0 eth0
56
57Please refer to ovs-vsctl(8) for more details.
58
59Next, we'll start a guest that will use our ifup and ifdown scripts.
60
adfaf269 61 % kvm -m 512 -net nic,macaddr=00:11:22:EE:EE:EE -net \
6cdd6a87
TD
62tap,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown -drive \
63file=/path/to/disk-image,boot=on
64
65This will start the guest and associate a tap device with it. The
66ovs-ifup script will add a port on the br0 bridge so that the
67guest will be able to communicate over that bridge.
68
69To get some more information and for debugging you can use Open
70vSwitch utilities such as ovs-dpctl and ovs-ofctl, For example:
71
76d7178c 72 % ovs-dpctl show
6cdd6a87
TD
73 % ovs-ofctl show br0
74
75You should see tap devices for each KVM guest added as ports to
76the bridge (e.g. tap0)
77
78Please refer to ovs-dpctl(8) and ovs-ofctl(8) for more details.
79
80Bug Reporting
81-------------
82
83Please report problems to bugs@openvswitch.org.