LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-18-2012, 02:31 PM   #1
funboy
Member
 
Registered: Jul 2011
Posts: 49

Rep: Reputation: Disabled
DHCP server in slackware 13.37


Hello,

I'm trying to install DHCP server onto my slackware box, but I have little problem.

The /etc/dhcpd.conf file is:


# dhcpd.conf
#
# Configuration file for ISC dhcpd (see 'man dhcpd.conf')
#

ddns-update-style none;

eth1 subnet - 192.168.1.0/24

subnet 192.168.1.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
option domain-name-servers 192.168.1.1;
option domain-name "slackwarebox";
option netbios-name-servers 192.168.1.1;
range 192.168.1.10 192.168.1.100;
}

The /etc/rc.d/rc.dhcpd file is:

#!/bin/sh
#
# /etc/rc.d/rc.dhcpd
# This shell script takes care of starting and stopping
# the ISC DHCPD service
#

# Put the command line options here that you want to pass to dhcpd:
DHCPD_OPTIONS="-q eth1"

[ -x /usr/sbin/dhcpd ] || exit 0

[ -f /etc/dhcpd.conf ] || exit 0

start() {
# Start daemons.
echo -n "Starting dhcpd: /usr/sbin/dhcpd $DHCPD_OPTIONS "
/usr/sbin/dhcpd $DHCPD_OPTIONS
echo
}
stop() {
# Stop daemons.
echo -n "Shutting down dhcpd: "
killall -TERM dhcpd
echo
}
status() {
PIDS=$(pidof dhcpd)
if [ "$PIDS" == "" ]; then
echo "dhcpd is not running!"
else
echo "dhcpd is running at pid(s) ${PIDS}."
fi
}
restart() {
stop
start
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
;;
esac

exit 0

When execute /etc/rc.d/rc.dhcpd start I receive an eror - Starting dhcpd: /usr/sbin/dhcpd -q eth1 /etc/rc.d/rc.dhcpd: line 18: /usr/sbin/dhcpd: cannot execute binary file

So please help me to resolve this problem.
 
Old 03-18-2012, 02:58 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by funboy View Post
I'm trying to install DHCP server onto my slackware box, but I have little problem.

... <snip> ...

When execute /etc/rc.d/rc.dhcpd start I receive an eror - Starting dhcpd: /usr/sbin/dhcpd -q eth1 /etc/rc.d/rc.dhcpd: line 18: /usr/sbin/dhcpd: cannot execute binary file
So, what did you actually do to install the DHCP server? All you've shown here is that you tried to start it. The error message is saying that the executable '/usr/sbin/dhcpd' seems to be broken. What does file say about it? Are you launching the server with root privileges?

--- rod.
 
Old 03-18-2012, 04:37 PM   #3
funboy
Member
 
Registered: Jul 2011
Posts: 49

Original Poster
Rep: Reputation: Disabled
Smile

So what I have to do to install. I downloaded a lot of packages for dhcpd server but also there are no result. Let's say that I have only these two conf files. What have to do to set up dhcp server ?
 
Old 03-18-2012, 04:40 PM   #4
Celyr
Member
 
Registered: Mar 2012
Location: Italy
Distribution: Slackware+Debian
Posts: 321

Rep: Reputation: 81
The funny thing is that on my Slackware 13.37 it just work flawless
Code:
root@desktop:~# ./prova start
Starting dhcpd: /usr/sbin/dhcpd -q eth1 
root@desktop:~#
the package with dhcpd is this one:
dhcp-4.2.1_P1-x86_64-1
for 64bit env and it's in the slackware distribution

Last edited by Celyr; 03-18-2012 at 04:43 PM.
 
Old 03-18-2012, 05:21 PM   #5
funboy
Member
 
Registered: Jul 2011
Posts: 49

Original Poster
Rep: Reputation: Disabled
Smile

Yes my package is dhcp-4.2.1_P1-x86_64-1.txz.
But what is wrong with my dhcp server ?
 
Old 03-19-2012, 12:46 AM   #6
funboy
Member
 
Registered: Jul 2011
Posts: 49

Original Poster
Rep: Reputation: Disabled
:)

Hello again, I reinstalled the package for dhcp server. Now when I execute dhcpd -q eth1 it seems that runs successfully.
But when I execute dhspd status I received an error that I not configuring the subnet.

