From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BdBDq-0006ez-QB for qemu-devel@nongnu.org; Wed, 23 Jun 2004 13:07:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BdBDp-0006eh-UA for qemu-devel@nongnu.org; Wed, 23 Jun 2004 13:07:42 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BdBDp-0006eR-Rg for qemu-devel@nongnu.org; Wed, 23 Jun 2004 13:07:41 -0400 Received: from [38.113.3.61] (helo=babyruth.hotpop.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BdBCD-0002WQ-GZ for qemu-devel@nongnu.org; Wed, 23 Jun 2004 13:06:01 -0400 Received: from phreaker.net (kubrick.hotpop.com [38.113.3.103]) by babyruth.hotpop.com (Postfix) with SMTP id 75C5D646E96 for ; Wed, 23 Jun 2004 16:26:03 +0000 (UTC) Date: Wed, 23 Jun 2004 13:03:25 -0400 From: "Jim C. Brown" Subject: Re: [Qemu-devel] Question about tun/tap networking Message-ID: <20040623170325.GB22835@jbrown.mylinuxbox.org> References: <200406230754.07821.pjr@ucar.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200406230754.07821.pjr@ucar.edu> Reply-To: jbrown106@swift-mail.com, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Phil Rasch Cc: qemu-devel@nongnu.org On Wed, Jun 23, 2004 at 07:54:07AM -0600, Phil Rasch wrote: > I have been running a mixture of linux and windows machines, all real machines > on a LAN connected to the outside world through a router, which is acting as > my DHCP server, DNS server, and gateway machine. > > The LAN subnet is 192.168.0.* > > Now I want to connect up the virtual machine running under QEMU. I want the > virtual machine to be on the same subnet as the real machines, and to use > DHCP from the router to get all the relevant info. That is tricky. You will need to look into bridging. > > Jim suggested the following commands for somebody else on the mailing list, > but I think that was headed towards devising a subnet that two virtual > machines could use to talk to each other. > > [/space/qemu/qemu-0.5.4/ $] su root > [/space/qemu/qemu-0.5.4/ #] vde_switch -daemon -tap tap0 > [/space/qemu/qemu-0.5.4/ #] ifconfig tap0 192.168.1.254 > [/space/qemu/qemu-0.5.4/ #] chmod 777 /tmp/vde.ctl > [/space/qemu/qemu-0.5.4/ #] exit > [/space/qemu/qemu-0.5.4/ $] vdeq qemu -hda disk1.img That is correct. You now have 2 subnets, 198.168.0.* for the real network and 192.168.1.* for qemu/VDE. > > The thing I dont understand is whether the above command is setting up > seperate subnet for the virtual machines, or whether I can also set them up > on the same subnet as the real machines, and let them see the DHCP server, > etc, and if so, then how to do it. So far, I have never needed to learn the > subtleties of ifconfig. Am I going to have to do so now? Do you have anymore > advice on using VDE and QEMU together for my purpose? Like I said, you will need to use bridging. After you have loaded vde_switch, skip the ifconfig step, and combine eth0 and tap0 into br0. Then you will need to set up br0 properly. If you are going to use bridging however, I recommend you use tuntap instead of VDE. (You don't really need VDE if you are going to to use bridging.) If you decide to go with tuntap and bridging, you should look in the qemu archives for assistance. There are several messages that appear to have useful information on this topic, such as this one which tells you step-by-step: http://lists.gnu.org/archive/html/qemu-devel/2004-05/msg00032.html (you'll need to do a 'brctl addif br0 eth0' and a 'ifconfig br0 192.168.0.XXX' for the machine that will be running qemu (almost certainly in one of the startup scripts, as eth0 must not have an ip yet) but otherwise the instructions are exactly the same.) I am curious though, why do you require that the virtual machines be on the same subnet as the real ones? > > Thanks > > Phil -- Infinite complexity begets infinite beauty. Infinite precision begets infinite perfection.