Score:0

isc-dhcp-server - Ubuntu 22.04 No subnet declaration

it flag

Trying to get DHCP services on ubuntu to work at all. Vanilla os install. copy from existing ubuntu 20 host dhcp server. Services will not start.

I have not even gotten to more advanced things like adding ddns and certs and failover.. THis is basic.. not able to start with a copy of working dhcpd.conf file

root@ps-dns-01:~# systemctl restart isc-dhcp-server.service root@ps-dns-01:~# systemctl status isc-dhcp-server.service × isc-dhcp-server.service - ISC DHCP IPv4 server Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sat 2023-03-25 20:24:33 UTC; 13s ago Docs: man:dhcpd(8) Process: 20249 ExecStart=/bin/sh -ec CONFIG_FILE=/etc/dhcp/dhcpd.conf; if [ -f /etc/ltsp/dhcpd.conf ]; then CONFIG_FILE=/etc/ltsp/dhcpd.conf; fi; [ -e /var/lib/dhcp/dhcpd.leases ] || touch /var/lib/dhcp/dhcpd.leases; chown root:dhcpd /var/lib/dhcp /var/lib/dhcp/dhcpd.leases; chmod 7> Main PID: 20249 (code=exited, status=1/FAILURE) CPU: 16ms

Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: If you think you have received this message due to a bug rather Mar 25 20:24:33 ps-dns-01 systemd[1]: isc-dhcp-server.service: Main process exited, code=exited, status=1/FAILURE Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: than a configuration issue please read the section on submitting Mar 25 20:24:33 ps-dns-01 systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'. Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: bugs on either our web page at www.isc.org or in the README file Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: before submitting a bug. These pages explain the proper Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: process and the information we find helpful for debugging. Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: exiting. lines 1-18/18 (END) ░░ The job identifier is 8946. Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: Internet Systems Consortium DHCP Server 4.4.1 Mar 25 20:24:33 ps-dns-01 sh[20249]: Internet Systems Consortium DHCP Server 4.4.1 Mar 25 20:24:33 ps-dns-01 sh[20249]: Copyright 2004-2018 Internet Systems Consortium. Mar 25 20:24:33 ps-dns-01 sh[20249]: All rights reserved. Mar 25 20:24:33 ps-dns-01 sh[20249]: For info, please visit https://www.isc.org/software/dhcp/ Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: Copyright 2004-2018 Internet Systems Consortium. Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: All rights reserved. Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: For info, please visit https://www.isc.org/software/dhcp/ Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: Config file: /etc/dhcp/dhcpd.conf Mar 25 20:24:33 ps-dns-01 sh[20249]: Config file: /etc/dhcp/dhcpd.conf Mar 25 20:24:33 ps-dns-01 sh[20249]: Database file: /var/lib/dhcp/dhcpd.leases Mar 25 20:24:33 ps-dns-01 sh[20249]: PID file: /run/dhcp-server/dhcpd.pid Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: Database file: /var/lib/dhcp/dhcpd.leases Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: PID file: /run/dhcp-server/dhcpd.pid Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: Wrote 0 deleted host decls to leases file. Mar 25 20:24:33 ps-dns-01 sh[20249]: Wrote 0 deleted host decls to leases file. Mar 25 20:24:33 ps-dns-01 sh[20249]: Wrote 0 new dynamic host decls to leases file. Mar 25 20:24:33 ps-dns-01 sh[20249]: Wrote 0 leases to leases file. Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: Wrote 0 new dynamic host decls to leases file. Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: Wrote 0 leases to leases file. Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: Mar 25 20:24:33 ps-dns-01 sh[20249]: No subnet declaration for ens160 (10.89.100.152). Mar 25 20:24:33 ps-dns-01 sh[20249]: ** Ignoring requests on ens160. If this is not what Mar 25 20:24:33 ps-dns-01 sh[20249]: you want, please write a subnet declaration Mar 25 20:24:33 ps-dns-01 sh[20249]: in your dhcpd.conf file for the network segment Mar 25 20:24:33 ps-dns-01 sh[20249]: to which interface ens160 is attached. ** Mar 25 20:24:33 ps-dns-01 sh[20249]: Not configured to listen on any interfaces! Mar 25 20:24:33 ps-dns-01 sh[20249]: If you think you have received this message due to a bug rather Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: No subnet declaration for ens160 (10.89.100.152). Mar 25 20:24:33 ps-dns-01 sh[20249]: than a configuration issue please read the section on submitting Mar 25 20:24:33 ps-dns-01 sh[20249]: bugs on either our web page at www.isc.org or in the README file Mar 25 20:24:33 ps-dns-01 sh[20249]: before submitting a bug. These pages explain the proper Mar 25 20:24:33 ps-dns-01 sh[20249]: process and the information we find helpful for debugging. Mar 25 20:24:33 ps-dns-01 sh[20249]: exiting. Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: ** Ignoring requests on ens160. If this is not what Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: you want, please write a subnet declaration Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: in your dhcpd.conf file for the network segment Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: to which interface ens160 is attached. ** Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: Not configured to listen on any interfaces! Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: If you think you have received this message due to a bug rather root@ps-dns-01:~# journalctl -xeu isc-dhcp-server.service ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ The unit isc-dhcp-server.service has entered the 'failed' state with result 'exit-code'. Mar 25 20:24:33 ps-dns-01 systemd[1]: Started ISC DHCP IPv4 server. ░░ Subject: A start job for unit isc-dhcp-server.service has finished successfully ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ A start job for unit isc-dhcp-server.service has finished successfully. ░░ root@ps-dns-01:~# journalctl -xeu isc-dhcp-server.service ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ The unit isc-dhcp-server.service has entered the 'failed' state with result 'exit-code'. Mar 25 20:24:33 ps-dns-01 systemd[1]: Started ISC DHCP IPv4 server. ░░ Subject: A start job for unit isc-dhcp-server.service has finished successfully ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ A start job for unit isc-dhcp-server.service has finished successfully. ░░ root@ps-dns-01:~# journalctl -xeu isc-dhcp-server.service ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ The unit isc-dhcp-server.service has entered the 'failed' state with result 'exit-code'. Mar 25 20:24:33 ps-dns-01 systemd[1]: Started ISC DHCP IPv4 server. ░░ Subject: A start job for unit isc-dhcp-server.service has finished successfully ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ A start job for unit isc-dhcp-server.service has finished successfully. ░░

