Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KIxJi-0005Y7-4D for qemu-devel@nongnu.org; Tue, 15 Jul 2008 23:04:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KIxJg-0005XH-Ug for qemu-devel@nongnu.org; Tue, 15 Jul 2008 23:04:33 -0400 Received: from [199.232.76.173] (port=41640 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KIxJg-0005X5-PJ for qemu-devel@nongnu.org; Tue, 15 Jul 2008 23:04:32 -0400 Received: from outbound.icp-qv1-irony-out2.iinet.net.au ([203.59.1.107]:17710) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KIxJf-0003ch-Qm for qemu-devel@nongnu.org; Tue, 15 Jul 2008 23:04:32 -0400 Received: from hendrix (hendrix [192.168.200.99]) by hendrix.mega-nerd.net (Postfix) with SMTP id 43DABAB0F2 for ; Wed, 16 Jul 2008 13:05:47 +1000 (EST) Date: Wed, 16 Jul 2008 13:05:47 +1000 From: Erik de Castro Lopo Subject: Re: [Qemu-devel] Two taps, same IP? Message-Id: <20080716130547.b109f83a.mle+tools@mega-nerd.com> In-Reply-To: <487D510C.4070106@quinthar.com> References: <487D510C.4070106@quinthar.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org David Barrett wrote: > I'm considering a tap-based alternative to the -redir patch I proposed > earlier, but I'm just not quite getting how it works. In particular, > I'm able to access the webserver on one image just fine, but not the > other: wget fails with "Connecting to 172.20.0.3:80... failed: No route > to host." > > Can you explain why and set me straight? > > Specifically, I have two Debian qemu images (0 and 1), identical in all > respects except that image0 and image1 are configured to use static IPs > 172.20.0.2 and 172.20.0.3, respectively. I've launched both > simultaneously with the following commands: > > sudo qemu -kernel-kqemu -net nic,vlan=0 -net tap,vlan=0 image0.raw > sudo qemu -kernel-kqemu -net nic,vlan=0 -net tap,vlan=0 image1.raw > > Each image is configured with the following /etc/network/interfaces: > > auto lo > iface lo inet loopback > allow-hotplug eth0 > iface eth0 inet static > address 172.20.0.2 <--- image1 has: address 172.20.0.3 > netmask 255.255.0.0 > gateway 172.20.0.1 > > This creates two tap interfaces (0 and 1) on the Ubuntu host, curiously > with the same IP: > > tap0 Link encap:Ethernet HWaddr 00:ff:84:12:9d:72 > inet addr:172.20.0.1 Bcast:172.20.255.255 Mask:255.255.0.0 > inet6 addr: fe80::2ff:84ff:fe12:9d72/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:18 errors:0 dropped:0 overruns:0 frame:0 > TX packets:36 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:500 > RX bytes:1336 (1.3 KB) TX bytes:4704 (4.5 KB) > > tap1 Link encap:Ethernet HWaddr 00:ff:af:9a:48:29 > inet addr:172.20.0.1 Bcast:172.20.255.255 Mask:255.255.0.0 > inet6 addr: fe80::2ff:afff:fe9a:4829/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:24 errors:0 dropped:0 overruns:0 frame:0 > TX packets:34 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:500 > RX bytes:1656 (1.6 KB) TX bytes:4664 (4.5 KB) > > "wget http://172.20.0.2" and "wget http://172.20.0.3" each work fine > inside their respective VMs. But each is unable to wget the other's > webserver. I have multiple machines set up to run through one tap device (named qtap0). Originally I tried a number of different qemu networking options but in the end, I settled on VDE as that was the only one which worked reliably. When I first set it up, I think I went from this document: http://lists.gnu.org/archive/html/qemu-devel/2005-06/txtDAJWgugtC1.txt The clients have unique MAC addresses and request DHCP addresses from the host. The DHCP client on each guest is set up to send its host name back to the DHCP/DNS server (I'm using dnsmasq) and all the running guests can see all the other running guests as well as the host and other machines in the network. I have a quite a few guests (32 bit Debian, 64 bit Debian, 64 bit Fedora, 64 bit Gentoo, 64 bit FreeBSD etc), but don't have enough RAM to run more than 2 or 3 at a time. > Thanks for any tips you can provide! Maybe try the VDE networking option. Cheers, Erik -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- "TLC declared bankruptcy after they received less than 2 percent of the $175 million earned by their CD sales. That was about 40 times less than the profit that was divided among their management, production and record companies." -- Courtney Love on the REAL piracy