From owner-freebsd-emulation@FreeBSD.ORG Thu Aug 2 20:14:39 2007 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 E0E2916A419 for ; Thu, 2 Aug 2007 20:14:38 +0000 (UTC) (envelope-from datahead4@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.180]) by mx1.freebsd.org (Postfix) with ESMTP id BB88A13C461 for ; Thu, 2 Aug 2007 20:14:38 +0000 (UTC) (envelope-from datahead4@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so662832waf for ; Thu, 02 Aug 2007 13:14:38 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=d2V3CtONugrbPzvGPMy6blijZdjZXgcVM39G9cZLQDMNMk7ycEa+gIOpKtdk3GeqUVn4hm7EF7ar76WDCcPAQY/6VS0SeOO725OA4OMH5oMvBckZv1uqf/0wP2vosziVpKN1xHOY5t1ZtygOwfOYPzedeAQdPZrWE7+Klqd3jpk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=pl5+pVAS+CPXXsJqd5ktwVzpkk5dD3zPqT0GrQnEnzjeBVlcpUzDMMOZkeMx2F4FZhCHoZEivCbZi0CuQM16vqnybeYrAW5bnbVO3JqbMsr8H6652UV4pTa7MNfiniXQsikhT+PVMcyd9Uc3YK0qt7rqaQPa2wd5etfIpG6U5zg= Received: by 10.114.149.2 with SMTP id w2mr2204919wad.1186085677824; Thu, 02 Aug 2007 13:14:37 -0700 (PDT) Received: by 10.114.205.5 with HTTP; Thu, 2 Aug 2007 13:14:36 -0700 (PDT) Message-ID: Date: Thu, 2 Aug 2007 15:14:37 -0500 From: Matt To: "Trent Nelson" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: freebsd-emulation@freebsd.org Subject: Re: Qemu networking issue 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: Thu, 02 Aug 2007 20:14:39 -0000 On 8/2/07, Trent Nelson wrote: > [ Please CC me on replies as I'm not subscribed to this list. ] > > I've got a 6.2-STABLE box that I'm running qemu 0.9.0 on, hosting a > Windows 2003 guest OS. I've got an em0 interface configured with the IP > address 216.203.62.30 (default route: 216.203.62.29), as well as ten > aliased (public) IPs, one of which happens to be 205.97.38.47, which I > want to dedicate to this particular virtual machine, as if it were a > jail. > > How do I get the Windows guest to use the 205.97.38.47 IP address? > After a day of googling and trying half a dozen different approaches, > nothing I try seems to work. > > I've tried the sysctl net.link.ether.bridge and ifconfig bridge0 > approaches mentioned in [1-4]. This initially involved having a tap0 > inet 0.0.0.0 broadcast 0.255.255.255 interface, and a bridge0 with > em0,tap0 (and no assigned IP for the bridge), but when I tried to tell > the Windows box to use IP 205.97.38.47 (after I've removed this aliased > IP from em0), subnet 0xffffff00, gateway 216.203.62.29, the local > connection properties dialog would hang with 'Acquiring address...' then > eventually fail. If I picked an IP address like 192.168.0.1, it would > go through, but there wouldn't actually be any network connectivity > between the host/guest. > > When 205.97.38.47 was aliased to em0, Windows would complain that there > was another IP on the network with the same IP (which is to be expected > I guess), and dmesg would have a bunch of arp messages about the qemu > guest mac address '52:54:00:12:34:56' trying to use em0's 205.97.38.47, > also to be expected. I tried a few things like using the qemu mac > address for tap0, setting tap0's inet to 205.97.38.47 instead of > 0.0.0.0, keeping 0.0.0.0 but having 205.97.38.47 as an alias, setting > bridge0's inet to 205.97.38.47 and playing with the arp table to coerce > things further, but nothing resulted in traffic between the host/guest. > > Anyone have any insight? > > Trent. > > [1]: http://www.nabble.com/Virtual-network-with-qemu-t3940434.html > [2]: > http://docs.freebsd.org/cgi/getmsg.cgi?fetch=111250+0+archive/2007/freeb > sd-emulation/20070603.freebsd-emulation > [3]: http://forums.bsdnexus.com/viewtopic.php?id=1563 > [4]: http://acidos.bandwidth-junkies.net/index.php?Sect=qemu > _______________________________________________ > freebsd-emulation@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-emulation > To unsubscribe, send any mail to "freebsd-emulation-unsubscribe@freebsd.org" > I use the bridge/tap networking approach on my FreeBSD host for WinXP guests and it seems to work well. General config is as follows: 1. On host, issue commands to create the bridge interface and populate it with one of your physical network interfaces and one tap interface (make sure the if_bridge and if_tap kernel modules are loaded if they're not compiled into your kernel already). E.g. "ifconfig bridge0 create" "ifconfig bridge0 addm eth0 addm tap0" "ifconfig bridge0 up" 2. For qemu command line, include something like this: "-net nic -net tap,ifname=tap0,script=//if-up". 3. The if-up script mentioned above should be something like this: #!/bin/sh ext_if="eth1" tap_if="$1" sudo ifconfig $tap_if up 4. As long as you have the sysctl value "net.link.tap.user_open=1" set, you should be able to launch the qemu program with normal user creds. 5. Configure the Windows guest to have the static IP address that you are after, first ensuring that that IP is not used by any of your interfaces or anyone else on the network. HTH Matt