[CentOS] CentOS-6 dhcpd

Ljubomir Ljubojevic office at plnet.rs
Fri Jul 15 18:06:38 UTC 2011


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.

Ljubomir



More information about the CentOS mailing list