Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] DHCP server does not recognize subnet declaration

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
toquinho
Posts: 59
Joined: 2014-06-24 16:50
Been thanked: 1 time

[Solved] DHCP server does not recognize subnet declaration

#1 Post by toquinho »

Hello,

I want to use a laptop with a wireless and a wired network interface to set up a separate subnet that only the laptop can see. The interfaces are enp4s0 and wlp2s0:

Code: Select all

root@FENCHURCH:~# netstat -i
Tabela de Interfaces do Kernel
Iface      MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
enp4s0    1500        0      0      0 0             0      0      0      0 BMU
lo       65536        0      0      0 0             0      0      0      0 LRU
wlp2s0    1500     3377      0      0 0          1598      0      0      0 BMRU
I want wlp2s0 to connect to my normal LAN, and the laptop is supposed to act as a DHCP server for the devices attached to enp4s0. So I installed isc-dhcp-server and removed dnsmasq-base, which was installed on the laptop. I edited /etc/default/isc-dhcp-server and /etc/dhcp/dhcpd.conf:

Code: Select all

root@FENCHURCH:~# more /etc/default/isc-dhcp-server 
INTERFACESv4="enp4s0"
INTERFACESv6=""

Code: Select all

option domain-name "mysubnetwork.org";
option domain-name-servers 8.8.8.8;
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;

subnet 10.254.239.0 netmask 255.255.255.0 {
  interface enp4s0;
  range 10.254.239.15 10.254.239.50;
  option subnet-mask 255.255.255.0;
  option routers 10.254.239.10;
}
host fenchurch {
  hardware ethernet 54:42:49:fb:dc:c3;
  fixed-address 10.254.239.10;
}
When starting the DHCP server, I get the following error:

Code: Select all

abr 05 00:19:27 FENCHURCH isc-dhcp-server[1420]: Launching IPv4 server only.
abr 05 00:19:27 FENCHURCH dhcpd[1432]: Wrote 0 deleted host decls to leases file.
abr 05 00:19:27 FENCHURCH dhcpd[1432]: Wrote 0 new dynamic host decls to leases file.
abr 05 00:19:27 FENCHURCH dhcpd[1432]: Wrote 0 leases to leases file.
abr 05 00:19:27 FENCHURCH dhcpd[1432]: 
abr 05 00:19:27 FENCHURCH dhcpd[1432]: No subnet declaration for enp4s0 (no IPv4 addresses).
abr 05 00:19:27 FENCHURCH dhcpd[1432]: ** Ignoring requests on enp4s0.  If this is not what
abr 05 00:19:27 FENCHURCH dhcpd[1432]:    you want, please write a subnet declaration
abr 05 00:19:27 FENCHURCH dhcpd[1432]:    in your dhcpd.conf file for the network segment
abr 05 00:19:27 FENCHURCH dhcpd[1432]:    to which interface enp4s0 is attached. **
abr 05 00:19:27 FENCHURCH dhcpd[1432]: 
abr 05 00:19:27 FENCHURCH dhcpd[1432]: 
abr 05 00:19:27 FENCHURCH dhcpd[1432]: Not configured to listen on any interfaces!
abr 05 00:19:27 FENCHURCH dhcpd[1432]: 
abr 05 00:19:27 FENCHURCH dhcpd[1432]: If you think you have received this message due to a bug rather
abr 05 00:19:27 FENCHURCH dhcpd[1432]: than a configuration issue please read the section on submitting
abr 05 00:19:27 FENCHURCH dhcpd[1432]: bugs on either our web page at www.isc.org or in the README file
abr 05 00:19:27 FENCHURCH dhcpd[1432]: before submitting a bug.  These pages explain the proper
abr 05 00:19:27 FENCHURCH dhcpd[1432]: process and the information we find helpful for debugging.
abr 05 00:19:27 FENCHURCH dhcpd[1432]: 
abr 05 00:19:27 FENCHURCH dhcpd[1432]: exiting.
abr 05 00:19:29 FENCHURCH isc-dhcp-server[1420]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ...
abr 05 00:19:29 FENCHURCH isc-dhcp-server[1434]:  failed!
abr 05 00:19:29 FENCHURCH isc-dhcp-server[1435]:  failed!
abr 05 00:19:29 FENCHURCH systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status=1/FAILURE
I am not sure if the host section in dhcpd.conf is required, but it does not make any difference. I am making these edits in a remote terminal from another computer in my LAN. The laptop is connected to the LAN via wlp2s0 and gets its IP from a DHCP server. Currently, nothing is connected to enp4s0 of the laptop.

Any help is of course greatly appreciated.

Thanks,

Toquinho
Last edited by toquinho on 2021-04-05 14:52, edited 1 time in total.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: DHCP server does not recognize subnet declaration

#2 Post by p.H »

Did you assign an IP address in the 10.254.239.0/24 subnet to enp4s0 ?
What does "ip addr" show ?

toquinho
Posts: 59
Joined: 2014-06-24 16:50
Been thanked: 1 time

Re: DHCP server does not recognize subnet declaration

#3 Post by toquinho »

Thanks a lot. I had not assigned an IP to enp4s0. In hindsight it is obvious that this is necessary. I should have read https://wiki.debian.org/DHCP_Server to the very end.

Post Reply