From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T70pV-0003J4-9J for qemu-devel@nongnu.org; Thu, 30 Aug 2012 05:14:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T70pQ-0005pm-OS for qemu-devel@nongnu.org; Thu, 30 Aug 2012 05:14:25 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:39621) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T70pQ-0005pf-IQ for qemu-devel@nongnu.org; Thu, 30 Aug 2012 05:14:20 -0400 Received: by weyz53 with SMTP id z53so822705wey.4 for ; Thu, 30 Aug 2012 02:14:19 -0700 (PDT) Date: Thu, 30 Aug 2012 10:14:16 +0100 From: Stefan Hajnoczi Message-ID: <20120830091416.GD6814@stefanha-thinkpad.localdomain> References: <7F9A6D26EB51614FBF9F81C0DA4CFEC8026E2BC561E5@il-ex01.ad.checkpoint.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7F9A6D26EB51614FBF9F81C0DA4CFEC8026E2BC561E5@il-ex01.ad.checkpoint.com> Subject: Re: [Qemu-devel] Adding support for Stateless Static NAT for TAP devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Basila Cc: Anthony Liguori , "qemu-devel@nongnu.org" On Thu, Aug 30, 2012 at 09:12:19AM +0300, John Basila wrote: > When running multiple instances of QEMU from the same image file > (using -snapshot) and connecting each instance to a dedicated TAP > device, the Guest OS will most likely not be able to communicate > with the outside world as all packets leave the Guest OS from the > same IP and thus the Host OS will have difficulty returning the > packets to the correct TAP device/Guest OS. Stateless Static > Network Address Translation or SSNAT allows the QEMU to map the > network of the Guest OS to the network of the TAP device allowing > a unique IP address for each Guest OS that ease such case. > The only mandatory argument to the SSNAT is the Guest OS network > IP, the rest will be figured out from the underlying TAP device. > > Signed-off-by: John Basila > --- > net/tap.c | 369 +++++++++++++++++++++++++++++++++++++++++++++++++++++- > qapi-schema.json | 5 +- > qemu-options.hx | 10 ++- > 3 files changed, 381 insertions(+), 3 deletions(-) This does not work with vhost=on because the host<->guest packet processing happens in vhost_net.ko instead of in QEMU. Use iptables on the host to NAT the tap interface. Stefan