Old Tired Question: 'Not configured to listen on any interfaces'

Alex Bligh alex at alex.org.uk
Fri Feb 25 08:32:12 UTC 2011



--On 25 February 2011 08:03:48 +0000 Simon Hobson <dhcp1 at thehobsons.co.uk> 
wrote:

>> You can use a 0.0.0.0/0 subnet without complaint.
>
> And you would struggle to be more wrong in doing so.
>
> That would tell the DHCP server that the entire IPv4 address space is
> directly connected to that interface. So when it gets a request from
> *anywhere* there is confusion as to where the client is located.

The OP was only using dhcpd as a target of a relay. In this instance the
IPv4 space is *not* connected to the interface, but dhcpd essentially won't
hand out IP addresses until it thinks it is on a subnet it knows about. Our
server (which only gets relay requests) needs to return arbitrary dhcp
replies, all of which need to be within a subnet dhcp knows about. dhcpd
trying to know about the subnet structure is in fact unhelpful, which I
thought what the OP was saying, not least because the subnet structure wuld
have to follow our DB (when this is unnecessary). So we use a config like
the following (well, in fact identical to the following bar the password
etc changes). dhcpd thinks the entire IP address range is one subnet, but
as all the subnet has to do is *include* anything we return, this is fine.

In case it's not obvious, the config simply lets us return any dhcp
address, router, subnet and nameservers from a database.

You can use the same trick with a static config.

ddns-update-style none;
ignore client-updates;
authoritative;

subnet 0.0.0.0 netmask 0.0.0.0 {
}

dbi-host "xxxx";
dbi-driver "pgsql";
dbi-username "yyyy";
dbi-password "zzzz";
dbi-dbname  "wwww";
dbi-query "SELECT ('fixed-address '|| ip_v4_address || '; ' ||
                  'option routers ' || ip_v4_routes || '; ' ||
                  'option subnet-mask ' || ip_v4_netmask || '; ' ||
                  'option domain-name-servers ' || dns_v4_servers || ';')
          AS entry FROM dhcp_configs WHERE mac_address = '%h'";


-- 
Alex Bligh



More information about the dhcp-users mailing list