3

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...!!!!

  • Thanks to ISC's thinking that your log has a terminal width, the important part of your log is the 20 or so lines prior to the part that you have pasted into your question. Use the other command that the message said to use. – JdeBP Jan 9 '18 at 19:00
  • Yes, thank you! I see the problem now ^^. But now i need to search how i can make him listen to the interfaces. haha :) (i added it to the post) – ABeater Jan 9 '18 at 19:11
  • does ifconfig or ip a show wlan0 as an available interface? if so, what's the IP address details set on that interface? – thrig Jan 9 '18 at 19:29
  • Yes the interface is there but i dont see something that looks like a ip. – ABeater Jan 9 '18 at 21:41
  • I just posted a solution here. I hope it can help: askubuntu.com/questions/852711/… – colibris79 Jul 23 '18 at 2:30
4

The message Not configured to listen on any interfaces! is your clue.

When starting isc-dhcp-server it will not start unless there is a network device configured to be on the same subnet(s) that your service will be passing out addresses for.

So, you'll want to edit /etc/network/interfaces and make appropriate changes so that your wlan0 interface has an address in the 10.0.0.0/24 subnet that ISN'T within the range of your lease pool (10.0.0.3-10.0.0.13 based on your config file above). Once you can bring up the wlan0 interface wtih a 10.0.0.x IP then (re)starting the isc-dhcp-server daemon should work fine.

  • Thanks but is there a manual or something how i need to edit it? Which things i need to write etc...? – ABeater Jan 9 '18 at 20:11
  • @ABeater - Check under network configuration - debian-handbook.info – ivanivan Jan 9 '18 at 20:27
  • Would this be a Static configuration? debian-handbook.info/browse/stable/sect.network-config.html And need i to add the eth0 interface too? – ABeater Jan 9 '18 at 20:43
  • Yes, it would be static. No, you don't need to add eth0 (unless you want to). – ivanivan Jan 9 '18 at 21:00
  • mhh i still get the same error. I posted the edited /etc/network/interfaces in the post. For gateway i used the ip of my router? and for netmask i used the same,which i used for the conf file? and as a address i choosed 10.0.0.15 because its out of the range of the lease pool. i turned the wlan0 interface off and on with "ip link set dev wlan0 up/down." Maybe you have a idea whats wrong? – ABeater Jan 9 '18 at 21:30
0

just add an ip address on the wlan NIC with the following command

    ifconfig wlan0 10.0.0.1
0

I had the same issue and somethig that worked for me was add the eth0—this was the name of my network interface—subnet as a subnet declaration in the dhcpd.conf file.

In your case the subnet declaration should be:

subnet 10.0.0.0 netmask 255.255.255.0 {
    option routers 10.0.0.14;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.