harryweb
Posts: 35
Joined: Mon Dec 24, 2012 11:52 am

install DHCP server problem

Wed Feb 20, 2013 4:22 pm

HI,

New to Linux...

I'm trying to install : apt-get install isc-dhcp-server
Then it seems to install but I have an error message:
[fail] Starting isc DHCP server: dhcp[....] check syslog for diagnostics
invoke-rc.d: initscript isc-dhcp-server, action "start" failed.

Also an error when rebooting (red alert)

Someone can help ?
Regards


What is syslog ? May be a file but where to find it ?

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK

Re: install DHCP server problem

Wed Feb 20, 2013 4:58 pm

syslog is

/var/log/syslog

Code: Select all

cat /var/log/syslog
or

Code: Select all

more /var/log/syslog
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

MattF
Posts: 55
Joined: Tue Feb 12, 2013 10:01 am

Re: install DHCP server problem

Wed Feb 20, 2013 5:15 pm

Typically this is because the leases database isn't present.
Check for the presence of the directory /var/lib/dhcp/ (and mkdir it if it doesn't exist).
Then:
touch /var/lib/dhcp/dhcpd.leases
touch /var/lib/dhcp/dhcpd.leases~

harryweb
Posts: 35
Joined: Mon Dec 24, 2012 11:52 am

Re: install DHCP server problem

Wed Feb 20, 2013 6:49 pm

Thank you for help to find syslog.
this is what I've found but can't explain:
Feb 20 14:48:46 raspberrypi dhcpd: Internet Systems Consortium DHCP Server 4.2.2
Feb 20 14:48:46 raspberrypi dhcpd: Copyright 2004-2011 Internet Systems Consortium.
Feb 20 14:48:46 raspberrypi dhcpd: All rights reserved.
Feb 20 14:48:46 raspberrypi dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Feb 20 14:48:46 raspberrypi dhcpd: Internet Systems Consortium DHCP Server 4.2.2
Feb 20 14:48:46 raspberrypi dhcpd: Copyright 2004-2011 Internet Systems Consortium.
Feb 20 14:48:46 raspberrypi dhcpd: All rights reserved.
Feb 20 14:48:46 raspberrypi dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Feb 20 14:48:46 raspberrypi dhcpd: Wrote 0 leases to leases file.
Feb 20 14:48:46 raspberrypi dhcpd:
Feb 20 14:48:46 raspberrypi dhcpd: No subnet declaration for eth0 (192.168.150.117).
Feb 20 14:48:46 raspberrypi dhcpd: ** Ignoring requests on eth0. If this is not what
Feb 20 14:48:46 raspberrypi dhcpd: you want, please write a subnet declaration
Feb 20 14:48:46 raspberrypi dhcpd: in your dhcpd.conf file for the network segment
Feb 20 14:48:46 raspberrypi dhcpd: to which interface eth0 is attached. **
Feb 20 14:48:46 raspberrypi dhcpd:
Feb 20 14:48:46 raspberrypi dhcpd:
Feb 20 14:48:46 raspberrypi dhcpd: Not configured to listen on any interfaces!
The 2 files dhcpd.leases where present
I've done touch...
Rebooting
always some error messages:
[Fail] check syslog for diagnostics
[Fail] startpar: service(s) returned failure: isc-dhcp-server.... failed

I wonder if it is possible because my Rpi is client by default and must be stopped before server is starting ?

I need this app because I must connect an electronic item (client only) directly on Rpi RJ45
Thanks for help

User avatar
aelsas
Posts: 64
Joined: Fri Jul 06, 2012 11:23 pm
Location: Frankfurt, Germany

Re: install DHCP server problem

Wed Feb 20, 2013 7:41 pm

Feb 20 14:48:46 raspberrypi dhcpd: No subnet declaration for eth0 (192.168.150.117).
Feb 20 14:48:46 raspberrypi dhcpd: ** Ignoring requests on eth0. If this is not what
Feb 20 14:48:46 raspberrypi dhcpd: you want, please write a subnet declaration
Feb 20 14:48:46 raspberrypi dhcpd: in your dhcpd.conf file for the network segment
Feb 20 14:48:46 raspberrypi dhcpd: to which interface eth0 is attached. **
Feb 20 14:48:46 raspberrypi dhcpd: Not configured to listen on any interfaces!

Seems to be the problem - can you post dhcpd.conf?

Best regards

Alex

harryweb
Posts: 35
Joined: Mon Dec 24, 2012 11:52 am

Re: install DHCP server problem

Wed Feb 20, 2013 8:02 pm

Hi Alex, Thank you for helping

Here is 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 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# 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;
# }
#}

User avatar
aelsas
Posts: 64
Joined: Fri Jul 06, 2012 11:23 pm
Location: Frankfurt, Germany

Re: install DHCP server problem

Wed Feb 20, 2013 8:50 pm

Hi again,

as you can see in your dhcpd.conf all lines which could define a subnet are commented out.

You must define your subnet in dhcpd.cond otherwise the dhcp derver does not know which addresses to serve!

A short guide to dhcpd.conf can be found here: http://www.yolinux.com/TUTORIALS/DHCP-Server.html

What subnet do you use?

Best regards

Alex

harryweb
Posts: 35
Joined: Mon Dec 24, 2012 11:52 am

Re: install DHCP server problem

Wed Feb 20, 2013 9:50 pm

Ok Alex,

When looking for my subnet (Rpi not plugged to network) I can see (ifconfig):
nothing into ETH0
for lo: IP=127.0.0.1 Mask:255.0.0.0

Rpi plugged to my home network
ETH0 = 192.168.0.22 Mask:255.255.255.0

Rpi plugged directly to my electronic Item
same as not plugged

I wrote an app in python to send in broadcast mode (UDP) a command witch, when received by my electronic item returns it's MAC & IP address (then I know the IP address to make tcp connection and continue)

When Rpi + electronic item connected to my home network, the program is working fine.
But... I plan to use my Rpi without my home network

May be you can explain how to do it ?
I'm electronician and new to linux...

Regards
Herve

User avatar
aelsas
Posts: 64
Joined: Fri Jul 06, 2012 11:23 pm
Location: Frankfurt, Germany

Re: install DHCP server problem

Wed Feb 20, 2013 10:41 pm

Hi Herve,

subnet is your home network.

But: how does your Rpi get its IP address? Do you use static IP or is your router acting as a DHCP server already? Please provide some information about your home network! What is the electronic item?

Best regards

Alex

harryweb
Posts: 35
Joined: Mon Dec 24, 2012 11:52 am

Re: install DHCP server problem

Wed Feb 20, 2013 11:01 pm

Alex,

My Router (internet box) is giving DHCP to my Rpi (I think it works like this)

The electronic Item is a subrack using "Tibbo" (http://tibbo.com/products/modules/x20x/em1206.html)
This Tibbo is a kind of transformer. It has 4 serial ports witch can have communication over network
serial to RJ45

It can be configured to be DHCP or Fixed IP
When connected to a network, it received an IP adress, then, with a command in a broadcast mode (sending 'X' at port 65535) it answer it's MAC & IP address
Knowing it's IP address, it can be connected by classic TCP to receive and answering commands (ASCII in my case) to 4 ports.... Changing this commands into RS232 like serial datas TX&RX (for 1 or more µC)

Hope this can help to resolve my problems..
Regards

User avatar
aelsas
Posts: 64
Joined: Fri Jul 06, 2012 11:23 pm
Location: Frankfurt, Germany

Re: install DHCP server problem

Wed Feb 20, 2013 11:13 pm

OK, but what is the role of the additional DHCP server on the Rpi in this scenario?

Best regards

Alex

harryweb
Posts: 35
Joined: Mon Dec 24, 2012 11:52 am

Re: install DHCP server problem

Thu Feb 21, 2013 1:34 pm

The Rpi must be connected directly to my electronic item without my home network.
(It must be installed where there is no available network)

Rpi<------- RJ45 ---------> electronic item

Rpi must have server ability to give my electronic an IP address.

Best Regards
Herve

User avatar
aelsas
Posts: 64
Joined: Fri Jul 06, 2012 11:23 pm
Location: Frankfurt, Germany

Re: install DHCP server problem

Thu Feb 21, 2013 11:49 pm

OK, I think I understand now.

You can use the same address range on the standalone Pi as your home network,
using a different range does not hurt ;-)

Define this in dhcpd.conf and you should be going.

But if you link Pi and device directly, you'll need a crossover cable.

Best regards

Alex

ze74hack
Posts: 1
Joined: Mon Mar 16, 2015 10:02 pm

Re: install DHCP server problem

Mon Mar 16, 2015 10:11 pm

in /etc/default/ifplugd, the default configuration is this

INTERFACES="auto"
HOTPLUG_INTERFACES="all"
ARGS="-q -f -u0 -d10 -w -I"
SUSPEND_ACTION="stop"

Simply changing it to this

INTERFACES="eth0"
HOTPLUG_INTERFACES="eth0"
ARGS="-q -f -u0 -d10 -w -I"
SUSPEND_ACTION="stop"

i guess this is your solution

Return to “General discussion”