From owner-freebsd-questions@FreeBSD.ORG Mon Oct 24 13:02:22 2005 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D2BF216A41F for ; Mon, 24 Oct 2005 13:02:22 +0000 (GMT) (envelope-from guru@Sisis.de) Received: from hunter.Sisis.de (hunter.sisis.de [193.31.11.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id D697743D45 for ; Mon, 24 Oct 2005 13:02:21 +0000 (GMT) (envelope-from guru@Sisis.de) Received: (from mail@localhost) by hunter.Sisis.de (8.8.8/8.8.8) id PAA06360; Mon, 24 Oct 2005 15:01:08 +0200 (CEST) (envelope-from guru@Sisis.de) From: guru@Sisis.de Received: from hermes.sisis.de(193.31.10.38) by hunter.Sisis.de via smap (V2.1) id xma006358; Mon, 24 Oct 05 15:01:08 +0200 Received: from rebelion.Sisis.de (rebelion.Sisis.de [193.31.10.34]) by hermes.sisis.de (8.8.8/8.8.8) with ESMTP id PAA20637; Mon, 24 Oct 2005 15:02:20 +0200 (CEST) (envelope-from guru@Sisis.de) Received: (from guru@localhost) by rebelion.Sisis.de (8.13.3/8.13.3/Submit) id j9OD2Ixm008234; Mon, 24 Oct 2005 15:02:18 +0200 (CEST) (envelope-from guru@Sisis.de) X-Authentication-Warning: rebelion.Sisis.de: guru set sender to guru@Sisis.de using -f Date: Mon, 24 Oct 2005 15:02:18 +0200 To: dick hoogendijk Message-ID: <20051024130218.GB8020@rebelion.Sisis.de> References: <20051024144711.6dbc87b0.dick@nagual.st> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20051024144711.6dbc87b0.dick@nagual.st> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE (i386) Cc: fbsdq Subject: Re: tun/tap and qemu X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: guru@Sisis.de List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2005 13:02:22 -0000 El día Monday, October 24, 2005 a las 02:47:11PM +0200, dick hoogendijk escribió: > Qemu uses user-net network stack if NO tun/tap network init script is > found. The example on their website is about linux. > > When I use user-net all works very fine, but my virtual machine is > outside my intranet domain. It gets an 10.0.2.x IP As I understand, > using tun/tap gives me the opportunity to use a virtual card that I can > assign an ip like 192.168.11.x That way my virtual machine becomes a > member of that 192.168.11 local network (more like vmware does). > > What I did was put the tun0 device in devfs.conf (usr:root:xxx); > perm:660) The device is created under /dev (shouldn't this > be /dev/net ?) But where and how comes the initscript into being? > If I ifconfig tun0 in rc.conf only one extra ip gets assigned. > > Can someone shine some light on this matter? > > If tun/tap is difficult or not adviced, how can I make my 10.0.0.x > machines show themselves on my mail 192.168.11.xx network? I have in /boot/loader.conf # # this is required my qemu # kqemu_load=YES if_tap_load=YES and qemu must be started as 'root' to bring up the interface with a script /etc/qemu-ifup: #!/bin/sh /sbin/ifconfig $1 172.20.0.1 I'm launching the VM via an icon on the desktop which itself launches a script /home/guru/qemu/w2k/qemu.sh to make it easy to see if qemu could boot up from some saved state or has to boot the guest OS from scratch (normaly I save the VM into a file 'ram', which is of course a little bit dangerous because you are 'root'; but I'm the only person on my laptop and mostly I know what I do :-)): #!/bin/sh test `id -u` -ne 0 && { echo must be started by root ; exit } cd /home/guru/qemu/w2k # we must decide to reboot from disk or loadvm from last saved ram # test -f .laststart || { logger -t $0 "no file .laststart -- can't start, exit" exit 1 } if [ .laststart -nt ram ]; then touch .laststart qemu -localtime disk else touch .laststart qemu -localtime -loadvm ram disk fi my VM contacts the FreeBSD Samba share and printers via the IP net 172.20.0.x and for having access to the rest of the world I have NAT configured ... all works very nice and so I can run our Windows applications on top of FreeBSD.... matthias -- Matthias Apitz / Sisis Informationssysteme GmbH Gruenwalder Weg 28g / D-82041 Oberhaching Fon: ++49 89 / 61308-351, Fax: -399, Mobile ++49 170 4527211 http://www.sisis.de/~guru/