Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am setting up a DHCP server on Debain (virtual machine) on Ubuntu 12.04 host, but unable to get it up and running.

My configuration is like this,

dhcpd.conf

ddns-update-style none;
option domain-name "xyz.com";
option domain-name-servers ns1.example.org, ns2.example.org;

default-lease-time 600;
max-lease-time 7200;

authoritative;
log-facility local7;

subnet 172.16.101.0 netmask 255.255.255.0 {
  range 172.16.101.10 172.16.101.20;
  #option broadcast-address 172.16.101.255;
  #option subnet-mask 255.255.255.0;
  option routers 172.16.101.1;
}

For interfaces

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth2
auto eth2
iface eth2 inet dhcp

/etc/default/isc-dhcp-server

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#   Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth2"

but everytime I restart dhcp service it says,

root@debian1:/home/user# /etc/init.d/isc-dhcp-server restart
Stopping ISC DHCP server: dhcpd failed!
Starting ISC DHCP server: dhcpdcheck syslog for diagnostics. ... failed!
 failed!

What is wrong with this configuration?

share|improve this question
2  
So, what is in the /var/log/messages? –  Serge Oct 3 '12 at 10:10
    
No subnet declaration for eth1 (no IPv4 addresses) Ignoring requests on eth1. If this is not what you want, please write a subnet declaration in your dhcpd.conf file for the network segment to which interface eth1 is attached. –  Newbie Oct 3 '12 at 12:38
add comment

2 Answers

Are you trying to have a system get an address for itself via DHCP? That's a bad idea for very many reasons.

You need a DHCP server running outside of this system.

I believe the isc-dhcp-server is failing because no interface is on the same subnet as your specified DHCP scope. eth2 cannot fufill this criteria because it has no IP address. And if it had an IP address ... it wouldn't need to get one via DHCP. You can see why what you are doing makes no sense.

Do a tail -n 30 /var/log/syslog after you try to start it again to be exactly sure.

share|improve this answer
add comment

As the only problem is VM connectivity and your router provides IP configuration of your LAN then switch off the dhcpd so it would not start at boot.

Then start VirtualBox, open Settings of your VM and click on Network. In the Attached to dropdown list select Bridged Adapter. Then click OK and start your VM.

Your guest OS should get the address from the router.

share|improve this answer
    
It is already in the bridged mode. Even then the NIC card on physical machine gets IP from the DHCP. –  Newbie Oct 3 '12 at 17:34
    
Then could you please clarify your question What exactly you would like to do. –  Serge Oct 3 '12 at 20:35
    
I am trying to bridge connect two DHCP servers (virtual machines) in different subnets to one physical NIC. But, my first DHCP server won't start unless I assign an IP to NIC interface which is bridged to physical NIC. And My physical NIC also gets a IP of that subnet. So how can I make my 2nd DHCP server run on same physical NIC? –  Newbie Oct 4 '12 at 7:15
    
You even should not run a second DHCP server on the same physical segment of the network, not speaking about the same NIC. What a purpose of having a DHCP server in both VMs bridged to the same NIC of your workstation? –  Serge Oct 4 '12 at 9:39
    
That Physical NIC is then connected to a manageable switch (having vlans) for clients to get IP from their respective subnets. –  Newbie Oct 4 '12 at 9:53
show 17 more comments

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.