Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C1Ftn-0006rt-Eg for qemu-devel@nongnu.org; Sat, 28 Aug 2004 22:58:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C1Ftl-0006rT-Jx for qemu-devel@nongnu.org; Sat, 28 Aug 2004 22:58:30 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C1Ftl-0006rQ-Gb for qemu-devel@nongnu.org; Sat, 28 Aug 2004 22:58:29 -0400 Received: from [66.163.170.84] (helo=smtp814.mail.sc5.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1C1Foh-0003Nw-5K for qemu-devel@nongnu.org; Sat, 28 Aug 2004 22:53:15 -0400 From: Joe Menola Subject: Re: [Qemu-devel] eth0 problems Date: Sat, 28 Aug 2004 21:53:02 -0500 References: <4130FF10.4040502@neenet.com> <20040829010306.GA15763@jbrown.mylinuxbox.org> <41312995.4080900@neenet.com> In-Reply-To: <41312995.4080900@neenet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200408282153.02612.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 Sat August 28 2004 7:55 pm, Lonnie Cumberland wrote: > I just looked at  the kernel sources for my 2.6.3-7mdk kernel and > TUN/TAP has already been compiled in as a module. > > Although there is no /dev/net/tun0 listed or /dev/tun0 as well /dev/net/tun0 wont exist until module "tun" is loaded. If you wish to setup a tun device, I've created a small and raw howto for my own use on what works for me. Should give you a decent start... >>>>>> First off, kernel needs tun networking support compiled in and module loaded. "eth0" =host device connected to lan "/etc/rc.d/init.d" = path to init scripts adjust as needed Setup Masquerade Run in terminal as root: # iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE #/etc/rc.d/init.d/iptables save Sanity check #/etc/rc.d/init.d/iptables start #/etc/rc.d/init.d/iptables status Rule "Chain POSTROUTING (policy ACCEPT)" should contain: "MASQUERADE all -- anywhere anywhere" Create Ifup scripts 1- Create file: /etc/qemu-ifup #!/bin/sh sudo /sbin/ifconfig $1 sudo /etc/qemu-iptables #end 2- #chmod 777 /etc/qemu-ifup 3- Create file /etc/qemu-iptables #!/bin/sh /etc/rc.d/init.d/iptables stop echo "1" >&/proc/sys/net/ipv4/ip_forward /etc/rc.d/init.d/iptables start #/usr/sbin/dhcpd -q tun0 #end 4- #chmod 777 /etc/qemu-iptables <<<<<<<<<<