From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C0vze-0004NC-Fv for qemu-devel@nongnu.org; Sat, 28 Aug 2004 01:43:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C0vzc-0004Jb-1A for qemu-devel@nongnu.org; Sat, 28 Aug 2004 01:43:13 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C0vzb-0004Ik-VP for qemu-devel@nongnu.org; Sat, 28 Aug 2004 01:43:11 -0400 Received: from [66.163.170.82] (helo=smtp812.mail.sc5.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1C0vuT-00037V-5J for qemu-devel@nongnu.org; Sat, 28 Aug 2004 01:37:53 -0400 From: Joe Menola Subject: Re: [Qemu-devel] tun interface Date: Sat, 28 Aug 2004 00:37:50 -0500 References: <200408270830.21704.andrej@paradise.net.nz> <200408261902.28000.menola@sbcglobal.net> <200408281115.13256.andrej@paradise.net.nz> In-Reply-To: <200408281115.13256.andrej@paradise.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200408280037.50439.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 Fri August 27 2004 6:15 pm, Andrej wrote: > On Fri, 27 Aug 2004 12:02, Joe Menola wrote: > > My /etc/qemu-ifup > > > > #!/bin/sh > > sudo /sbin/ifconfig $1 > > > > script also needs to be executable. > > > > This is only my understanding of the tun concept, and it > > works. :) > > That's quite odd ... when there was no qemu-ifup my virtual > Slackware install had a network interface that it brought > up ... with tun and NATing I don't seem to get eth0 anymore. > > I believe Qemu defaults to user-net if no ifup is found. My guess is your tun device isn't setup properly. You must setup iptables, I start iptables via init, so I add MASQ rule iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE /etc/rc.d/init.d/iptables save (this way I don't have to worry about nat after each boot) And after Qemu is running, root must setup ip_forward. This cannot be done with iptables running. I do this via a script called by qemu-ifup> #!/bin/sh /etc/rc.d/init.d/iptables stop echo "1" >&/proc/sys/net/ipv4/ip_forward /etc/rc.d/init.d/iptables start -jm