Mar 25 20:24:33 ps-dns-01 systemd[1]: isc-dhcp-server.service: Main process exited, code=exited, status=1/FAILURE ░░ Subject: Unit process exited ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ An ExecStart= process belonging to unit isc-dhcp-server.service has exited. ░░ ░░ The process' exit code is 'exited' and its exit status is 1. Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: than a configuration issue please read the section on submitting Mar 25 20:24:33 ps-dns-01 systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'. ░░ Subject: Unit failed ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ The unit isc-dhcp-server.service has entered the 'failed' state with result 'exit-code'. Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: bugs on either our web page at www.isc.org or in the README file Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: before submitting a bug. These pages explain the proper Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: process and the information we find helpful for debugging. Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: Mar 25 20:24:33 ps-dns-01 dhcpd[20249]: exiting.

root@ps-dns-01:~# journalctl -xeu isc-dhcp-server.service

root@ps-dns-01:~# cat /etc/dhcp/dhcpd.conf
option domain-name "ps.labs.local";
option domain-search "ps.labs.local";
option domain-name-servers 10.89.100.152, 10.89.100.153;
option time-offset -6;
option ntp-servers 10.89.66.1;
option time-servers 10.89.66.1;
#ddns-domainname "ps.labs.local";
default-lease-time 600;
max-lease-time 7200;

ddns-update-style none;

subnet 10.89.128.0 netmask 255.255.255.0 {
    interface ens160;
    option routers 10.89.128.1;
    range 10.89.128.10 10.89.128.254;
}