Code:
[
bash-4.1# dhcpd status  
Internet Systems Consortium DHCP Server 4.2.1-P1
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Wrote 0 leases to leases file.

No subnet declaration for status (no IPv4 addresses).
** Ignoring requests on status.  If this is not what
   you want, please write a subnet declaration
   in your dhcpd.conf file for the network segment
   to which interface status is attached. **


Not configured to listen on any interfaces!

If you did not get this software from ftp.isc.org, please
get the latest from ftp.isc.org and install that before
requesting help.

If you did get this software from ftp.isc.org and have not
yet read the README, please read it before requesting help.
If you intend to request help from the dhcp-server@isc.org
mailing list, please read the section on the README about
submitting bug reports and requests for help.

Please do not under any circumstances send requests for
help directly to the authors of this software - please
send them to the appropriate mailing list as described in
the README file.

exiting.
Any ideas ?
 
Old 03-19-2012, 04:56 PM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well "dhcpd status" is an illegal command, it makes no sense. you've mixed up totally different commands there.
 
Old 03-19-2012, 05:31 PM   #8
funboy
Member
 
Registered: Jul 2011
Posts: 49

Original Poster
Rep: Reputation: Disabled
Well, but when I'm connecting other laptop with windows 7 it didn't received an IP address.
So I know there is a mistake but I can't find it in these two files.
 
Old 03-20-2012, 02:16 AM   #9
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
You probably need to run
Code:
/etc/rc.d/rc.dhcpd status
--- rod.
 
Old 03-20-2012, 03:11 AM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you can't go from not knowing if there is an error or not to a client not getting an IP, you MUST break things up more than that. restart the service and look in /var/log/messages for errors after a restart, or just run "dhcpd" manually and that should read the config file and execute in the foreground to get useful debug info.
 
Old 03-20-2012, 04:53 AM   #11
funboy
Member
 
Registered: Jul 2011
Posts: 49

Original Poster
Rep: Reputation: Disabled
:)

Hello, I found out my mistake.

As you can see in the /etc/dhcpd.conf file I wrote:

Code:
eth1 subnet - 192.168.1.0/24
The problem is here - First there are no ";" in the end. Second when I put the ";" at the end of this row
my dhcp server didn't work again. So I just deleted this row and use /etc/rc.d/rc.dhcpd script to say what I need(use eth1 and -q option).
If someone has the same issue, you can use /usr/sbin/dhcpd -d -f to find out the error.
This turns dhcp server on the debugging mode and put the server in foreground.
Now it seems that my dhcp server works fine. I'll confirm this when I came back to home and try it.

@ acid_kewpie Sorry man for my improper way to express what I am done, but I write this during the night when I'm really sleeping . When I write dhcp status I mean /etc/rc.d/rc.dhcp status and the output is for this command.

So thank you to all that wrote in this topic and helped me with resolving my problem
 
Old 03-22-2012, 12:50 PM   #12
funboy
Member
 
Registered: Jul 2011
Posts: 49

Original Poster
Rep: Reputation: Disabled
:)

Hello again,
The dhcp server works after adding authoritative;
But now I have another interesting problem. The DHCP server assigned to Windows 7 client ip address, but there are no ping between the two machines.
Neither from the client, nor form the server, but the address is successfully assigned.
Any ideas ?
 
Old 03-22-2012, 02:03 PM   #13
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
There is more to networking than just IPs. You need to configure gateways/routes, netmasks, name servers, etc. Does your DHCP server config file include these settings?
Code:
        option domain-search            "localdomain";
        option domain-name              "localdomain";
        option subnet-mask              255.255.255.0;
        option routers                  192.168.0.1;
        option domain-name-servers      WW.XX.YY.ZZ.;
(using values that make sense for your network, of course)
--- rod.
 
Old 03-24-2012, 01:24 AM   #14
funboy
Member
 
Registered: Jul 2011
Posts: 49

Original Poster
Rep: Reputation: Disabled
:)

Yes I configured the necessary network settings, but the problem is not in the DNS server, Firstly there are no ping between DHCP client and the server. But the client receives the IP. The two nodes have to be pingable, aren't they ?
 
Old 03-24-2012, 02:29 PM   #15
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
DHCP data is conveyed between server and client without the benefit of IP, since it is itself part of the bootstrap process to get IP started on the client. So, trying to ping one peer from the other tells you nothing about the success or failure of the DHCP client/server relationship.
Do both of the client and server have IPs? Are they valid for the LAN to which they are connected? When you try to ping, are you specifying the peer host by name or by IP? When it fails, what exactly is the result.
Don't forget that there are several ways in which it can fail. Identifying which way is the principle diagnostic. Did you digest the advice of acid_kewpie when he recommended breaking things down so that you can identify the core problem(s)? Simply "doesn't work" is a relatively useless piece of information.
Quote:
Yes I configured the necessary network settings, but the problem is not in the DNS server
What information supports this conclusion? What did you do to ascertain that this is accurate? If you are looking for solutions to problems, it is in your best interest to provide helpful information.
--- rod.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Instead of Router DHCP Server, Pass DHCP Server control to Slackware orbit Slackware 6 05-11-2009 02:00 AM
Setting up Slackware DHCP server... jim_naisium Linux - Networking 11 02-28-2007 05:51 AM
dhcp server script on Slackware 11.0 ? tiuz Slackware 3 10-21-2006 11:04 AM
DHCP server on Slackware mikz Slackware 19 01-31-2005 11:15 AM
DHCP server in slackware 9.1? Blag-foo Linux - Newbie 4 09-30-2003 09:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration