0

Using debian, and installed isc-dhcp-server via the following command

sudo apt -y install isc-dhcp-server

After agreeing to any dependencies, the follow error message was thrown

Job for isc-dhcp-server.service failed because the control process exited with error code.
See "systemctl status isc-dhcp-server.service" and "journalctl -xe" for details.

Ive restarted my machine, and also tried to run the followng

sudo service isc-dhcp-server start

This just re-prints the same error message as above.

The error asks to run systemctl status isc-dhcp-server.service which returns

● isc-dhcp-server.service - LSB: DHCP server
     Loaded: loaded (/etc/init.d/isc-dhcp-server; generated)
     Active: failed (Result: exit-code) since Mon 2024-03-11 00:33:46 GMT; 12min ago
       Docs: man:systemd-sysv-generator(8)
    Process: 2980 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)

sudo journalctl -u isc-dhcp-server.service returns

isc-dhcp-server[5786]: Launching IPv4 server only.
dhcpd[5793]: /etc/dhcp/dhcpd.conf line 13: subnet 192.168.2.101 netmask 255.255.255.0: bad subnet number/mask combination.
dhcpd[5793]: subnet 192.168.2.101 netmask 255.255.255.0
dhcpd[5793]:                                          ^
dhcpd[5793]: Configuration file errors encountered -- exiting
dhcpd[5793]: 
dhcpd[5793]: If you think you have received this message due to a bug rather
dhcpd[5793]: than a configuration issue please read the section on submitting
isc-dhcp-server[5786]: dhcpd self-test failed. Please fix /etc/dhcp/dhcpd.conf.
isc-dhcp-server[5786]: The error was:
dhcpd[5793]: bugs on either our web page at www.isc.org or in the README file
dhcpd[5793]: before submitting a bug.  These pages explain the proper
dhcpd[5793]: process and the information we find helpful for debugging.
dhcpd[5793]: exiting.
dhcpd[5797]: Internet Systems Consortium DHCP Server 4.4.1
isc-dhcp-server[5797]: Internet Systems Consortium DHCP Server 4.4.1
isc-dhcp-server[5797]: Copyright 2004-2018 Internet Systems Consortium.
isc-dhcp-server[5797]: All rights reserved.
isc-dhcp-server[5797]: For info, please visit https://www.isc.org/software/dhcp/
dhcpd[5797]: Copyright 2004-2018 Internet Systems Consortium.
dhcpd[5797]: All rights reserved.
dhcpd[5797]: For info, please visit https://www.isc.org/software/dhcp/
dhcpd[5797]: /etc/dhcp/dhcpd.conf line 13: subnet 192.168.2.101 netmask 255.255.255.0: bad subnet number/mask combination.
dhcpd[5797]: subnet 192.168.2.101 netmask 255.255.255.0
isc-dhcp-server[5797]: /etc/dhcp/dhcpd.conf line 13: subnet 192.168.2.101 netmask 255.255.255.0: bad subnet number/mask combination.
isc-dhcp-server[5797]: subnet 192.168.2.101 netmask 255.255.255.0
isc-dhcp-server[5797]:                                          ^
isc-dhcp-server[5797]: Configuration file errors encountered -- exiting

MY MACHINE CONFIG FILES

sudo nano /etc/dhcp/dhcpd.conf
...
# option definitions common to all supported networks...
option domain-name "example.org";
option domain-name-servers 8.8.8.8;
...
subnet 192.168.2.101 netmask 255.255.255.0 {
  option routers pepper.spices.org;
}

...
authoritative;
...

And

sudo /etc/default/isc-dhcp-server
...
DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
...
INTERFACESv4="eth0"
...

1 Answer 1

1

The error tells it:

isc-dhcp-server[5797]: /etc/dhcp/dhcpd.conf line 13: subnet 192.168.2.101 netmask 255.255.255.0: bad subnet number/mask combination.
isc-dhcp-server[5797]: subnet 192.168.2.101 netmask 255.255.255.0

bad subnet number/mask combination

Indeed 192.168.2.101/255.255.255.0 is an invalid subnet. The subnet is not the same as the range (which is an interval inside this subnet, so usually narrower). When looking at it using binary base, all bits of the subnet where the matching bits of the netmask are 0 must also be 0, or it just doesn't make sense, because those are the host parts instead:

11000000.10101000.00000010.01100101 (192.168.2.101)
11111111.11111111.11111111.00000000 (255.255.255.255.0)

101 has to be changed into 0 to get a valid subnet for this width (255.255.255.255.0 aka /24 because there are 24 bits for the network part).

What should instead be used for a range starting from 192.168.2.101 to the end (leaving .254 alone in case pepper.spices.org resolves into 192.168.2.254, which can't be inferred from information available in the question) is:

subnet 192.168.2.0 netmask 255.255.255.0 {
    range 192.168.2.101 192.168.2.253;
    option routers pepper.spices.org;
}

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.