Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
#!/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
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?
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 ?
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.
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.
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.
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
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 ?
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?
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 ?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.