]> git.proxmox.com Git - mirror_ovs.git/blame - INSTALL.KVM.md
datapath: STT: Fix checksum handling.
[mirror_ovs.git] / INSTALL.KVM.md
CommitLineData
542cc9bb
TG
1How to Use Open vSwitch with KVM
2=================================
6cdd6a87
TD
3
4This document describes how to use Open vSwitch with the Kernel-based
5Virtual Machine (KVM). This document assumes that you have read and
9feb1017 6followed [INSTALL.md] to get Open vSwitch setup on your Linux system.
6cdd6a87
TD
7
8Setup
9-----
10
9feb1017
TG
11First, follow the setup instructions in [INSTALL.md] to get a working
12Open vSwitch installation.
6cdd6a87
TD
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
c7b0cfd3 21that make use of example Open vSwitch bridges that we'll describe in this
6cdd6a87
TD
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
542cc9bb
TG
29
30```
6cdd6a87
TD
31#!/bin/sh
32
33switch='br0'
34/sbin/ifconfig $1 0.0.0.0 up
35ovs-vsctl add-port ${switch} $1
542cc9bb 36```
6cdd6a87
TD
37
38/etc/ovs-ifdown
542cc9bb
TG
39
40```
6cdd6a87
TD
41#!/bin/sh
42
43switch='br0'
44/sbin/ifconfig $1 0.0.0.0 down
45ovs-vsctl del-port ${switch} $1
542cc9bb 46```
6cdd6a87 47
9feb1017 48At the end of [INSTALL.md], it describes basic usage of creating
6cdd6a87
TD
49bridges and ports. If you haven't already, create a bridge named
50br0 with the following command:
51
52 % ovs-vsctl add-br br0
53
54Then, add a port to the bridge for the NIC that you want your guests
55to communicate over (e.g. eth0):
56
57 % ovs-vsctl add-port br0 eth0
58
59Please refer to ovs-vsctl(8) for more details.
60
61Next, we'll start a guest that will use our ifup and ifdown scripts.
62
adfaf269 63 % kvm -m 512 -net nic,macaddr=00:11:22:EE:EE:EE -net \
542cc9bb
TG
64 tap,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown -drive \
65 file=/path/to/disk-image,boot=on
6cdd6a87
TD
66
67This will start the guest and associate a tap device with it. The
68ovs-ifup script will add a port on the br0 bridge so that the
69guest will be able to communicate over that bridge.
70
71To get some more information and for debugging you can use Open
72vSwitch utilities such as ovs-dpctl and ovs-ofctl, For example:
73
76d7178c 74 % ovs-dpctl show
6cdd6a87
TD
75 % ovs-ofctl show br0
76
77You should see tap devices for each KVM guest added as ports to
78the bridge (e.g. tap0)
79
80Please refer to ovs-dpctl(8) and ovs-ofctl(8) for more details.
81
82Bug Reporting
83-------------
84
85Please report problems to bugs@openvswitch.org.
9feb1017
TG
86
87[INSTALL.md]:INSTALL.md