NAME
dhcping - send a DHCP request to DHCP server to see if it's up and running
SYNOPSIS
dhcping [-v] [-q] [-i] [-r] -t maxwait -c client-IP-address -s server- IP-address -h client-hardware-address [-g gateway-IP-address]
DESCRIPTION
This command allows the system administrator to check if a remote DHCP server is still functioning. Options are: -v Verbose, print some information. -V Very verbose, print a lot of information. -i Use DHCPINFORM packets. -r Use DHCPREQUEST packets (default behaviour). -q Quiet, print nothing on the screen. -t maxwait Maximum time to wait for an answer from the server in seconds. Default is 3 seconds. -c client-IP-address Request this IP address. Note that this is also the IP address the answer will be sent to. -s server-IP-address Send the DHCP packet to this IP address. -h client-hardware-address Use this hardware-address in the DHCP request. It can be up to sixteen octets separated by colons (i.e. 01:02:03:04) -g gateway-IP-address Use this IP address for the gateway IP address in the DHCP packet. This option is currently broken.
RETURN VALUES
If everything goes okay, it returns 0. If there went something wrong, it returns 1.
SETUP
This program should be installed setuid root or ran by root only. See SECURITY for more information. On your DHCP server, add these lines to the dhcpd.conf: host <your monitoring host FQDN> { hardware ethernet <your monitor host mac address>; fixed-address <your monitoring host IP address>; } Then try it: $ dhcping -c your monitoring host IP address \ -s your DHCP server IP address \ -h your monitor host mac address It will either respond with "no answer" or "Got answer from: your DHCP server IP address" The DHCP server logfile will give: DHCPREQUEST for 192.168.1.1 from 00:20:18:56:29:8f via ed0 DHCPACK on 192.168.1.1 to 00:20:18:56:29:8f via ed0 DHCPRELEASE of 192.168.1.1 from 00:20:18:56:29:8f via ed0 (found) Running in DHCPINFORM mode with -i: If you see "DHCPINFORM from 192.168.1.1 via xl0: not authoritative for subnet 192.168.1.0", you should add the authoritative statement to the subnet, See dhcpd.conf(5) for details. When running in very verbose mode, dhcping tries to dump all data of the send and received DHCP packets. It will first dump the packet in hex-format, then decodes the header and finally the options.
HOW IT WORKS
The client either sends a DHCPREQUEST or DHCPINFORM packet to the server and waits for an answer. Then, if a DHCPREQUEST was send, it will send a DHCPRELEASE back to the server.
SECURITY
This program is installed setuid root as it requires the privileges to bind itself to port 68 (bootpc). Root privileges are dropped as soon as the program has bound itself to that port.
BUGS
Currently (this may, or may not, change in the future) the ISC DHCP daemon does not write leases with a fixed IP address in the dhcpd.leases file. DHCPINFORM packets can only be used on subnets the server is authoritative for. If the monitoring script runs on a subnet the server isn't authoritative for, it should use the DHCPREQUEST packets. I also experienced some problems with ISC DHCPD v2 servers, but that is also in the README of it. The -V option is still working, but shouldn't be used for debugging of the packets. Better use dhcpdump(8) for that, which is available on my website. I wanted to remove it, but decided only to do it from the documentation, not from the code. Maybe I'll need it one day for debugging.
AUTHOR
Edwin Groothuis, edwin@mavetju.org (http://www.mavetju.org)
SEE ALSO
dhcpd(8), dhclient(8), dhcpd.conf(5), dhcpdump(8)
More Linux Commands
manpages/menu_cursor.3menu.html
menu_cursor(3menu) - position a menu's cursor (Man Page)....
menu_cursor.3menu - The function pos_menu_cursor restores the cursor to the current position associated with the menus selected item. This is useful after curse
manpages/gnutls_transport_set_ptr2.3.html
gnutls_transport_set_ptr2(3) - API function - Linux man page
gnutls_transport_set_ptr2.3 - Used to set the first argument of the transport function (for push and pull callbacks). In berkeley style sockets this function wi
manpages/podofotxt2pdf.1.html
podofotxt2pdf(1) convert plain text files into PDF files....
podofotxt2pdf is one of the command line tools from the PoDoFo library that provide several useful operations to work with PDF files. It can convert a plain tex
manpages/XPending.3.html
XPending(3) - handle output buffer or event queue (ManPage)
The XFlush function flushes the output buffer. Most client applications need not use this function because the output buffer is automatically flushed as needed
manpages/putwc.3.html
putwc(3) - write a wide character to a FILE stream (ManPage)
putwc.3 - The fputwc() function is the wide-character equivalent of the fputc(3) function. It writes the wide character wc to stream. If ferror(stream) becomes
manpages/qcatool2.1.html
qcatool2(1) - command line tool for the Qt Cryptographic Arc
qcatool is a command line tool for performing various cryptographic operations with the Qt Cryptographic Architecture (QCA). qcatool can also be used for testin
manpages/pfbtopfa.1.html
pfbtopfa(1) - Convert Postscript .pfb fonts to .pfa format u
This script invokes gs(1) to convert a .pfb file into a .pfa file. SEE ALSO gs(1) VERSION This document was last revised for Ghostscript version 9.15. AUTHOR Ar
manpages/XtDisplayInitialize.3.html
XtDisplayInitialize(3) - initialize, open, or close a displa
The XtDisplayInitialize function builds the resource database, calls the Xlib XrmParseCommand function to parse the command line, and performs other per display
manpages/Mail::SpamAssassin::Plugin::Rule2XSBody.3pm.html
Mail::SpamAssassin::Plugin::Rule2XSBody(3pm) - speed up Spam
This plugin will use native-code object files representing the ruleset, in order to provide significant speedups in rule evaluation. Note that sa-compile must b
manpages/ntfsundelete.8.html
ntfsundelete(8) - recover a deleted file from an NTFS volume
ntfsundelete has three modes of operation: scan, undelete and copy. Scan The default mode, scan simply reads an NTFS Volume and looks for files that have been d
manpages/CPAN::FirstTime.3pm.html
CPAN::FirstTime(3pm) - Utility for CPAN::Config file Initial
The init routine asks a few questions and writes a CPAN/Config.pm or CPAN/MyConfig.pm file (depending on what it is currently using). In the following all quest
manpages/monodis.1.html
monodis(1) - CIL image content dumper and disassembler......
The monodis program is used to dump the contents an ECMA/ISO CIL image (contained in .EXE files that contain extended PE/COFF CIL code). To roundtrip assemblies
