[CentOS] CentOS-6 dhcpd

Fri Jul 15 19:03:57 UTC 2011
Steve Clark <sclark at netwolves.com>

On 07/15/2011 02:06 PM, Ljubomir Ljubojevic wrote:
> Jake Shipton wrote:
>> On 07/15/2011 05:45 PM, Timothy Murphy wrote:
>>> I've installed CentOS-6 on my server
>>> (in parallel to CentOS-5.6)
>>> and now I'm trying to set up dhcpd.
>>>
>>> I'm not sure if there has been a change in dhcpd
>>> under CentOS-6, but I'm getting the dreaded message
>>> "Not configured to listen on any interfaces!"
>>> when I "sudo service dhcpd restart".
>>>
>>> I realise now that I have never known
>>> how the connection between interface (eth0 and eth1, in my case)
>>> and network (192.168.1.0 and 192.168.2.0, in my case)
>>> is established.
>>>
>>> I have DHCPDARGS=eth1 in /etc/sysconfig/dhcpd
>>> but evidently I need to say something more somewhere.
>>>
>>> Can one actually specify the interface in /etc/dhcpd.conf
>>> and if so how?
>>>
>>> Any suggestions or enlightenment gratefully received.
>>>
>> Hi, I had this problem on my Fedora 12&  14 box a while back, and I
>> found by adding a "dummy" network fixed the issue. I would assume the
>> fix to be the same on CentOS6 as their so closely related.
>>
>> Here's an example of what I mean by dummy network in my dhcpd.conf
>>
>> -- Begin --
>>
>> ddns-update-style none;
>> ignore client-updates;
>> DHCPARGS=eth1;
>>
>> subnet 0.0.0.0 netmask 0.0.0.0 {
>> 	# This remains blank.
>> }
>>
>> subnet 192.168.2.0 netmask 255.255.255.0 {
>> 	# Here would go the settings you wish for eth1.
>> }
>>
>> -- end --
>>
>> Basically as you can see, there is a subnet "0.0.0.0" this would be for
>> eth0 while the other subnet below is in use and configured how you would
>> like.
>>
>> This for me fixed the error you mentioned. Also just a note, you will
>> often see "service dhcpd start" fail, if their is no device connected to it.
>>
>> I do not know why, however command dhcpd will work. However, the service
>> appears to start anyway, it just reports a fail. as connected said
>> device to eth1 works even though service apparently failed to start.
>> device connected and powered up, service reports to start OK.
>>
>> I hope this can help you and fixes your issues. :-)
>>
> Yes I omitted that part, since my routers can do without that, but as a
> rule, you should declare ALL subnets in simple form:
>
> subnet 192.168.2.0 netmask 255.255.255.0 { }
>
> so ISC DHCP knows about them. Why, I do not know, but it is supposed to
> be in newer versions (more strict rules for config file.)
>
> I can not say about 0.0.0.0, newer needed it.
>
You have to have a subnet declaration(s) that matches an existing subnet(s) that is configured
on the interface(s) you want to provide dynamic addresses for.

dhcpd will tell you which interfaces it is not configured to run on with a message like:
dhcpd: No subnet declaration for eth1 (96.228.159.10).
dhcpd: ** Ignoring requests on eth1.  If this is not what
dhcpd:    you want, please write a subnet declaration
dhcpd:    in your dhcpd.conf file for the network segment
dhcpd:    to which interface eth1 is attached. **

-- 
Stephen Clark
*NetWolves*
Sr. Software Engineer III
Phone: 813-579-3200
Fax: 813-882-0209
Email: steve.clark at netwolves.com
http://www.netwolves.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20110715/850a6776/attachment-0005.html>