linux:generic:qemu
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:generic:qemu [2013/05/26 09:02] – add Open vSwitch stybla | linux:generic:qemu [2013/06/08 09:20] (current) – [VDE2] add couple FIXME - connect two switches, monitoring traffic stybla | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| ===== Networking ===== | ===== Networking ===== | ||
| + | |||
| + | Quite nice summary of QEMU networking at [[http:// | ||
| + | Beware, though, it doesn' | ||
| + | which are usually confused for 802.1q. I originally wanted to describe it here, but since it' | ||
| + | described elsewhere, I won't. | ||
| + | |||
| ==== VDE2 ==== | ==== VDE2 ==== | ||
| - | FIXME 8-) | + | * Project site: [[http:// |
| + | * Project site: [[https:// | ||
| + | |||
| + | > VDE is an ethernet compliant virtual network that can be spawned over a set of physical | ||
| + | > computer over the Internet. VDE is part of virtualsquare project. | ||
| + | |||
| + | I think VDE is fairly simple to setup and use and sufficient for regular use. I haven' | ||
| + | to connect multiple VDE switches together yet. | ||
| + | |||
| + | |||
| + | === Configuration === | ||
| + | |||
| + | VDE doesn' | ||
| + | of noteworthy things about VDE: | ||
| + | |||
| + | * QEMU has to be compiled with VDE support, resp. '' | ||
| + | * VDE can be configured either via RC script on start up or via '' | ||
| + | * VDE has to be configured every time it starts up | ||
| + | * main documentation(? | ||
| + | * you might need '' | ||
| + | |||
| + | To start up VDE switch with Host's '' | ||
| + | |||
| + | < | ||
| + | vde_switch \ | ||
| + | -s / | ||
| + | --mgmt / | ||
| + | --mgmtmode 660 \ | ||
| + | -p / | ||
| + | -t virswitch0 \ | ||
| + | -f / | ||
| + | </ | ||
| + | |||
| + | As for rc script, you just put the same commands as you would via '' | ||
| + | |||
| + | |||
| + | === Hooking up with QEMU === | ||
| + | |||
| + | This fairly simple: | ||
| + | |||
| + | < | ||
| + | [other QEMU parameters] | ||
| + | -netdev vde, | ||
| + | -device virtio-net-pci, | ||
| + | </ | ||
| + | |||
| + | And if you want to hook up your VM on specific port. This is quite useful when VLANs are used: | ||
| + | |||
| + | < | ||
| + | [other QEMU parameters] | ||
| + | -netdev vde, | ||
| + | -device virtio-net-pci, | ||
| + | </ | ||
| + | |||
| + | |||
| + | === VLANs === | ||
| + | |||
| + | VLANs with VDE are easy and a bit tricky at the same time. What I really like is they remind | ||
| + | me VLANs in non-Cisco hardware - simple, easy, clean. | ||
| + | |||
| + | You can configure VLANs in two ways. Either via '' | ||
| + | these two go hand in hand where former is good for testing and latter for a " | ||
| + | I'm not going over '' | ||
| + | and I see no reason to parrot it here. | ||
| + | |||
| + | |||
| + | Here is a simple and short RC script/set of '' | ||
| + | |||
| + | < | ||
| + | port/ | ||
| + | port/sethub 0 | ||
| + | |||
| + | vlan/create 100 | ||
| + | |||
| + | port/create 1 | ||
| + | port/ | ||
| + | |||
| + | port/create 2 | ||
| + | port/ | ||
| + | vlan/add 100 2 | ||
| + | |||
| + | port/create 3 | ||
| + | port/ | ||
| + | port/ | ||
| + | vlan/add 100 3 | ||
| + | |||
| + | port/create 4 | ||
| + | port/ | ||
| + | port/ | ||
| + | </ | ||
| + | |||
| + | And here is explanation(matches commands +/-): | ||
| + | |||
| + | - switch has 32 ports | ||
| + | - it's a switch, not a hub | ||
| + | - create VLAN 100 | ||
| + | - create port #1 which: | ||
| + | - can be allocated only if ', | ||
| + | - accepts untagged traffic, resp. traffic with VLAN#0 | ||
| + | - create port #2 which: | ||
| + | - can be allocated only if ', | ||
| + | - add port to VLAN# | ||
| + | - accepts untagged traffic, resp. traffic with VLAN#0 | ||
| + | - create port #3 which: | ||
| + | - can be allocated only if ', | ||
| + | - doesn' | ||
| + | - add port to VLAN# | ||
| + | - create port #4 which: | ||
| + | - can be allocated only if ', | ||
| + | - all incoming untagged traffic is tagged with VLAN#100 | ||
| + | |||
| + | Some more notes: | ||
| + | * how-to delete VLAN#0 or remove ports from VLAN#0 | ||
| + | * you can't, because it's used for untagged traffic | ||
| + | * however you can ' | ||
| + | * or ' | ||
| + | * **NOTE:** there is a bug, at least in VDE2-2.3.2, which will cause '' | ||
| + | - ' | ||
| + | - attach QEMU VM specifically to ' | ||
| + | - your '' | ||
| + | * ' | ||
| + | * seems to be thing you want when running VLANs | ||
| + | * you really don't want your VM to be auto-binded to random port with " | ||
| + | * FIXME connect two VDE switches | ||
| + | * # dpipe vde_plug /tmp/vde1 = vde_plug /tmp/vde2 & ; | ||
| + | * however, why would you use # dpipe; since you can use the very same TAP interface? | ||
| + | * could you use OpenVPN(tap interface)? and wouldn' | ||
| + | * FIXME [[http:// | ||
| Line 111: | Line 244: | ||
| Possible values for '' | Possible values for '' | ||
| - | * '' | + | * '' |
| - | * '' | + | * '' |
| - | * '' | + | * '' |
| - | * '' | + | * '' |
| - | + | ||
| - | What I haven' | + | |
| - | * multiple | + | |
| - | * multiple | + | |
| < | < | ||
| Line 131: | Line 260: | ||
| # tagged VLAN 100 and 200 | # tagged VLAN 100 and 200 | ||
| ovs-ctl add-port br0 tap1 trunk=100, | ovs-ctl add-port br0 tap1 trunk=100, | ||
| + | |||
| + | # multiple tagged VLANs(tagging done on VM), default VLAN for untagged traffic is 100 | ||
| + | ovs-ctl set port tap1 tag=100 vlan_mode=native-untagged | ||
| </ | </ | ||
| - | === Links === | + | ===== Links ===== |
| * [[http:// | * [[http:// | ||
| * [[http:// | * [[http:// | ||
| * [[http:// | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
linux/generic/qemu.1369576949.txt.gz · Last modified: by stybla
