From owner-freebsd-virtualization@FreeBSD.ORG Sat Feb 6 10:31:32 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 CCA701065723 for ; Sat, 6 Feb 2010 10:31:32 +0000 (UTC) (envelope-from marco.borsatino@libero.it) Received: from cp-out4.libero.it (cp-out4.libero.it [212.52.84.104]) by mx1.freebsd.org (Postfix) with ESMTP id 47FFA8FC08 for ; Sat, 6 Feb 2010 10:31:31 +0000 (UTC) Received: from wmail13 (172.31.0.43) by cp-out4.libero.it (8.5.107) id 4B61D1DF007E2412 for freebsd-virtualization@freebsd.org; Sat, 6 Feb 2010 11:19:41 +0100 Message-ID: <25955505.821411265451581784.JavaMail.defaultUser@defaultHost> Date: Sat, 6 Feb 2010 11:19:41 +0100 (CET) From: "marco.borsatino@libero.it" To: freebsd-virtualization@freebsd.org MIME-Version: 1.0 X-SenderIP: 79.16.206.100 X-Mailman-Approved-At: Sat, 06 Feb 2010 10:38:00 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: virtual network with VirtualBox X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "marco.borsatino@libero.it" List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2010 10:31:32 -0000 Hi. Sorry for my bad english. I'm experimenting with a WinXP host and a virtual network using VirtualBox 3.1.2.56127; I'v created 3 virtual FreeBSD 8.0 PC. The REAL PC is connected to the internet with an ADSL router; real router has a static IP 192.168.0.1; real PC NIC address is 192.168.0.2. The first virtual PC works as a gateway between two nets with this configuration: - 1 NIC in NAT - DHCP - assigned addres 10.0.2.15 (the standard IP automatically assigned by VirtualBox 3.1.2) - 1 NIC in Internal Network - IP 172.16.1.1/24 - 1 NIC in Internal Network - IP 172.16.2.1/24 This configuration lets me go on the internet and gives me access to the clients on the 2 nets. Both virtual clients ping the others virtual PCs and both clients can access FTP area of the others virtual PCs. >From the virtual gateway I can access the real host webServer (which is not important). This is (part) of the gateway's /etc/rc.conf: hostname="fbsdgw.marbosoft.org" #this is my real ADSL router defaultrouter="192.168.0.1" ifconfig_em0="DHCP" ifconfig_em1="inet 172.16.1.1netmask 255.255.255.0" ifconfig_em2="inet 172.16.2.1netmask 255.255.255.0" gateway_enable="YES" This is first "client"'s rc.conf: hostname="fbsdnw11.marbosoft.org" ifconfig_em0="inet 172.16.1.2netmask 255.255.255.0" defaultrouter="fbsdgw" My basic idea is to create a virtual network which uses real PC ad it's ADSL router (I'm working at home) only to allow my virtual gateway to access the internet (which is possible). I'm not interested in comumunicating with real PC. I'd like to simulate a Small Office situation with a gateway, which should be the only one with an internet access (later I will, maybe, configure a firewall, a DNS server, a DHCP server, a NFS server, a Samba server ... and so on); the client virtual PCs should go on the internet through the gateway. The problem is that virtual gateway accesses the internet, but le virtual client don't. This is the output for netstat -r from virtual gateway Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 10.0.2.2 UGS 1 61 em0 10.0.2.0 link#1 U 0 0 em0 10.0.2.15 link#1 UHS 0 0 lo0 localhost link#4 UH 0 20 lo0 172.16.1.0 link#2 U 0 0 em1 fbsdgw link#2 UHS 0 0 lo0 172.16.2.0 link#3 U 0 0 em2 172.16.2.1 link#3 UHS 0 0 lo0 I think that 10.0.2.2 is the address of VirtualBox DHCP. I've tried to configure em0 as a NIC with a bridge, but I've failed (probably for a fault of kowledge aboud bridges). Thank you for any help. Marco