ipaddress of my VM doesn't look correct
I am trying to setup metasploitable in a Virtualbox VM. My impression is, that once Virtualbox is set up to work in host-only adapter mode, the VMs should follow the networking settings defined in the following screenshot. Let me show how I set this up. I have a metasploitable VM and its displaying 10.0.2.15 for eth0 in the ifconfig output.
Here is how Virtualbox network setting are configured. I got no entrys at NAT networks.
Here is the host-only tabs:
If I edit this, here is what I see under adaptor tab:
and here is the dhcp tab.
Based on these settings, shouldn't my metasploitable machine obtain the ip address 192.168.56.101 (or up)? Is there anything wrong in my configuration?
UPDATE
Once I update network setting, enabling Bridged Mode for that VM, I am now getting following ip. This doesn't look correct based on my settings:
I get following error with dhclient command
You need to change your settings into a "Bridged" adapter. Your IP information is suggesting/showing that you are running the interface in NAT mode. Click on the image, go to settings for that guest. Select network, then adapter, in the drop down box where you assigned the adapter make sure the "Attached to" settings is set to "Bridged Adapter"
As stated in the comments, to use your virtualbox-host-only-dhcp you have to assign host-only mode in your vm config and obtain a new ip via dhcp, other ways to do this are restarting your network interface or rebooting the machine.
Take a look at the manual for more information about networking modes.
I recently faced this and the way to securely create a VM network is to create a NAT Network and assign that to the VMs. Using Mac OS X and VirtualBox (Version 5.2.24 r128163 (Qt5.6.3)), one can create a NAT Network
by:
- Press
⌘,
to open preferences dialog - Select the
Network
icon - Select "Adds new NAT Network" icon
Then for each VM:
- Select the VM
- Press
⌘s
to open its settings dialog - Select the
Network
icon - On the
Attached To:
drop down, selectNAT Network
The one you just created should be automatically selected. When you restart each VM they should all be in a network where they can speak to each other and the outside network but not vice-versa. This table expresses that pretty well.