andrewstillie
Posts: 54
Joined: Tue Sep 18, 2012 11:26 am

isc-dhcp-server fails to start.

Tue Dec 10, 2013 8:47 pm

Hello,

I am trying to setup my PI as a wifi hotspot. I have had a reasonable amount of success, in that I can search for the hotspot on my Samsung S4 and attempt to connect to it. This is where I have a problem - it never passes the obtaining ip address stage.

I am using the tutorial at :

http://learn.adafruit.com/setting-up-a- ... l-software

The smoking gun here is probably that
sudo service isc-dhcp-server start
Always fails.

Can anyone offer some advice?

Best regards
Andy


Dec 10 21:09:01 MyRaspiWebServer /USR/SBIN/CRON[3642]: (CRON) info (No MTA installed, discarding output)
Dec 10 21:14:25 MyRaspiWebServer dhcpd: Internet Systems Consortium DHCP Server 4.2.2
Dec 10 21:14:25 MyRaspiWebServer dhcpd: Copyright 2004-2011 Internet Systems Consortium.
Dec 10 21:14:25 MyRaspiWebServer dhcpd: All rights reserved.
Dec 10 21:14:25 MyRaspiWebServer dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Dec 10 21:14:25 MyRaspiWebServer dhcpd: Internet Systems Consortium DHCP Server 4.2.2
Dec 10 21:14:25 MyRaspiWebServer dhcpd: Copyright 2004-2011 Internet Systems Consortium.
Dec 10 21:14:25 MyRaspiWebServer dhcpd: All rights reserved.
Dec 10 21:14:25 MyRaspiWebServer dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Dec 10 21:14:26 MyRaspiWebServer dhcpd: Wrote 0 leases to leases file.
Dec 10 21:14:27 MyRaspiWebServer dhcpd:
Dec 10 21:14:27 MyRaspiWebServer dhcpd: No subnet declaration for wlan0 (no IPv4 addresses).
Dec 10 21:14:27 MyRaspiWebServer dhcpd: ** Ignoring requests on wlan0. If this is not what
Dec 10 21:14:27 MyRaspiWebServer dhcpd: you want, please write a subnet declaration
Dec 10 21:14:27 MyRaspiWebServer dhcpd: in your dhcpd.conf file for the network segment
Dec 10 21:14:27 MyRaspiWebServer dhcpd: to which interface wlan0 is attached. **
Dec 10 21:14:27 MyRaspiWebServer dhcpd:
Dec 10 21:14:27 MyRaspiWebServer dhcpd:
Dec 10 21:14:27 MyRaspiWebServer dhcpd: Not configured to listen on any interfaces!
Dec 10 21:17:01 MyRaspiWebServer /USR/SBIN/CRON[3717]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Dec 10 21:33:47 MyRaspiWebServer dhcpd: Internet Systems Consortium DHCP Server 4.2.2
Dec 10 21:33:47 MyRaspiWebServer dhcpd: Copyright 2004-2011 Internet Systems Consortium.
Dec 10 21:33:47 MyRaspiWebServer dhcpd: All rights reserved.
Dec 10 21:33:47 MyRaspiWebServer dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Dec 10 21:33:48 MyRaspiWebServer dhcpd: Internet Systems Consortium DHCP Server 4.2.2
Dec 10 21:33:48 MyRaspiWebServer dhcpd: Copyright 2004-2011 Internet Systems Consortium.
Dec 10 21:33:48 MyRaspiWebServer dhcpd: All rights reserved.
Dec 10 21:33:48 MyRaspiWebServer dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Dec 10 21:33:48 MyRaspiWebServer dhcpd: Wrote 0 leases to leases file.
Dec 10 21:33:49 MyRaspiWebServer dhcpd:
Dec 10 21:33:49 MyRaspiWebServer dhcpd: No subnet declaration for wlan0 (no IPv4 addresses).
Dec 10 21:33:49 MyRaspiWebServer dhcpd: ** Ignoring requests on wlan0. If this is not what
Dec 10 21:33:49 MyRaspiWebServer dhcpd: you want, please write a subnet declaration
Dec 10 21:33:49 MyRaspiWebServer dhcpd: in your dhcpd.conf file for the network segment
Dec 10 21:33:49 MyRaspiWebServer dhcpd: to which interface wlan0 is attached. **
Dec 10 21:33:49 MyRaspiWebServer dhcpd:
Dec 10 21:33:49 MyRaspiWebServer dhcpd:
Dec 10 21:33:49 MyRaspiWebServer dhcpd: Not configured to listen on any interfaces!

