From owner-freebsd-emulation@FreeBSD.ORG Mon Jun 1 19:37:28 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 BBFAC106566C for ; Mon, 1 Jun 2009 19:37:28 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 7A0E88FC17 for ; Mon, 1 Jun 2009 19:37:28 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id B8F9A1E00118; Mon, 1 Jun 2009 21:37:27 +0200 (CEST) Received: from triton.kn-bremen.de (noident@localhost [127.0.0.1]) by triton.kn-bremen.de (8.14.3/8.14.3) with ESMTP id n51JYb3n015455; Mon, 1 Jun 2009 21:34:37 +0200 (CEST) (envelope-from nox@triton.kn-bremen.de) Received: (from nox@localhost) by triton.kn-bremen.de (8.14.3/8.14.3/Submit) id n51JYbou015454; Mon, 1 Jun 2009 21:34:37 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Mon, 1 Jun 2009 21:34:36 +0200 To: Jedrzej Kalinowski Message-ID: <20090601193436.GA15261@triton.kn-bremen.de> References: <200906011636.n51GaCbJ007208@triton.kn-bremen.de> <4A24180D.1090006@iem.pw.edu.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A24180D.1090006@iem.pw.edu.pl> User-Agent: Mutt/1.5.19 (2009-01-05) 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 19:37:29 -0000 On Mon, Jun 01, 2009 at 08:03:57PM +0200, Jedrzej Kalinowski wrote: > 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 > > Ah so the automatic mac assignment has been fixed, even better :) > > > > 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 Thanx for the kind words... Juergen