"dhcpd failed" error when starting DHCP server
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.
Related videos on Youtube
Newbie
Updated on September 18, 2022Comments
-
Newbie over 1 year
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?
-
Serge over 11 yearsSo, what is in the /var/log/messages?
-
Newbie over 11 yearsNo 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 over 11 yearsIt is already in the bridged mode. Even then the NIC card on physical machine gets IP from the DHCP.
-
Serge over 11 yearsThen could you please clarify your question What exactly you would like to do.
-
Newbie over 11 yearsI 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?
-
Serge over 11 yearsYou 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?
-
Newbie over 11 yearsThat Physical NIC is then connected to a manageable switch (having vlans) for clients to get IP from their respective subnets.
-
Serge over 11 yearsThen I think you need to post a new Question which clearly states the problem, like this: You have a LAN on that you would like to have several VLANs. Your current DHCP server is providing clients of your LAN with addresses. What changes should be done in the existing DHCP server configurations, and/or should the extra DHCP servers be installed. The possible question topic: "Having multiple DHCP-managed VLANs?"
-
Newbie over 11 yearsYes, but i am still not sure if this addresses my problem. I have two DHCP servers as virtual machines and I need them to be briged to one physical NIC. So that I can connect my switch to that physical NIC port. Problem here is, how to bridge one physical nic to two virtual NICs, both is separate subnets.
-
Serge over 11 yearsThis is not a big question. You have to set up several addresses to this physical NIC and both Windows and Linux does allow this. But the problem is not this. First, I am not quite familiar with VLAN networking, but I know when a linux machine needs to be connected to different VLANs over the same physical NIC then you see not just one interface in the output of
ifconfig
but extra VLAN 'aliases' (I might be using improper terminology here) that each has its own ip address on the particular VLAN. And then I see no problem to run the dhcpd direcly... (see next comment) -
Serge over 11 yearson this machine with no need to run VM's - you just define subnet range for each VLAN segment you would like to serve in the configuration of this dhcp server
-
Serge over 11 yearsI mean that your attempt to solve your problem with running two VMs just to have two dhcp servers to supply addresses to these VLANs is an overkill in my opinion.
-
Newbie over 11 yearsThank u.. I understand what you are saying. But my project involves running two VMs as server, which in future might be separate servers with other applications installed in them. First phase is to get up and running the DHCP servers on single machine.
-
Serge over 11 yearsthen, anyway, you need to bring up all necessary VLAN 'aliases' on your NIC so these VLAN's are accessible from this
hosting
server. -
Newbie over 11 yearsSorry for the late reply. Yes, both VMs are on the same host.
-
Serge over 11 years@Newbie Then definitely you need to make the link between this host and switch a trunk link and set this host to see three VLAN's over the NIC connected to the switch. Look at
man vconfig
how to accomplish this. Then you will have three interfaces - one for 'regular' this host connectivity and two interfaces for VMs - one for each VM. In the networking settings of the VM when you selectBridged Network
you may choose that interface in the host to use. -
Newbie over 11 yearsSorry. I do not fully understand ur reply. If u could explain more in detail and from scratch. If I am creating 2 separate subnets then why should I create Vlans? I mean Vlans will be created in switch so specific ports can be assigned their subnets. Main concern is, how to bridge two VMs (separate networks) to one physical NIC.
-
Serge over 11 yearsif you do not tell the switch that your host should be able to talk to all three VLAN's then your VMs will be bound to the same VLAN (the default one) and they never be able to provide dhcp service on these extra VLAN's
-
Serge over 11 years@Newbie read above about trunk link and VLAN-s at host - this will allow you to do what you want
-
Newbie over 11 yearsI have idea about trunk and vlans. But my problem remains the same, i.e. both the virtual DHCP machines want to give IPs of their network to the Physical bridged interface. How can I resolve this problem first? Is it possible to slit the physical NIC e.g 'eth1:0' in virtual interfaces and still VMs can recognize that interface?
-
Serge over 11 yearsAs I wrote above when you set up three VLAN's (the default one and two extra) you will have 3 additional interfaces. The interface for the default VLAN will be used by the host to communicate to other machines in your network. The extra VLAN interfaces you will use to set up a bridged netwoking in VM's. In the Network Settings of the VM (the settings in VirtualBox GUI) you will be able to select a particular VLAN intefrace to make a bridge. Not the NIC's interface