From owner-freebsd-emulation@FreeBSD.ORG Sat Mar 7 21:01:40 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C63C11065670 for ; Sat, 7 Mar 2009 21:01:40 +0000 (UTC) (envelope-from phusion2k@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.227]) by mx1.freebsd.org (Postfix) with ESMTP id 9A28F8FC16 for ; Sat, 7 Mar 2009 21:01:40 +0000 (UTC) (envelope-from phusion2k@gmail.com) Received: by rv-out-0506.google.com with SMTP id f6so1092274rvb.43 for ; Sat, 07 Mar 2009 13:01:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=y1jUeTtuiTqYQV0QRLPSQ1k4pitzChnei/8iGtcq+iQ=; b=wgtIt7wmpxso/6AXpTO74jfXlInl5acnBr516M7R6wM31wn/MCLyhDH8Vu/mNTK92A YxIxxTjNqh+9lesgzjBNHk7P1hPnOR9RiW2Bok8NdM1zFnFf8mjVI4ljyT/PLlnhotPu pyxHu6VA3P1QdEAcDOXb+oCq0WAK9w5TaC604= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=GChoCosC0V8oN5zfqQ2vA0/b6NcVzavu6GUveblRzq0VhylAAweos3hfzLw1Y4Z0lt ZifWZTYWAYeVQdt2kWSuOEejOU2nvYxj4NS4gSCBy3Ab5hGHU8sQggkM7szRIeAay8w/ 5Xiev4MZOMRzQffTaXpAZVoY52hZVpsz+rAds= MIME-Version: 1.0 Received: by 10.141.68.21 with SMTP id v21mr2066970rvk.273.1236459700375; Sat, 07 Mar 2009 13:01:40 -0800 (PST) In-Reply-To: <790a9fff0903070442v66de9f4ar140cf6e2a6f716ac@mail.gmail.com> References: <790a9fff0903070442v66de9f4ar140cf6e2a6f716ac@mail.gmail.com> Date: Sat, 7 Mar 2009 15:01:40 -0600 Message-ID: From: Phusion To: Scot Hetzel Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-emulation@freebsd.org Subject: Re: Help configuring qemu networking tap mode X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2009 21:01:41 -0000 On Sat, Mar 7, 2009 at 6:42 AM, Scot Hetzel wrote: >>I would like to get networking tap mode working. I have set the >>following already. > : >>For an example network that uses DHCP for 192.168.1.x, I would like to >>have the guest os have an IP address (static or dynamic) in the same >>range. Where do I make the necessary changes? > > Once you have setup up tap networking, you just have to configure the > guest for DHCP, and it will automatically pull the DHCP address from > your networks DHCP server. > > The below Qemu Tap Network Setup is how I setup my host system to > allow the guest systems to connect to my network. =A0This setup doesn't > use any qemu startup/shutdown scripts to add/remove the tap* > interfaces from bridge0. > > Scot > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Qemu Tap Network Setup: > > 1. Setup tap* networking in rc.conf: > > cloned_interfaces=3D"bridge0 tap0 tap1" > ifconfig_bridge0=3D"addm rl10 addm tap0 addm tap1" > ifconfig_tap0=3D"up" > ifconfig_tap1=3D"up" > > 2. modify /etc/sysctl.conf > > net.link.tap.up_on_open=3D1 > net.link.tap.user_open=3D1 > > 3. create a tap group in /etc/group and add the users who can access > the /dev/tap* to the tap group. > > 4. add entry to /etc/devfs.conf for tap* > > # /dev/tap* > perm tap0 0660 > own tap0 root:tap > perm tap1 0660 > own tap1 root:tap > > 5. reboot system > > Installing Windows XP on QEMU: > > 1. Create disk image: > > qemu-img create -f raw Windows_XP.img 8G > > 2. start qemu to install Windows XP: > > Place the Windows XP CD into the cdrom drive, and execute qemu: > > qemu -name windows_xp -localtime -m 512 -net > nic,macaddr=3D52:54:DE:AD:BE:EF,model=3Drtl8139 -net > tap,ifname=3Dtap0,script=3Dno -hda Windows_XP.img -cdrom /dev/acd0 -boot = d > > NOTE: > 1. /dev/acd0 can be replaced with path to a cdrom iso image > 2. to use user mode networking just drop -net tap* and/or -net nic*. > With your help, I got this guest OS working. It now gets a DHCP address. There is still a problem related to the pf firewall on the host OS running FreeBSD 7.1. When I have the firewall disabled from running the guest OS works meaning it gets a DHCP address and can access the Internet. When the firewall is enabled, it doesn't get a DHCP address and can't access the Internet. Here is a copy of the /etc/pf.conf file. ext_if=3D"bfe0" lo_if=3D"lo0" tcp_services=3D"{ 22 }" icmp_types=3D"{ echoreq }" set block-policy return set loginterface $ext_if set skip on $lo_if scrub in nat-anchor "ftp-proxy/*" rdr-anchor "ftp-proxy/*" nat on $ext_if from !($ext_if) -> ($ext_if:0) rdr pass on $ext_if proto tcp to port 21 -> 127.0.0.1 port 8021 block in block drop in quick inet6 all block drop out quick inet6 all pass out keep state anchor "ftp-proxy/*" antispoof quick for { $lo_if } pass in on $ext_if proto tcp from any to ($ext_if) port $tcp_services flags S/SA keep state pass in inet proto icmp all icmp-type $icmp_types keep state I would like to get it working as well as have it set where there is port-forwarding for the host OS and the guest OS. Please advise and thanks for the help so far. Phusion