Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 07 May 2007 11:15:07 -0400
From:      Lowell Gilbert <freebsd-questions-local@be-well.ilk.org>
To:        "P.U.Kruppa" <ulrich@pukruppa.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Qemu Network with two virtual boxes
Message-ID:  <447irkpsw4.fsf@be-well.ilk.org>
In-Reply-To: <20070505074459.E16532@small> (P. U. Kruppa's message of "Sat\, 5 May 2007 08\:21\:47 %2B0200 \(CEST\)")
References:  <20070505074459.E16532@small>

next in thread | previous in thread | raw e-mail | index | archive | help
"P.U.Kruppa" <ulrich@pukruppa.net> writes:

> Hi!
>
> I am trying to connect two virtual Qemu boxes to my "real"
> network. This is what I would like to set up:
>
>
>                       | DSL Bridge to Internet|
> 	               -----------------------
>                                  |
> ___________     _________________|_________________
> "Real" LAN |---|          192.168.10.1             |
> -----------    |           FreeBSD 6.2             |
>                |        |                 |        |
> 	       |  ______|______    _______|______  |
>                | | 192.168.10.5|  | 192.168.10.6 | |
>                | |   Win2k on  |  |  FreeBSD on  | |
>                | |     Qemu    |  |     Qemu     | |
>                |  -------------    --------------  |
>                 -----------------------------------
>
> My real LAN uses 192.168.10.1 as gateway to the Internet.
>
> For now I can only connect one of the two virtual boxes to my real
> network, but not both. This is how I do it:
>
> # kldload aio kqemu if_tap bridge
> # sysctl net.link.ether.bridge_cfg=rl0,tap0
> # sysctl net.link.ether.bridge.enable=1
> # qemu-system-x86_64 -hda Win2k.img -m 512 -localtime \
>   -net tap -net nic
>
> When now I try to connect the second virtual box, it will "steal" the
> first box's network connection.
>
> Ah, yes: This is my /etc/qemu-ifup
> 	#!/bin/sh
> 	ifconfig ${1} 0.0.0.0
>
> Thanks for your help,

Connect the interfaces to a bridge interface, and connect that to the
external interface you want.  Sorry I can't give a full formula, but 
my lab configuration is down for, um, corporate restructuring.

-- 
Lowell Gilbert, embedded/networking software engineer, Boston area
		http://be-well.ilk.org/~lowell/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?447irkpsw4.fsf>