VirtualBox internal network with dhcp server

4

2

Using VBox 5.02 OSE, host OS is Arch Linux 4.1.6-1-ARCH

I've configured Guest OS Ubuntu Minimal 14.04 with network adapter as "internal network" using the default name for the network (intnet).

Now I've enabled the Virtualbox dhcp server for the 'intnet' private network with the following command:

$  VBoxManage dhcpserver add --netname intnet --ip 10.10.10.1 --netmask 255.255.255.0 --lowerip 10.10.10.2 --upperip 10.10.10.12 --enable

I boot the guest OS and I see that it gets the IP 10.10.10.2 dynamically assigned by the dhcp server.

But if I try now to ping the dhcp server from my VM, I get no answer:

$  ping 10.10.10.1
PING 10.10.10.1 (10.10.10.1) 56(84) bytes of data.
^C
--- 10.10.10.1 ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5005ms

Why is that?

rodrunner

Posted 2015-09-29T21:47:59.597

Reputation: 369

For those of you coming here because of the title and are actually experiencing this problem, you may notice it's caused by the --netname parameter not actually setting up a DHCP server properly, even though you specify it explicitly using the same name from within your VM's network configuration. I was basically unable to get a real DHCP service working with Internal Networking (intnet) using any other name besides intnet. – Matt – 2016-08-31T18:34:32.453

Answers

3

"Internal networking" only allows connections between virtual guests, not the host. If you want connection with the host too, choose "host only networking" (the name is misleading a bit)

Isaac Hanson

Posted 2015-09-29T21:47:59.597

Reputation: 553

0

The reason you cannot ping your internal DHCP server is likely due to a minimalistic/hardened configuration for the service itself so you effectively have a "host" not configured to respond to pings.

You can, however, perform a port scan using nmap below which will help you to see if the host is up in your internal network (note that this type of scan requires sudo privileges):

sudo nmap -Pn -n -sU -p67-68 10.10.10.1 | grep Host

You should see the following output:

Host is up (0.00021s latency).

Try it against a non-existent IP address and you shouldn't get back anything.

Matt

Posted 2015-09-29T21:47:59.597

Reputation: 145

When I tried this it said any IP address I entered was up. Maybe because I also had a NAT network configured? – ham1 – 2018-02-28T16:30:51.457