Interfaces:
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow hotplug wlan0

iface wlan0 inet static
address 192.168.42.0
netmask 225.225.225.0


up iptables-restore < /etc/iptables.ipv4.nat

dhcpd.conf
#
# Sample configuration file for ISC dhcpd for Debian
#
#

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# option definitions common to all supported networks...
# option domain-name "example.org";
# option domain-name-servers ns1.example.org, ns2.example.org;

default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
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;

# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.

#subnet 10.152.187.0 netmask 255.255.255.0 {
#}

# This is a very basic subnet declaration.

#subnet 10.254.239.0 netmask 255.255.255.224 {
# range 10.254.239.10 10.254.239.20;
# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
#}

# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.

#subnet 10.254.239.32 netmask 255.255.255.224 {
# range dynamic-bootp 10.254.239.40 10.254.239.60;
# option broadcast-address 10.254.239.31;
# option routers rtr-239-32-1.example.org;
#}

# A slightly different configuration for an internal subnet.
subnet 192.168.42.0 netmask 255.255.255.0 {
range 192.168.42.10 192.168.42.50;
option domain-name-servers 8.8.8.8, 8.8.4.4;
option domain-name "internal.example.org";
option routers 192.168.42.1;
option broadcast-address 192.168.42.255;
default-lease-time 600;
max-lease-time 7200;
}

# Hosts which require special configuration options can be listed in
# host statements. If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.

#host passacaglia {
# hardware ethernet 0:0:c0:5d:bd:95;
# filename "vmunix.passacaglia";
# server-name "toccata.fugue.com";
#}

# Fixed IP addresses can also be specified for hosts. These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
#host fantasia {
# hardware ethernet 08:00:07:26:c0:a5;
# fixed-address fantasia.fugue.com;
#}

# You can declare a class of clients and then do address allocation
# based on that. The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# other clients get addresses on the 10.0.29/24 subnet.

#class "foo" {
# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
#}

#shared-network 224-29 {
# subnet 10.17.224.0 netmask 255.255.255.0 {
# option routers rtr-224.example.org;
# }
# subnet 10.0.29.0 netmask 255.255.255.0 {
# option routers rtr-29.example.org;
# }
# pool {
# allow members of "foo";
# range 10.17.224.10 10.17.224.250;
# }
# pool {
# deny members of "foo";
# range 10.0.29.10 10.0.29.230;
# }
#}


GNU nano 2.2.6 File: /etc/default/isc-dhcp-server


# 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="wlan0"

andrewstillie
Posts: 54
Joined: Tue Sep 18, 2012 11:26 am

Re: isc-dhcp-server fails to start.

Wed Dec 11, 2013 12:52 pm

Should re-build my SD card and start again?

Geordon
Posts: 4
Joined: Fri Dec 27, 2013 6:29 am

Re: isc-dhcp-server fails to start.

Tue Dec 31, 2013 1:16 am

andrewstillie wrote:Should re-build my SD card and start again?
I don't think that rebuilding the card is the solution to the problem (Why do I think that? I've rebuilt mine 3 times). Rather, I'm 98% certain that there is something hinky between the instructions in the tutorial (which I am using as well) and the current version of Raspbian (and driver &| hostapd).

I've downloaded the Adafruit hostapd and replaced the original one as instructed, but everything comes back to the faulty subnet declaration message in syslog. I'm half thinking of ditching isc-dhcp and trying out dnsmasq for grins and giggles.

andrewstillie
Posts: 54
Joined: Tue Sep 18, 2012 11:26 am

Re: isc-dhcp-server fails to start.

Tue Dec 31, 2013 9:06 am

Great to hear from someone having the same problems.

Could post me some links when you find a solution as I would love to get my pi working as a hotspot.

