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. -- Timothy Murphy e-mail: gayleard /at/ eircom.net tel: +353-86-2336090, +353-1-2842366 s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
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. >I can not say about DHCPd in CentOS with certainty, but it should be ISC DHCP, and ISC DHCP on my routers has following syntax for subnet: subnet 192.168.219.0 netmask 255.255.255.0 { range 192.168.219.170 192.168.219.199; option routers 192.168.219.100; and there is no mention of interfaces, just their IP's, and you can only set DHCP service on the first IP on the interface. This is on my router, but should be true for all ISC DHCP servers. Ljubomir
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. :-) -- Jake
Timothy Murphy <gayleard at ...> writes:> > > 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. >I read through the rest of the response but I'm thinking what I have to say fits better here than lower in the comments thread. Some things to check: RHEL6/CentOS6 likes to let NetworkMangler control interfaces even if the system is a server and running services like dhcpd. You may be getting a failure message since the interface isn't up when dhcpd gets started. I only find NetworkMangler useful on systems that regularly change connectivity like my laptop. I just find it gets in the way on stable, wired networks. The same problem can occur on VMs just because the virtual interface comes up more slowly the a "real" hardware device. That is, eth1 sn't there yet when dhcpd starts. If you specify the correct interface that matches the IP address you want DHCP services on in /etc/sysconfig/dhcpd you shouldn't need a dummy interface/network specification. I notice that you mention /etc/dhcpd.conf but the location of the configuration file moved to /etc/dhcp with RHEL6/CentOS6. Unless you edit the startup files, dhcpd will use the configuration file /etc/dhcp/dhcpd.conf Cheers, Dave