Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm writing simple program to configure and monitor DHCP server on my Ubuntu 12.04. What I'm trying to achieve that my physical machine will be DHCP server and my VM (virtual machine) get one lease (and I read that information in leases file).

I use isc-dhcp-server. I turned off network-manager during tests. I use VirtualBox to host VM, network is configured to use bridge adapter. Server starts OK, but when my VM is running I got following messages:

Jun 16 12:15:59 asus dhcpd: DHCPOFFER on 192.168.1.3 to 08:00:27:15:26:a6 (ubuntu) via eth0
Jun 16 12:15:59 asus dhcpd: DHCPDISCOVER from 08:00:27:15:26:a6 (ubuntu) via eth0
Jun 16 12:15:59 asus dhcpd: DHCPOFFER on 192.168.1.3 to 08:00:27:15:26:a6 (ubuntu) via eth0
Jun 16 12:16:12 asus dhcpd: DHCPDISCOVER from 08:00:27:15:26:a6 (ubuntu) via eth0

VM don't get any DHCPOFFERs at all. Any ideas how to solve this problem? Or different way to test DHCP server locally? I appreciate any help. Thanks in advance.

----------------------------

Here's my DHCP server configuration:

/etc/network/interfaces

iface eth0 inet static  
address 192.168.1.2  
netmask 255.255.255.0  
gateway 192.168.1.1  
broadcast 192.168.1.255

/etc/dhcp/dhcpd.conf

ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;

authoritative;
allow booting;
allow bootp;

subnet 192.168.1.0 netmask 255.255.255.0 {
  interface eth0;
  range 192.168.1.3 192.168.1.254;
  option routers 192.168.1.1;
  option subnet-mask 255.255.255.0;
  option broadcast-address 192.168.1.255;
}

/etc/default/isc-dhcp-server

INTERFACES="eth0"
share|improve this question
add comment

2 Answers 2

Ok, I've found different solution. I use two virtual machines in Internal network. One of them use static IP address and has DHCP server configured. The second VM finds DHCP server and get IP from range.

share|improve this answer
add comment

I do not understand your question exactly. But If you want to config isc-dhcp-server on your host and also test that to know if your guest OS which you installed that on the Virtual box gets its ip address from your host. I suggest you to

1.set your guest to give its IP automatically.

2.set your connection to host only adapter

3.on the /etc/default/isc-dhcp-server change INTERFACES="eth0" to INTERFACES="vboxnet0"

4.on the /etc/dhcp/dhcp3 add all address based on the your vboxnet0 ip address. Also you can find some extra information in here but as I said you should change all the ip address based on the vboxnet0 ip address may bee 192.168.56.1.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.