I think you are probably right regarding netmask sub net thingy.
Best Regards
Andy

FM81
Posts: 518
Joined: Wed Apr 17, 2013 4:33 pm

Re: isc-dhcp-server fails to start.

Tue Dec 31, 2013 9:27 am

This part isn't correct (may be it's an typo?):
Interfaces:
...
iface wlan0 inet static
address 192.168.42.0
It's not a good idea to, use zero at the end, the tutorial suggests also, to use a "one" at the end.
Then you should check if "wlan0" has the correct IP-address assigned.

As another idea you can check (for testing purposes only!), if your DHCP-server works with "eth0" (LAN-cable related) ...

Greetings and best wished for the new year, FM_81
A: What does the command 'cat /dev/urandom', can you tell me please?
B: Yeah, that's very simple: It feeds your cat with radioactive material!

gdt
Posts: 83
Joined: Thu Jul 19, 2012 10:19 am

Re: isc-dhcp-server fails to start.

Thu Jan 02, 2014 11:59 pm

It all breaks here "dhcpd: Not configured to listen on any interfaces!". The question is why?

"iface wlan0 inet static/address 192.168.42.0/netmask 225.225.225.0" tries to set the wlan0 interface's IPv4 address to an invalid value. Remember in IPv4 addressing that the lowest address in a subnet is the null address (sends to no machines on the subnet) and the highest address in the subnet is the broadcast address (sends to all machines on the subnet). A router's IP address is just like any other host's IP address, so it needs to be a valid. In IPv4 using either the lowest or the highest valid address in the subnet is traditional (in IPv6 using the lowest address is traditional).

"iface wlan0 inet static/address 192.168.42.1/netmask 225.225.225.0". Edit the file. "ifup wlan0". Check results with "ifconfig wlan0". Note that this will come up as an unauthenticating wireless client (with no SSID to connect with), not as an access point. In all seriousness, NetworkManager is by far the simplest way to bring up a host acting as an access point.

Let's have a quick look at the DHCP daemon configuration. That looks right.

Geordon
Posts: 4
Joined: Fri Dec 27, 2013 6:29 am

Re: isc-dhcp-server fails to start.

Fri Jan 03, 2014 12:25 am

Can you suggest somewhere to learn more about NetworkManager? I'm trying to set my Pi as an Access Point and having fits with it. The Adafruit tutorial is not working for me.

gdt
Posts: 83
Joined: Thu Jul 19, 2012 10:19 am

Re: isc-dhcp-server fails to start.

Wed Jan 08, 2014 10:33 pm

Why read about it? Buy another SD card, dd your current disk to it, and then use it to install network-manager and experiment.

Geordon
Posts: 4
Joined: Fri Dec 27, 2013 6:29 am

Re: isc-dhcp-server fails to start.

Wed Jan 08, 2014 10:43 pm

Ok, let me restate the question: What is the package name for Network Manager?

Marsupilami23
Posts: 1
Joined: Sat Mar 01, 2014 3:29 pm

Re: isc-dhcp-server fails to start.

Sat Mar 01, 2014 3:32 pm

I found this while doing a google search. Seems to help me.

http://sirlagz.net/2013/02/10/how-to-us ... r-part-3b/

cebrusjki7
Posts: 3
Joined: Mon Mar 31, 2014 7:17 pm

Re: isc-dhcp-server fails to start.

Tue Apr 22, 2014 7:56 pm

So, have you fixed it?
Is it working now?

User avatar
dliloch
Posts: 163
Joined: Wed Jun 27, 2012 6:28 pm
Location: cleveland, ohio usa

Re: isc-dhcp-server fails to start.

Fri Aug 08, 2014 1:25 pm

Marsupilami23 wrote:I found this while doing a google search. Seems to help me.

http://sirlagz.net/2013/02/10/how-to-us ... r-part-3b/
thanks so much for posting this .. it worked!

suikodener
Posts: 1
Joined: Tue Dec 09, 2014 3:27 pm

Re: isc-dhcp-server fails to start.

Tue Dec 09, 2014 3:31 pm

Marsupilami23 wrote:I found this while doing a google search. Seems to help me.

