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

Simon Hobson dhcp1 at thehobsons.co.uk
Sat Jan 27 10:57:08 UTC 2018


A <publicface at bak.rr.com> wrote:

>> Also in your first post:
>> subnet 10.1.1.0 netmask 255.255.255.0 {
>>         interface wlp2s0;
>>         option domain-name-servers 10.1.1.1;
>>         max-lease-time 7200;
>>         default-lease-time 600;
>>         range 10.1.1.10 10.1.1.250;
>>         option subnet-mask 255.255.255.0;
>>         option broadcast-address 10.1.1.255;
>>         option routers 10.1.1.1;
>> 
>> 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 127.0.0.1/8 scope host lo\       valid_lft forever preferred_lft forever
> 3: enp6s0    inet xx.xx.xx.xx/20 brd 255.255.255.255 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