From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EQY1L-00007N-SH for qemu-devel@nongnu.org; Fri, 14 Oct 2005 18:27:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EQY1K-00006T-0t for qemu-devel@nongnu.org; Fri, 14 Oct 2005 18:27:22 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EQY1J-00006O-S2 for qemu-devel@nongnu.org; Fri, 14 Oct 2005 18:27:21 -0400 Received: from [213.165.64.21] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1EQY1J-0003bL-P1 for qemu-devel@nongnu.org; Fri, 14 Oct 2005 18:27:22 -0400 Message-ID: <43503125.7020204@gmx.net> Date: Sat, 15 Oct 2005 00:28:53 +0200 From: Marco Matthies MIME-Version: 1.0 Subject: Re: [Qemu-devel] Setting up tun/tap network doesn't work References: <43501FB5.5020303@mid.email-server.info> In-Reply-To: <43501FB5.5020303@mid.email-server.info> Content-Type: text/plain; charset=ISO-8859-15; format=flowed 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 Hi Alexander, as I also struggled hard to get qemu networking running, so i will post my notes that i made when i finally managed to get it going. But first a resource that might help you: faq in the unofficial qemu wiki: http://lilly.csoft.net/~jeffryj/cgi-bin/moin.cgi/FrequentlyAskedQuestions My setup below might be braindamaged, i simply kept going till I had it running, there might be things that i did too complicated.. YMMV. the info to get it running was scraped from various websites like the abovementioned one: ------------------------- 1) install vde (http://vde.sourceforge.net/) 2) compile kernel with tun/tap and ipv4 masquerading, forwarding, ... i don't remember anymore, i believe masquerading and forwarding was enough. my network: -------- host: 192.168.2.189 [assigned via dhcp] gateway host/guest: 192.168.254.254 [guest sees host as this ip] guest: 192.168.254.1 nameserver of isp 1.2.3.4 Host, as root: ------------------------------------------------ vde_switch -tap tap0 -daemon ifconfig tap0 192.168.254.254 [netmask 255.255.255.0] chmod 777 /tmp/vde.ctl # 755 is supposed to work as well echo "1" > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE Host, as user (example): ------------------------ vdeq qemu-system-x86_64 -boot d -cdrom knoppix.iso Guest, as root (this is for linux/bsd): --------------------------------------- ifconfig eth0 192.168.254.1 [netmask 255.255.255.0] route add default gw 192.168.254.254 echo "nameserver 1.2.3.4" >> /etc/resolv.conf Obviously you'll have to replace the addresses with the appropriate ones on your network. This setup should then allow the guest to communicate with the host and the guest to also reach the internet. Hope this helps, Marco