subnet 10.89.130.0 netmask 255.255.255.0 {
    interface ens160;
    option routers 10.89.130.1;
    range 10.89.130.10 10.89.130.254;
}
subnet 10.89.132.0 netmask 255.255.255.0 {
    interface ens160;
    option routers 10.89.132.1;
    range 10.89.132.10 10.89.132.254;
}
subnet 10.89.134.0 netmask 255.255.255.0 {
    interface ens160;
    option routers 10.89.134.1;
    range 10.89.134.10 10.89.134.254;
}
subnet 10.89.135.32 netmask 255.255.255.224 {
    interface ens160;
    option routers 10.89.135.33;
    range 10.89.135.34 10.89.135.62;
}

    host tanzuprod-service-control-plane-bbwwb {
        hardware ethernet 00:50:56:8b:71:bf;
        fixed-address 10.89.135.48;
    }
    host tanzuprod-service-control-plane-gbqr6 {
        hardware ethernet 00:50:56:8b:42:55;
        fixed-address 10.89.135.44;
    }
    host tanzuprod-service-control-plane-rrg46 {
        hardware ethernet 00:50:56:8b:fb:44;
        fixed-address 10.89.135.49;
    }
    host tanzuprod-mgmt-control-plane-cpzkd {

root@ps-dns-01:~#


I also baselined with as stupid flat a file as I could define:

test

subnet 10.89.130.0 netmask 255.255.255.0 { range 10.89.130.10 10.89.130.254; }

dmesag output Mar 25 20:30:34 ps-dns-01 sh[20630]: before submitting a bug. These pages explain the proper Mar 25 20:30:34 ps-dns-01 dhcpd[20630]: No subnet declaration for ens160 (10.89.100.152). Mar 25 20:30:34 ps-dns-01 sh[20630]: process and the information we find helpful for debugging. Mar 25 20:30:34 ps-dns-01 sh[20630]: exiting. Mar 25 20:30:34 ps-dns-01 dhcpd[20630]: ** Ignoring requests on ens160. If this is not what Mar 25 20:30:34 ps-dns-01 dhcpd[20630]: you want, please write a subnet declaration Mar 25 20:30:34 ps-dns-01 dhcpd[20630]: in your dhcpd.conf file for the network segment Mar 25 20:30:34 ps-dns-01 dhcpd[20630]: to which interface ens160 is attached. ** Mar 25 20:30:34 ps-dns-01 dhcpd[20630]: Mar 25 20:30:34 ps-dns-01 dhcpd[20630]: Mar 25 20:30:34 ps-dns-01 dhcpd[20630]: Not configured to listen on any interfaces!

So I added in stanza for interface

test

subnet 10.89.130.0 netmask 255.255.255.0 { interface ens160; range 10.89.130.10 10.89.130.254; } . dmesg

Mar 25 20:32:54 ps-dns-01 sh[20952]: Wrote 0 leases to leases file. Mar 25 20:32:54 ps-dns-01 dhcpd[20952]: Mar 25 20:32:54 ps-dns-01 dhcpd[20952]: No subnet declaration for ens160 (10.89.100.152). Mar 25 20:32:54 ps-dns-01 sh[20952]: No subnet declaration for ens160 (10.89.100.152). Mar 25 20:32:54 ps-dns-01 dhcpd[20952]: ** Ignoring requests on ens160. If this is not what Mar 25 20:32:54 ps-dns-01 sh[20952]: ** Ignoring requests on ens160. If this is not what Mar 25 20:32:54 ps-dns-01 dhcpd[20952]: you want, please write a subnet declaration Mar 25 20:32:54 ps-dns-01 sh[20952]: you want, please write a subnet declaration Mar 25 20:32:54 ps-dns-01 dhcpd[20952]: in your dhcpd.conf file for the network segment Mar 25 20:32:54 ps-dns-01 sh[20952]: in your dhcpd.conf file for the network segment Mar 25 20:32:54 ps-dns-01 dhcpd[20952]: to which interface ens160 is attached. ** Mar 25 20:32:54 ps-dns-01 sh[20952]: to which interface ens160 is attached. ** Mar 25 20:32:54 ps-dns-01 dhcpd[20952]: Mar 25 20:32:54 ps-dns-01 dhcpd[20952]: Mar 25 20:32:54 ps-dns-01 dhcpd[20952]: Not configured to listen on any interfaces! Mar 25 20:32:54 ps-dns-01 sh[20952]: Not configured to listen on any interfaces! Mar 25 20:32:54 ps-dns-01 dhcpd[20952]:

No SELinux. UFW disabled, really not sure why this is so difficult.. Seems a lot of posts are about the outputs from dhcpd services very obtuse and minor version changes hard to root cause.

root@ps-dns-01:~# cat /etc/default/isc-dhcp-server INTERFACESv4=ens160 INTERFACESv6="" root@ps-dns-01:~# ip ad 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:50:56:b7:08:f6 brd ff:ff:ff:ff:ff:ff altname enp3s0 inet 10.89.100.152/24 brd 10.89.100.255 scope global ens160 valid_lft forever preferred_lft forever inet6 2607:fee0:2002:100:250:56ff:feb7:8f6/64 scope global dynamic mngtmpaddr noprefixroute valid_lft 2591676sec preferred_lft 604476sec inet6 fe80::250:56ff:feb7:8f6/64 scope link valid_lft forever preferred_lft forever root@ps-dns-01:~# !nmcli nmcli -f name,autoconnect connection show

Not sure if this is some virtual interface issue or network profile to call NIC? Maybe someone can post example? Not sure I can break this down even smaller then staza posted.

Score:0
it flag

Wow.. three days of beating head on this simple.. DHCP server start issue.. but I figured it out.

YOu must have a zone.. even if it has no ips to lease in zone, that matches the NIC of the DHCP server.

Ex: Host 10.89.100.153 must have a defined dhcp scope for 10.89.100.0/24

Or DHCP server will not start ..

This should be much better documented. And this really has no reason to be required. DHCP helper services for dozen of other subnets can and do work fine for reference to a single DHCP server host.. so I can think of no reason to enforce a scope to which No IPs will be leased , to enable service to start.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.