I am attempting to set up a VERY simple DHCP server. I am using Ubuntu 10.04, and I installed the "dhcp3-server" package. The server has one interface (eth0) statically set to 10.0.0.10(/21). I want to hand out IPs from the network 10.255.224.0/19.
Doing what I've been told by various online guides, I edit /etc/default/dhcp3-server to include the line "INTERFACES="eth0".
Then I write up my dhcpd.conf. I had to put an empty subnet or I get the error:
No subnet declaration for eth0 (10.0.0.10).
** Ignoring requests on eth0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface eth0 is attached. **
Once I add this empty subnet the daemon will start. I try another machine acting as a DHCP client to test it. This is what I see in the dhcpd logs:
dhcpd: DHCPDISCOVER from 00:1d:09:b1:f5:dc via eth0: network 10.0.0/21: no free leases
That "network" definitly doesn't look right, but I can't find where the problem is that is preventing my test client from getting an IP. Here is my dhcpd.conf:
ddns-update-style none;
option domain-name "example.org";
option domain-name-servers 10.10.10.83, 10.10.10.84;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;
#empty subnet to prevent error on start
subnet 10.0.0.0 netmask 255.255.248.0 {
}
subnet 10.255.224.0 netmask 255.255.224.0 {
option subnet-mask 255.255.224.0;
option broadcast-address 10.255.255.255;
option routers 10.0.0.1;
range 10.255.224.2 10.255.255.254;
}
I've worked with ISC-DHCPd some in the past, but this is the first server that I've tried to build and deploy myself. Any hints would be super!
Are the two subnets 10.0.0.0/255.255.248.0 and 10.255.224.0/255.255.224.0 on the same physical network? If they are, you are going to need to assign an address from the 10.255.224.0/255.255.224.0 to the DHCP server or you need to setup the DHCP relay agent on some device on the 10.255.224.0/255.255.224.0 network.
If they are not on the same network, I am not sure how you the DHCP server would even be seeing the request, but you absolutely need a a DHCP relay agent on a device that has an address on the 10.255.224.0/255.255.224.0 network to forward requests to the DHCP server.
This is all required because a DHCP server will select the scope to offer addresses from by using the network/mask of the interface the request was received on if it was received by a broadcast. If the request came in via unicast with the GIADDR address populated, a DHCP relay populates this, then the GIADDR will be used to select the scope to make an offer from.