From owner-freebsd-virtualization@FreeBSD.ORG Sun Feb 7 10:50:21 2010 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98CAA106566B for ; Sun, 7 Feb 2010 10:50:21 +0000 (UTC) (envelope-from marco.borsatino@poste.it) Received: from relay-pt3.poste.it (relay-pt3.poste.it [62.241.4.129]) by mx1.freebsd.org (Postfix) with ESMTP id 5F4408FC08 for ; Sun, 7 Feb 2010 10:50:20 +0000 (UTC) Received: from poste.it (192.168.44.41) by relay-pt3.poste.it (8.5.121.01) id 4B6E02CB0000901E for freebsd-virtualization@freebsd.org; Sun, 7 Feb 2010 11:29:39 +0100 Date: Sun, 7 Feb 2010 11:29:38 +0100 Message-Id: MIME-Version: 1.0 X-Sensitivity: 3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: "marco\.borsatino\@poste\.it" To: freebsd-virtualization@freebsd.org X-XaM3-API-Version: 5.0(R1) X-SenderIP: 79.20.209.138 Subject: experimental virtual network with VirtualBox X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2010 10:50:21 -0000 Hi. Sorry for my bad english.=0AI'm experimenting with a WinXP host and a= virtual network using VirtualBox 3.1.2.56127; I'v created 3 virtual Free= BSD 8.0 PC.=0AThe REAL PC is connected to the internet with an ADSL route= r; real router has a static IP 192.168.0.1; real PC NIC address is 192.16= 8.0.2.=0AThe first virtual PC works as a gateway between two nets with th= is configuration:=0A- 1 NIC in NAT - DHCP - assigned addres 10.0.2.15 (th= e standard IP automatically assigned by VirtualBox 3.1.2)=0A- 1 NIC in In= ternal Network - IP 172.16.1.1/24=0A- 1 NIC in Internal Network - IP 172.= 16.2.1/24=0AThis configuration lets me go on the internet and gives me ac= cess to the clients on the 2 nets.=0ABoth virtual clients ping the others= virtual PCs and both clients can access FTP area of the others virtual P= Cs.=0AFrom the virtual gateway I can access the real host webServer (whic= h is not important).=0AThis is (part) of the gateway's /etc/rc.conf:=0A=0A= hostname=3D"fbsdgw.marbosoft.org"=0A#this is my real ADSL router=0Adefaul= trouter=3D"192.168.0.1" =0Aifconfig_em0=3D"DHCP"=0Aifconfig_em1=3D"i= net 172.16.1.1netmask 255.255.255.0"=0Aifconfig_em2=3D"inet 172.16.2.1net= mask 255.255.255.0"=0Agateway_enable=3D"YES"=0A=0AThis is first "client"'= s rc.conf:=0A=0Ahostname=3D"fbsdnw11.marbosoft.org"=0Aifconfig_em0=3D"ine= t 172.16.1.2netmask 255.255.255.0"=0Adefaultrouter=3D"fbsdgw"=0A=0AMy bas= ic idea is to create a virtual network which uses real PC ad it's ADSL ro= uter (I'm working at home) only to allow my virtual gateway to access the= internet (which is possible).=0A=0AI'm not interested in comumunicating = with real PC. I'd like to simulate a Small Office situation with a gatewa= y, which should be the only one with an internet access (later I will, ma= ybe, configure a firewall, a DNS server, a DHCP server, a NFS server, a S= amba server ... and so on); the client virtual PCs should go on the inter= net through the gateway.=0A=0AThe problem is that virtual gateway accesse= s the internet, but le virtual client don't.=0A=0AThis is the output for = netstat -r from virtual gateway=0A=0ARouting tables=0AInternet:=0ADestina= tion Gateway Flags Refs Use Netif Expire=0Adef= ault 10.0.2.2 UGS 1 61 em0=0A10.0.2= .0 link#1 U 0 0 em0=0A10.0.2.15= link#1 UHS 0 0 lo0=0Alocalhost = link#4 UH 0 20 lo0=0A172.16.1.0 = link#2 U 0 0 em1=0Afbsdgw = link#2 UHS 0 0 lo0=0A172.16.2.0 li= nk#3 U 0 0 em2=0A172.16.2.1 link#= 3 UHS 0 0 lo0=0A=0AI think that 10.0.2.2 i= s the address of VirtualBox DHCP.=0A=0AI've tried to configure em0 as a N= IC with a bridge, but I've failed (probably for a fault of kowledge aboud= bridges).=0A=0AThank you for any help.=0A=0AMarco=0A=0A=0A=0A