No subnet declaration; Can't open /var/lib/dhcp/dhcpd.leases for append

Simon Hobson dhcp1 at
Sat Jan 27 10:57:08 UTC 2018

A <publicface at> wrote:

>> Also in your first post:
>> subnet netmask {
>>         interface wlp2s0;
>>         option domain-name-servers;
>>         max-lease-time 7200;
>>         default-lease-time 600;
>>         range;
>>         option subnet-mask;
>>         option broadcast-address;
>>         option routers;
>> As far as I know there is no interface directive.  Plus wlp2s0 is the wrong
>> interface.  You should remove that line.
>  Wrong name for the device?  Or just shouldn't be the wireless interface?  Why is it wrong?

There is no instruction in dhcpd.conf called "interface". The example you found probably had it as a comment to help the person keep track of what is where.

> If that's not how to specify the interface for that subnet, then what is the proper way please?

You don't ! It happens automagically, and bear in mind that a subnet served by a DHCP server does NOT have to be directly connected - it can come via a relay agent.
The server uses the IP address(es) of the interface for directly connected clients, or the Gateway Interface Address (GIAddr) field inserted by a relay agent if the client is remote (the other side of a router). That address is used to determine which subnet a client is connected to.

>> What does 'ip -4 -o addr' show?
> # ip -4 -o addr
> 1: lo    inet scope host lo\       valid_lft forever preferred_lft forever
> 3: enp6s0    inet xx.xx.xx.xx/20 brd scope global enp6s0\       valid_lft forever preferred_lft forever

OK, you do not have IPv4 addresses on any internal interface ! it isn't going to work like that. Or have you deleted lines from that output thinking they aren't relevant ?

More information about the dhcp-users mailing list