From owner-freebsd-emulation@FreeBSD.ORG Mon Jun 1 18:21:19 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12F9F10656C0 for ; Mon, 1 Jun 2009 18:21:19 +0000 (UTC) (envelope-from kalinoj1@iem.pw.edu.pl) Received: from volt.iem.pw.edu.pl (volt.iem.pw.edu.pl [194.29.146.3]) by mx1.freebsd.org (Postfix) with ESMTP id 79F228FC1A for ; Mon, 1 Jun 2009 18:21:18 +0000 (UTC) (envelope-from kalinoj1@iem.pw.edu.pl) Received: from [192.168.1.183] (chello089079156006.chello.pl [89.79.156.6]) (Authenticated sender: kalinoj1) by volt.iem.pw.edu.pl (Postfix) with ESMTPSA id 69489A665B9; Mon, 1 Jun 2009 20:05:54 +0200 (CEST) Message-ID: <4A24180D.1090006@iem.pw.edu.pl> Date: Mon, 01 Jun 2009 20:03:57 +0200 From: Jedrzej Kalinowski User-Agent: Thunderbird 2.0.0.21 (X11/20090524) MIME-Version: 1.0 To: Juergen Lock References: <200906011636.n51GaCbJ007208@triton.kn-bremen.de> In-Reply-To: <200906011636.n51GaCbJ007208@triton.kn-bremen.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter devel-r5066-exp at volt.iem.pw.edu.pl X-Virus-Status: Clean Cc: freebsd-emulation@freebsd.org Subject: Re: Qemu: Assigning two tap devices to one virtual machine X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2009 18:21:20 -0000 Juergen Lock pisze: > In article <20090523223024.GA93488@volt.iem.pw.edu.pl> you write: >> Hello all, >> >> I'm running qemu 0.10.5 on CURRENT machine and experienced an >> interesting problem. >> >> I try to run a single qemu machine with two network interfaces (tap's) >> connected to the same bridge - I need this for playing with m0n0wall for >> example. >> >> The qemu launch looks similiar to this: >> >> qemu -net nic -net tap -net nic -net tap -cdrom cdrom.iso -curses >> >> What happens is that when qemu starts up - my machine locks (sometimes I >> manage to kill qemu and recover it, sometimes not). I see that it's a >> problem with network bridge - looks like the infitine loop of arp >> requests that get replicated infinitely (it also kills/floods my real network >> that is connected through the bridge to the tap devices). >> >> My question is - have any of You tried to use multiple tap devices within >> one qemu machine? Can you replicate this problem in your environments? >> >> One note: there is no problem if I run two qemus and each of them has a >> tap device connected to bridge0. They coexist and I have no network >> issues in both guests. I can post qemu-if{up,down} scripts if needed. > > Ok just in case this hasn't been resolved yet... > > Try something like > qemu -net nic -net tap -net nic,vlan=1,macaddr=52:54:00:12:34:57 -net tap,vlan=1 -cdrom cdrom.iso -curses > > and if you want you can also add `,model=e1000' to the -net nic parameters, > that one (em(4) on FreeBSD) should perform a little better than the default > ne2kpci (ed(4) on FreeBSD.) > > Explanation: vlan= is used to associate -net nic with -net tap/user/pcap > connections (default is vlan=0), and macaddr= you need because qemu uses > one single default macaddress (52:54:00:12:34:56 atm) for all -net nic > and you can't have two nics with identical macs on the same network. > Yes, I tried it and I can confirm that it works well - assigning different vlans to different nics saves the day here. Also, good news is that qemu already doesn't create same MAC-addresses for nics blindly. I run it like this: qemu -net nic,model=e1000,vlan=0 -net user,vlan=0 -net nic,model=e1000,vlan=1 -net user,vlan=1 And get: (qemu) info network VLAN 0 devices: user.0: e1000.0: model=e1000,macaddr=52:54:00:12:34:56 VLAN 1 devices: user.1: e1000.1: model=e1000,macaddr=52:54:00:12:34:57 > Good luck, :) > Juergen > Thank you for your help, Juergen (and thanks for maintainig the port the way it is always up to date with the latest release!) Jędrzej Kalinowski