Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BuADr-0000Qf-L9 for qemu-devel@nongnu.org; Mon, 09 Aug 2004 09:29:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BuADo-0000OT-0t for qemu-devel@nongnu.org; Mon, 09 Aug 2004 09:29:55 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BuADn-0000OJ-Tj for qemu-devel@nongnu.org; Mon, 09 Aug 2004 09:29:51 -0400 Received: from [66.163.168.180] (helo=smtp801.mail.sc5.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1BuA9m-0002hY-K4 for qemu-devel@nongnu.org; Mon, 09 Aug 2004 09:25:42 -0400 From: Joe Menola Subject: Re: [Qemu-devel] qemu and TUN/TAP; a conceptual overview and instructions for use. Date: Mon, 9 Aug 2004 08:25:55 -0500 References: <1092056497.11553.30.camel@unixadmindazfc2.chh.co.nz> In-Reply-To: <1092056497.11553.30.camel@unixadmindazfc2.chh.co.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200408090825.55269.menola@sbcglobal.net> 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 On Mon August 9 2004 8:01 am, Darryl Dixon wrote: > #!/bin/bash > iptables --flush #Clear out all previous rules > ('/etc/init.d/iptables stop' may also work) > echo 1 >/proc/sys/net/ipv4/ip_forward #Enable IP forwarding for the > host OS > iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE #Enable > masquerading on your real NIC so tun0 can get in and out > ifconfig $1 10.0.0.1 #Bring up tun0 on a different subnet from the > host > --------8<--------snip This should work as far as tun0 goes, but this kills all preset iptables=20 rules. Which is fine if you're not using iptables. To preserve other iptabl= es=20 I've added Masquerade to my saved rules via: =46rom terminal as root #iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE=20 #/etc/rc.d/init.d/iptables save And eliminated the "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE "= =20 command from my qemu-ifup script. Of course iptables must be set to start o= n=20 boot. Hope this helps more then it confuses. =2Djm