I am having a networking problem with VirtualBox 3.2.12
The scenario is as follows:
I have internet access in my LAN through the router (192.168.5.1).
VirtualBox machine has 2 significant network interfaces:
- wlan0 (192.168.5.5): This is the real interface
vboxnet0 (192.168.61.5): This is the host-only interface
m0n0wall:
This will be the firewall between the real world and the virtual world
This will have at least 1 interface to the real world and as many host-only interfaces as virtual LANs desired.
- 1 Bridged interface wlan0 (192.168.5.60)
1 Host-Only interface vboxnet0 (192.168.61.1)
This could be any OS, but I have chosen Ubuntu for simplicity. This guest hosts get their IP address from the m0n0wall pool and have only one Host-only interface.
This map summarizes the above description:
Code: Select all
************ ****************** +---------------------- -+
* Internet *---- router ----* Real LAN *-----+ Computer (Real) .5 + *******************
************ .1 * 192.168.5.0/24 * + m0n0wall (Virtual) .60 +----* Virtual LAN 1 *---- Ubuntu .199 (DHCP)
****************** +------------------------+ * 192.168.61.0/24 *---- ...
+ VirtualBox --> *******************
A third real machine is considered in this scenario, we well call it Laptop and its IP address is 192.168.5.105. It will be useful in conectivity tests.
A route to 192.168.60.0/22 through 192.168.5.60 has been added in the router
Virtual network interfaces in m0n0wall are PCnet-PCI II (Am79C970A) at the moment, but I have also tried others without success.
Virtual network interface in Ubuntu is Intel PRO/1000 MT Desktop (82540EM)
I cannot remember where but I found googling that someone reported problems depending on the adapter used.
The problem
Laptop cannot ping (nor access in any way) Ubuntu
The facts
Ubuntu is not really "Ubuntu" at this time, but "Xubuntu", this should not make any difference.
Ubuntu can ping (and browse) http://www.fsf.org (including DNS resolution)
Ubuntu can ping Laptop, the Echo request packet looks like:
- Source MAC: Computer(Real) wlan0 MAC address
Destination MAC: Laptop MAC address
Source IP: 192.168.5.60 (Computer, not Ubuntu) I expected to find 192.168.61.199 here
Destination IP: 192.168.5.105 (Laptop)
Laptop (and router) cannot ping Ubuntu (Laptop gets the same ICMP Redirect Host because its default gateway is 192.168.5.1 and the route is via 192.168.5.60 which is in the same network, but this behaviour is expected, hosts inside Real LAN do not need to know the path if they can ask the router)
Computer (Real), which holds VirtualBox guests, can ping Ubuntu (via vboxnet0) - it is also inside Virtual LAN 1
m0n0wall is not yet acting as a firewall
Additional considerations
This is not a production environment, it is just aimed to learn and to experiment. I can only work on this during weekends, I apologize if this is a problem.
Upgrading VirtualBox should not be the solution unless this is a known bug and it has been solved. The reason is that the host system is 64-bit only (Gentoo) and this gave me problems when trying to upgrade.
I would like to reference a recent network-related post about problems in port-forwarding in host-only interfaces, it might be helpful too.
Thank you in advance, any help, opinion or personal experience is kindly apreciated.
EDIT1: Corrected a netmask mistake (192.168.60.0/22 instead of 192.168.60.0/23), not important since the IPs involved are 192.168.61.x, but now it is the way it is configured.