I have just setup isc-dhcp on my server. I even setup the correct interface. But still the dhcp server won’t boot. Its says Not configured to listen on any interfaces!
in the syslog. And when I try dhcpd -t /etc/dhcp/dhcpd.conf
it gives this error : /etc/dhcp/dhcpd.conf: interface name too long (is 20
Here’s my dhcpd.conf :
ddns-update-style none;
option domain-name "thpi";
option domain-name-servers 208.67.222.222, 208.67.220.220;
default-lease-time 86400;
max-lease-time 604800;
authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
subnet 10.0.0.0 netmask 255.255.255.0 {
## dhcp start and end IP range ##
range 10.0.0.20 10.0.0.90;
option subnet-mask 255.255.255.0; ## subnet
option broadcast-address 10.0.0.255; ## broadcast
option routers 10.0.0.1; ## router IP
host pc1 {
hardware ethernet 60:a4:4c:3d:76:fa;
fixed-address 10.0.0.100;
}
host lap1 {
hardware ethernet 6c:71:d9:1e:f3:4f;
fixed-address 10.0.0.150;
}
host thnote {
hardware ethernet d0:22:be:d3:be:e1;
fixed-address 10.0.0.200;
}
}
/etc/default/isc-dhcp-server
file :
# Defaults for isc-dhcp-server initscript
# sourced by /etc/init.d/isc-dhcp-server
# installed at /etc/default/isc-dhcp-server by the maintainer scripts
#
# This is a POSIX shell fragment
#
# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPD_CONF=/etc/dhcp/dhcpd.conf
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPD_PID=/var/run/dhcpd.pid
# Additional options to start dhcpd with.
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth0:0"
Interfaces file :
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
auto eth0:0
iface eth0:0 inet static
name Lan
address 10.0.0.1
netmask 255.255.255.0
network 10.0.0.0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
What might be the issue?
asked Oct 13, 2014 at 12:59
THpubsTHpubs
2,75510 gold badges41 silver badges55 bronze badges
4
Your /etc/default/isc-dhcp-server
file should have
INTERFACES="eth0"
hg8
13.4k12 gold badges71 silver badges103 bronze badges
answered Aug 30, 2015 at 6:47
I got the same issue and it got solved after assigning an IP address to my interface
like,
ifconfig eth0 192.168.1.100
answered Apr 6, 2018 at 11:16
tsenapathytsenapathy
1711 silver badge4 bronze badges
2
I had this same problem. For Ubuntu 20.04 1 LTS. I had two NICs and I only wanted to use one of them to vend IPs via dhcp to clients on a LAN.
My fix was a combination of things as shown below. However I belive the real fix was the addition of interface to /etc/dhcp/dhcpd.conf
/etc/dhcp/dhcpd.conf
was (broken):
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
authoritative;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.99;
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 1.1.1.1, 1.0.0.1, 8.8.8.8;
}
changed to (added interface and it worked):
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
authoritative;
subnet 192.168.0.0 netmask 255.255.255.0 {
interface enp6s0;
range 192.168.0.2 192.168.0.99;
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 1.1.1.1, 1.0.0.1, 8.8.8.8;
}
In hacking around I also changed the following, but not sure now I needed to. Shown for completeness.
/etc/default/isc-dhcp-server
was:
INTERFACESv4=""
INTERFACESv6=""
changed to (the interface I want dhcp to use):
INTERFACESv4="enp6s0"
INTERFACESv6="enp6s0"
answered Sep 14, 2020 at 17:51
1
-
Set the static IP of the server…
ifconfig (yourinterface) (your static IP)/(mask number) example sudo ifconfig enp4s0 10.8.0.2/24
-
Start the DHCP server…
sudo systemctl start isc-dhcp-server
-
And retrieve its status…
sudo systemctl status isc-dhcp-server
zx485
2,22311 gold badges24 silver badges32 bronze badges
answered Jul 20, 2021 at 5:08
1
There are two ways to start networking
-
via /etc/network/interfaces
-
via NetworkManager
- start early
- start late
DHCPD try to start after 1) but before 2)
If dhcpd can not detect network, try method 1)
derHugo
3,2765 gold badges29 silver badges49 bronze badges
answered Nov 9, 2017 at 5:01
2
I was also getting the same error. I found that I was starting the isc-dhcp-server6.service(IPV6), instead of isc-dhcp-server.service(IPV4). My configuration files were defined for ipv4 only. Hence I was getting «Not configured to listen on any interface» when I tried to do «systemctl start isc-dhcp-server6.service».
answered Jun 16, 2021 at 12:58
I had this issue as well. Dhcpd was starting before the network interface was ready. You can add this to your /etc/init/isc-dhcp-server.conf file (for IPv4).
Near the bottom of the file you will see a line like this (the «exec» is what you are looking for):
exec dhcpd -user dhcpd -group dhcpd -f -q -4 -pf /run/dhcp-server/dhcpd.pid -cf $CONFIG_FILE $INTERFACES
Add this to the line above it
sleep 30
This will delay the start of your dhcpd server. It will not slow down the rest of your boot process.
The bottom of that file now looks like this:
respawn
script
if [ -f /etc/ltsp/dhcpd.conf ]; then
CONFIG_FILE=/etc/ltsp/dhcpd.conf
else
CONFIG_FILE=/etc/dhcp/dhcpd.conf
fi
. /etc/default/isc-dhcp-server
# Allow dhcp server to write lease and pid file as 'dhcpd' user
mkdir -p /var/run/dhcp-server
chown dhcpd:dhcpd /var/run/dhcp-server
# The leases files need to be root:root even when dropping privileges
[ -e /var/lib/dhcp/dhcpd.leases ] || touch /var/lib/dhcp/dhcpd.leases
chown root:root /var/lib/dhcp /var/lib/dhcp/dhcpd.leases
if [ -e /var/lib/dhcp/dhcpd.leases~ ]; then
chown root:root /var/lib/dhcp/dhcpd.leases~
fi
sleep 30
exec dhcpd -user dhcpd -group dhcpd -f -q -4 -pf /run/dhcp-server/dhcpd.pid -cf $CONFIG_FILE $INTERFACES
end script
answered Jan 31, 2016 at 15:48
1
I had this issue also, but despite all the above, I needed to declare a scope for the subnet my NIC was directly connected to. This allowed the service to start without error.
answered May 27, 2017 at 9:38
http://www.braindisconnect.com/wiki/index.php?title=Linux_DHCP_Server
This message has nothing to do with your dhcpd.conf file or configuration.
The error is because dhcpd is interpreting the /etc/dhcp/dhcpd.conf as an interface.
The 20 is the character count of «/etc/dhcp/dhcpd.conf» and not the file contents.
Add the -cf to your syntax and so that config file is actually getting tested or just use dhcpd -t.
answered Dec 1, 2017 at 22:27
I’m at my wits end on this one; I have tried for hours to get this to work, but I’m stumped. Hope one of you can help.
I’m trying to get dhcp3-server to work on Ubuntu. It’s installed, and setup correctly to run in rc2,3,4,5.d runlevels. On boot, its init.d script does get run, and in syslog, I get the following:
Oct 18 20:40:37 jez-ubuntu dhcpd: Internet Systems Consortium DHCP Server V3.1.1
Oct 18 20:40:37 jez-ubuntu dhcpd: Copyright 2004-2008 Internet Systems Consortium.
Oct 18 20:40:37 jez-ubuntu dhcpd: All rights reserved.
Oct 18 20:40:37 jez-ubuntu dhcpd: For info, please visit http://www.isc.org/sw/dhcp/
Oct 18 20:40:37 jez-ubuntu dhcpd: Wrote 2 leases to leases file.
Oct 18 20:40:37 jez-ubuntu dhcpd:
Oct 18 20:40:37 jez-ubuntu dhcpd: No subnet declaration for eth1 (0.0.0.0).
Oct 18 20:40:37 jez-ubuntu dhcpd: ** Ignoring requests on eth1. If this is not what
Oct 18 20:40:37 jez-ubuntu dhcpd: you want, please write a subnet declaration
Oct 18 20:40:37 jez-ubuntu dhcpd: in your dhcpd.conf file for the network segment
Oct 18 20:40:37 jez-ubuntu dhcpd: to which interface eth1 is attached. **
Oct 18 20:40:37 jez-ubuntu dhcpd:
Oct 18 20:40:37 jez-ubuntu dhcpd:
Oct 18 20:40:37 jez-ubuntu dhcpd: Not configured to listen on any interfaces!
Oct 18 20:40:39 jez-ubuntu NetworkManager: <info> (eth0): device state change: 1 -> 2
Oct 18 20:40:39 jez-ubuntu NetworkManager: <info> (eth0): bringing up device.
Oct 18 20:40:39 jez-ubuntu NetworkManager: <info> (eth0): preparing device.
[...]
As you can see, dhcpd appears to be running before NetworkManager, which is what sets up my eth0 (internet) and eth1 (home network) interfaces. You’d think this had something to do with the rcX.d symlink names, and that dhcpd was named to start before NetworkManager. Not so. My dhcp3-server symlinks are named ‘S99dhcp3-server’ and the Network Manager symlinks are named ‘S50NetworkManager’, so it should be starting before the dhcp server. In addition, if I actually run (as root) from the commandline ‘/etc/init.d/dhcp3-server’… the server runs OK! It only fails at boot!
Why does it say it’s not configured to listen on any interfaces? Is the network manager not bringing interfaces eth0 and eth1 up until after all my boot scripts have run? If this is the case, what use is it? Surely other scripts would need these interfaces to be available at boot time? Here’s my /etc/dhcp3/dhcpd.conf file:
subnet 192.168.0.0 netmask 255.255.255.0 {
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 87.194.0.51;
option ip-forwarding off;
range dynamic-bootp 192.168.0.100 192.168.0.254;
default-lease-time 21600;
max-lease-time 43200;
}
and my /etc/default/dhcp3-server file:
# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/dhcp3-server by the maintainer scripts
#
# This is a POSIX shell fragment
#
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth1"
As far as I can tell, these are all correct. Any ideas?
I have installed Isc-dhcp-server and configured the files accordingly still it is showing the error that its not configured to listen to any interfaces.
i have ubuntu 17.04 64 bit
Interface file :
auto lo
iface lo inet loopback
iface enp2s0 inet static
address 10.90.90.5
netmask 255.255.255.0
gateway 10.90.90.1
broadcast 10.90.90.255
dns-nameservers 8.8.8.8
up service isc-dhcp-server restart
in /etc/default/isc-dhcp-server file
INTERFACES="enp2s0"
/etc/dhcp/dhcpd.conf file:
subnet 10.90.90.0 netmask 255.255.255.0 {
range 10.90.90.10 10.90.90.20;
default-lease-time 600;
max-lease-time 7200;
option routers 10.90.90.1;
}
Error i’m getting :
error
asked Jan 29, 2018 at 12:00
0
A bit late but :
isc-dhcp-server
as configuration file in /etc/default
folder named isc-dhcp-server
is this file at the very last line you must set the interface wich isc-dhcp-server
will listen :
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="eth0 eth1"
INTERFACESv6=""
Try with INTERFACESv4
key.
Then restart the server.
server isc-dhcp-server restart
answered Oct 4, 2020 at 11:22
CallMarlCallMarl
5064 silver badges14 bronze badges
The problem was my isc-dhcp-server configuration file was getting reset to original file with blank interfaces.
I did re-installation of ubuntu and it worked all well.
answered Feb 2, 2018 at 10:56
mr_pool_404mr_pool_404
4885 silver badges16 bronze badges
Well it seems like your interface enp2s0
isn’t up. You can check this by using ifconfig
.
You can fix it by putting: auto enp2s0
under auto lo
in /etc/network/interfaces
Dharman♦
30.4k22 gold badges84 silver badges132 bronze badges
answered Jan 29, 2018 at 12:48
1
I try to set up a wifi access point with hostapd and isc-dhcpd but the dhcp server doesn’t work. The conf file is the same I found in this tutorial:
[Hostapd : The Linux Way to create Virtual Wifi Access Point][1]
!!! I still have the problem and i already read the documentaion and man Pages…!!!!
This is the Error message I get when I want to start it with the command «systemctl start isc-dhcp-server.service» or «service isc-dhcp-server start»
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.
This is the output of the command «systemctl status isc-dhcp-server.service»:
root@l0calh0st:~# systemctl status isc-dhcp-server.service
● isc-dhcp-server.service - LSB: DHCP server
Loaded: loaded (/etc/init.d/isc-dhcp-server; generated; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2018-01-09 18:23:07 CET; 3s ago
Docs: man:systemd-sysv-generator(8)
Process: 3831 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)
Jan 09 18:23:05 l0calh0st dhcpd[3842]: bugs on either our web page at www.isc.org or in the README file
Jan 09 18:23:05 l0calh0st dhcpd[3842]: before submitting a bug. These pages explain the proper
Jan 09 18:23:05 l0calh0st dhcpd[3842]: process and the information we find helpful for debugging..
Jan 09 18:23:05 l0calh0st dhcpd[3842]:
Jan 09 18:23:05 l0calh0st dhcpd[3842]: exiting.
Jan 09 18:23:07 l0calh0st isc-dhcp-server[3831]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ... failed!
Jan 09 18:23:07 l0calh0st isc-dhcp-server[3831]: failed!
Jan 09 18:23:07 l0calh0st systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1
Jan 09 18:23:07 l0calh0st systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
Jan 09 18:23:07 l0calh0st systemd[1]: Failed to start LSB: DHCP server.
This is the etc/dhcp/dhcpd.conf file:
ddns-update-style none;
ignore client-updates;
authoritative;
option local-wpad code 252 = text;
subnet
10.0.0.0 netmask 255.255.255.0 {
# --- default gateway
option routers
10.0.0.1;
# --- Netmask
option subnet-mask
255.255.255.0;
# --- Broadcast Address
option broadcast-address
10.0.0.255;
# --- Domain name servers, tells the clients which DNS servers to use.
option domain-name-servers
10.0.0.1, 8.8.8.8, 8.8.4.4;
option time-offset
0;
range 10.0.0.3 10.0.0.13;
default-lease-time 1209600;
max-lease-time 1814400;
}
This is the /etc/default/isc-dhcp-server file:
# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)
# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPDv4_PID=/var/run/dhcpd.pid
#DHCPDv6_PID=/var/run/dhcpd6.pid
# Additional options to start dhcpd with.
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="wlan0"
INTERFACESv6=""
This is the /etc/network/interfaces File: (I don’t know if this is important)
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet static
address 10.0.0.14
netmask 255.255.255.0
Output for «journalctl -xe»
Jan 09 19:59:50 l0calh0st dhcpd[4303]:
Jan 09 19:59:50 l0calh0st dhcpd[4303]:
Jan 09 19:59:50 l0calh0st dhcpd[4303]: Not configured to listen on any interfaces!
Jan 09 19:59:50 l0calh0st dhcpd[4303]:
Jan 09 19:59:50 l0calh0st dhcpd[4303]: If you think you have received this message due to a bug rather
Jan 09 19:59:50 l0calh0st dhcpd[4303]: than a configuration issue please read the section on submitting
Jan 09 19:59:50 l0calh0st dhcpd[4303]: bugs on either our web page at www.isc.org or in the README file
Jan 09 19:59:50 l0calh0st dhcpd[4303]: before submitting a bug. These pages explain the proper
Jan 09 19:59:50 l0calh0st dhcpd[4303]: process and the information we find helpful for debugging..
Jan 09 19:59:50 l0calh0st dhcpd[4303]:
Jan 09 19:59:50 l0calh0st dhcpd[4303]: exiting.
Jan 09 19:59:52 l0calh0st isc-dhcp-server[4298]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ... failed!
Jan 09 19:59:52 l0calh0st isc-dhcp-server[4298]: failed!
Jan 09 19:59:52 l0calh0st systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1
Jan 09 19:59:52 l0calh0st systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
Jan 09 19:59:52 l0calh0st systemd[1]: Failed to start LSB: DHCP server.
-- Subject: Unit isc-dhcp-server.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit isc-dhcp-server.service has failed.
ifconfig output:
root@l0calh0st:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.2.101 netmask 255.255.255.0 broadcast 192.168.2.255
inet6 2003:50:ad02:a21:d455:ca81:501e:727a prefixlen 64 scopeid 0x0<global>
inet6 fe80::da92:2698:1cc8:40d prefixlen 64 scopeid 0x20<link>
ether 40:8d:5c:52:43:f4 txqueuelen 1000 (Ethernet)
RX packets 10328 bytes 4043207 (3.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9033 bytes 1272064 (1.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xdf200000-df220000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Lokale Schleife)
RX packets 286 bytes 18370 (17.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 286 bytes 18370 (17.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether da:a6:21:bc:a3:11 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
!!! I still have the problem and i already read the documentaion and man Pages…!!!!
0
1
Есть комп с двумя сетевыми платами,подключенный к интернету через
сетевую плату eth1.Через вторую(eth0) хочу подсоединить ноут,
чтобы на нем тоже был нэт.На компе debian 6.0 Squeeze,а на ноуте
MS windows.Помогите пожалуйста разобраться!
При запуске isc-dhcp-server выдает ошибку:
No subnet declaration for eth0 (no IPv4 addresses).
** Ignoring requests on eth0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface eth0 is attached. **
Not configured to listen on any interfaces!
настройки dhcpd.cong такие:
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {option routers
192.168.1.254;
option subnet-mask 255.255.255.0;
option domain-name «192.168.1.1»;
option domain-name-servers 192.168.1.1;
option time-offset -5;
range 192.168.1.10 192.168.1.100;
}