http://sirlagz.net/2013/02/10/how-to-us ... r-part-3b/



Thanks a million this works great!

User avatar
Richard-TX
Posts: 1545
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: isc-dhcp-server fails to start.

Tue Dec 09, 2014 3:49 pm

gdt wrote:It all breaks here "dhcpd: Not configured to listen on any interfaces!". The question is why?

"iface wlan0 inet static/address 192.168.42.0/netmask 225.225.225.0" tries to set the wlan0 interface's IPv4 address to an invalid value. Remember in IPv4 addressing that the lowest address in a subnet is the null address (sends to no machines on the subnet) and the highest address in the subnet is the broadcast address (sends to all machines on the subnet). A router's IP address is just like any other host's IP address, so it needs to be a valid. In IPv4 using either the lowest or the highest valid address in the subnet is traditional (in IPv6 using the lowest address is traditional).

"iface wlan0 inet static/address 192.168.42.1/netmask 225.225.225.0". Edit the file. "ifup wlan0". Check results with "ifconfig wlan0". Note that this will come up as an unauthenticating wireless client (with no SSID to connect with), not as an access point. In all seriousness, NetworkManager is by far the simplest way to bring up a host acting as an access point.

Let's have a quick look at the DHCP daemon configuration. That looks right.
maybe it is looking for "192.168.42.1/24"
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

erdik
Posts: 2
Joined: Sun Aug 23, 2015 3:54 pm

Re: isc-dhcp-server fails to start.

Sun Aug 23, 2015 4:18 pm

Marsupilami23 wrote:I found this while doing a google search. Seems to help me.

http://sirlagz.net/2013/02/10/how-to-us ... r-part-3b/
Worked like a a charm, thanks a lot!!!

gsportelli
Posts: 1
Joined: Wed Mar 16, 2016 6:59 pm

Re: isc-dhcp-server fails to start.

Wed Mar 16, 2016 7:05 pm

This worked for me:
1) set up the access point as in http://elinux.org/RPI-Wireless-Hotspot EXCEPT that I didn't install udhcpd
2) install isc-dhcp-server as in viewtopic.php?t=31227#p293467
3) edit /etc/default/ifplugd and change

Code: Select all

INTERFACES="auto"
HOTPLUG_INTERFACES="auto"
to

Code: Select all

INTERFACES="eth0"
HOTPLUG_INTERFACES="eth0"
4) edit /etc/network/interfaces and replace all lines related to wlan0 with

Code: Select all

auto wlan0
iface wlan0 inet static
  address 192.168.42.1
  netmask 255.255.255.0

BDSI
Posts: 1
Joined: Wed Nov 22, 2017 1:12 am

Re: isc-dhcp-server fails to start.

Wed Nov 22, 2017 1:25 am

Evening All. I had a hell of a time with the Adafruit RPi Wireless Access Point tutorial.

I believe it has to do with the latest release of Raspian (September 2017), although I am not nearly up enough on it to be certain.

I found this link: http://www.noveldevices.co.uk/rp-dhcp-server
I wish I could name the Author since he fixed my problems.

On the page the author identified that the "etc/default/isc-dhcp-server" as the cause. "All of the main configuration items are commented out and this is why the startup failed previously:"

Going on to say "...and uncomment the following records

So; following the guidance i removed the # in front of the following items:
DHCPD_CONF=/etc/dhcp/dhcpd.conf

DHCPD_PID=/var/run/dhcpd.pid

INTERFACES="eth0"

My release (Sept 2017) actually had two of each of the above lines. one for V4 and one for V6.
I uncommented both, so my file looked like this:

#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="wlan0"

Then rebooted and started the hostapd and isc-dhcp-servers per the Adafruit tutorial. All is well.

Hope it helps someone else along the way.

regards,
BDSI

SurferTim
Posts: 1100
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: isc-dhcp-server fails to start.

Wed Nov 22, 2017 12:41 pm

I've used this and dnsmasq, and dnsmasq seems easier to set up. Just my opinion.
https://github.com/SurferTim/documentat ... s-point.md

Return to “Networking and servers”

Who is online

Users browsing this forum: EXEPOWERED and 16 guests