Ubuntu - dhcp server 'not configured to listen on any interfaces'
OK, I think i've fixed this issue. And it IS a bug in Linux's network manager.
See, the network manager runs as part of the boot process (that'd be the 'S50NetworkManager' symlink) and brings up your ethernet interfaces. However, it does it asynchronously. This means that the network manager returns immediately, implying to the scripts after it, "OK - network's been set up." Actually, it hasn't, and the network manager is sitting there in the background getting on with setting up the network. Meanwhile, the boot scripts after it are running with the assumption that the network interfaces will be available, which is a race condition, depending on whether the network manager has gotten round to setting them up yet.
This is a horrible situation and a bug I'm amazed hasn't been fixed. One way of getting round it is to ditch the network manager and instead set up your interfaces by editing /etc/network/interfaces. Rather than do that work, though, I tried the ugly hack suggested in this bug report: https://bugzilla.redhat.com/show_bug.cgi?id=486372
I added a 5 second delay ('sleep 5') into the beginning of the start function in dhcp3-server's init.d script, this giving the network manager ample time to get the network interfaces set up (although of course there is still no guarantee) - and it worked. Now, dhcpd succeeds on startup.
As detailed in bugs #486372 and #447442 on bugzilla.redhat.com, this is either a bug with network manager (it should block until its wired network interfaces are available), or with dhcpd (it should be updated to wait for network interfaces to become available, rather than just crashing out). It is definitely a bug of sorts, though.
you can modify your /etc/network/interfaces like this:
iface eth1 inet static
address 192.168.50.1
netmask 255.255.255.0
up service dhcp3-server restart
so dhcp3-server will be (re)started after network interface (eth1) has been really up.
I meet the error, such as "No subnet declaration for eth1
" and "Not configured to listen on any interfaces!
".
Then I add the eth1 subnet
declaration in the dhcpd.conf
although the subnet not lease the address. And it work.
subnet 10.32.64.0 netmask 255.255.252.0 {
option routers 10.32.64.1;
}