File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / dhcping / dhcping.8
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 22:27:53 2012 UTC (12 years, 3 months ago) by misho
Branches: dhcping, MAIN
CVS tags: v1_2, HEAD
dhcping

    1: .rn '' }`
    2: ''' $RCSfile: dhcping.8,v $$Revision: 1.1.1.1 $$Date: 2012/02/21 22:27:53 $
    3: '''
    4: ''' $Log: dhcping.8,v $
    5: ''' Revision 1.1.1.1  2012/02/21 22:27:53  misho
    6: ''' dhcping
    7: '''
    8: '''
    9: .de Sh
   10: .br
   11: .if t .Sp
   12: .ne 5
   13: .PP
   14: \fB\\$1\fR
   15: .PP
   16: ..
   17: .de Sp
   18: .if t .sp .5v
   19: .if n .sp
   20: ..
   21: .de Ip
   22: .br
   23: .ie \\n(.$>=3 .ne \\$3
   24: .el .ne 3
   25: .IP "\\$1" \\$2
   26: ..
   27: .de Vb
   28: .ft CW
   29: .nf
   30: .ne \\$1
   31: ..
   32: .de Ve
   33: .ft R
   34: 
   35: .fi
   36: ..
   37: '''
   38: '''
   39: '''     Set up \*(-- to give an unbreakable dash;
   40: '''     string Tr holds user defined translation string.
   41: '''     Bell System Logo is used as a dummy character.
   42: '''
   43: .tr \(*W-|\(bv\*(Tr
   44: .ie n \{\
   45: .ds -- \(*W-
   46: .ds PI pi
   47: .if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
   48: .if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
   49: .ds L" ""
   50: .ds R" ""
   51: '''   \*(M", \*(S", \*(N" and \*(T" are the equivalent of
   52: '''   \*(L" and \*(R", except that they are used on ".xx" lines,
   53: '''   such as .IP and .SH, which do another additional levels of
   54: '''   double-quote interpretation
   55: .ds M" """
   56: .ds S" """
   57: .ds N" """""
   58: .ds T" """""
   59: .ds L' '
   60: .ds R' '
   61: .ds M' '
   62: .ds S' '
   63: .ds N' '
   64: .ds T' '
   65: 'br\}
   66: .el\{\
   67: .ds -- \(em\|
   68: .tr \*(Tr
   69: .ds L" ``
   70: .ds R" ''
   71: .ds M" ``
   72: .ds S" ''
   73: .ds N" ``
   74: .ds T" ''
   75: .ds L' `
   76: .ds R' '
   77: .ds M' `
   78: .ds S' '
   79: .ds N' `
   80: .ds T' '
   81: .ds PI \(*p
   82: 'br\}
   83: .\"	If the F register is turned on, we'll generate
   84: .\"	index entries out stderr for the following things:
   85: .\"		TH	Title 
   86: .\"		SH	Header
   87: .\"		Sh	Subsection 
   88: .\"		Ip	Item
   89: .\"		X<>	Xref  (embedded
   90: .\"	Of course, you have to process the output yourself
   91: .\"	in some meaninful fashion.
   92: .if \nF \{
   93: .de IX
   94: .tm Index:\\$1\t\\n%\t"\\$2"
   95: ..
   96: .nr % 0
   97: .rr F
   98: .\}
   99: .TH dhcping 8 "Januari 27, 2002" "Januari 27, 2002" "General Commands Manual"
  100: .UC
  101: .if n .hy 0
  102: .if n .na
  103: .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  104: .de CQ          \" put $1 in typewriter font
  105: .ft CW
  106: 'if n "\c
  107: 'if t \\&\\$1\c
  108: 'if n \\&\\$1\c
  109: 'if n \&"
  110: \\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
  111: '.ft R
  112: ..
  113: .\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
  114: .	\" AM - accent mark definitions
  115: .bd B 3
  116: .	\" fudge factors for nroff and troff
  117: .if n \{\
  118: .	ds #H 0
  119: .	ds #V .8m
  120: .	ds #F .3m
  121: .	ds #[ \f1
  122: .	ds #] \fP
  123: .\}
  124: .if t \{\
  125: .	ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  126: .	ds #V .6m
  127: .	ds #F 0
  128: .	ds #[ \&
  129: .	ds #] \&
  130: .\}
  131: .	\" simple accents for nroff and troff
  132: .if n \{\
  133: .	ds ' \&
  134: .	ds ` \&
  135: .	ds ^ \&
  136: .	ds , \&
  137: .	ds ~ ~
  138: .	ds ? ?
  139: .	ds ! !
  140: .	ds /
  141: .	ds q
  142: .\}
  143: .if t \{\
  144: .	ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  145: .	ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  146: .	ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  147: .	ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  148: .	ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  149: .	ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
  150: .	ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
  151: .	ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  152: .	ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10'
  153: .\}
  154: .	\" troff and (daisy-wheel) nroff accents
  155: .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  156: .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  157: .ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
  158: .ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
  159: .ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
  160: .ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
  161: .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  162: .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  163: .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  164: .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  165: .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  166: .ds ae a\h'-(\w'a'u*4/10)'e
  167: .ds Ae A\h'-(\w'A'u*4/10)'E
  168: .ds oe o\h'-(\w'o'u*4/10)'e
  169: .ds Oe O\h'-(\w'O'u*4/10)'E
  170: .	\" corrections for vroff
  171: .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  172: .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  173: .	\" for low resolution devices (crt and lpr)
  174: .if \n(.H>23 .if \n(.V>19 \
  175: \{\
  176: .	ds : e
  177: .	ds 8 ss
  178: .	ds v \h'-1'\o'\(aa\(ga'
  179: .	ds _ \h'-1'^
  180: .	ds . \h'-1'.
  181: .	ds 3 3
  182: .	ds o a
  183: .	ds d- d\h'-1'\(ga
  184: .	ds D- D\h'-1'\(hy
  185: .	ds th \o'bp'
  186: .	ds Th \o'LP'
  187: .	ds ae ae
  188: .	ds Ae AE
  189: .	ds oe oe
  190: .	ds Oe OE
  191: .\}
  192: .rm #[ #] #H #V #F C
  193: .SH "NAME"
  194: \fBdhcping\fR \- send a DHCP request to DHCP server to see if it's up and running
  195: .SH "SYNOPSIS"
  196: \fBdhcping\fR
  197: [\fB\-v\fR] [\fB\-q\fR] [\fB\-i\fR] [\fB\-r\fR]
  198: \fB\-t\fR \fImaxwait\fR
  199: \fB\-c\fR \fIclient-IP\-address\fR
  200: \fB\-s\fR \fIserver-IP\-address\fR
  201: \fB\-h\fR \fIclient-hardware-address\fR
  202: [\fB\-g\fR \fIgateway-IP\-address\fR]
  203: .SH "DESCRIPTION"
  204: This command allows the system administrator to check if a remote
  205: DHCP server is still functioning.
  206: .PP
  207: Options are:
  208: .Ip "\fB\-v\fR" 5
  209: Verbose, print some information.
  210: .Ip "\fB\-i\fR" 5
  211: Use \s-1DHCPINFORM\s0 packets.
  212: .Ip "\fB\-r\fR" 5
  213: Use \s-1DHCPREQUEST\s0 packets (default behaviour).
  214: .Ip "\fB\-q\fR" 5
  215: Quiet, print nothing on the screen.
  216: .Ip "\fB\-t\fR \fImaxwait\fR" 5
  217: Maximum time to wait for an answer from the server in seconds.
  218: Default is 3 seconds.
  219: .Ip "\fB\-c\fR \fIclient-\s-1IP\s0\-address\fR" 5
  220: Request this \s-1IP\s0 address. Note that this is also the \s-1IP\s0 address the
  221: answer will be sent to.
  222: .Ip "\fB\-s\fR \fIserver-\s-1IP\s0\-address\fR" 5
  223: Send the \s-1DHCP\s0 packet to this \s-1IP\s0 address.
  224: .Ip "\fB\-h\fR \fIclient-hardware-address\fR" 5
  225: Use this hardware-address in the \s-1DHCP\s0 request. It can be up to
  226: sixteen octets seperated by colons (i.e. 01:02:03:04)
  227: .Ip "\fB\-g\fR \fIgateway-\s-1IP\s0\-address\fR" 5
  228: Use this \s-1IP\s0 address for the gateway \s-1IP\s0 address in the \s-1DHCP\s0 packet.
  229: This option is currently broken.
  230: .SH "RETURN VALUES"
  231: If everything goes okay, it returns 0. If there went something
  232: wrong, it returns 1.
  233: .SH "SETUP"
  234: This program should be installed setuid root or ran by root only.
  235: See SECURITY for more information.
  236: .PP
  237: On your DHCP server, add these lines to the dhcpd.conf:
  238: .PP
  239: .Vb 4
  240: \&  host <your monitoring host FQDN> {
  241: \&     hardware ethernet <your monitor host mac address>;
  242: \&     fixed-address     <your monitoring host IP address>;
  243: \&  }
  244: .Ve
  245: Then try it:
  246: .PP
  247: $ dhcping \-c \fIyour monitoring host IP address\fR \e
  248:           \-s \fIyour DHCP server IP address\fR \e
  249:           \-h \fIyour monitor host mac address\fR
  250: .PP
  251: It will either respond with \*(L"no answer\*(R" or \*(L"Got answer from: \fIyour
  252: DHCP server IP address\fR\*(R"
  253: .PP
  254: The DHCP server logfile will give:
  255:  DHCPREQUEST\ for\ 192.168.1.1\ from\ 00:20:18:56:29:8f\ via\ ed0
  256:  DHCPACK\ on\ 192.168.1.1\ to\ 00:20:18:56:29:8f\ via\ ed0
  257:  DHCPRELEASE\ of\ 192.168.1.1\ from\ 00:20:18:56:29:8f\ via\ ed0\ (found)
  258: .PP
  259: Running in DHCPINFORM mode with \fB\-i\fR:
  260: .PP
  261: If you see \*(L"DHCPINFORM from 192.168.1.1 via xl0: not authoritative
  262: for subnet 192.168.1.0\*(R", you should add the authoritative statement
  263: to the subnet, See dhcpd.\fIconf\fR\|(5) for details.
  264: .PP
  265: When running in very verbose mode, \fBdhcping\fR tries to dump all
  266: data of the send and received DHCP packets. It will first dump the
  267: packet in hex-format, then decodes the header and finally the
  268: options.
  269: .SH "HOW IT WORKS"
  270: The client either sends a DHCPREQUEST or DHCPINFORM packet to the
  271: server and waits for an answer. Then, if a DHCPREQUEST was send,
  272: it will send a DHCPRELEASE back to the server.
  273: .SH "SECURITY"
  274: This program is installed setuid root as it requires the privileges
  275: to bind itself to port 68 (bootpc). Root privileges are dropped as
  276: soon as the program has bound itself to that port.
  277: .SH "BUGS"
  278: Currently (this may, or may not, change in the future) the ISC DHCP
  279: daemon does not write leases with a fixed IP address in the
  280: dhcpd.leases file.
  281: .PP
  282: DHCPINFORM packets can only be used on subnets the server is authori-
  283: tative for. If the monitoring script runs on a subnet the server
  284: isn't authoritative for, it should use the DHCPREQUEST packets. I
  285: also experienced some problems with ISC DHCPD v2 servers, but that
  286: is also in the README of it.
  287: .PP
  288: The \fB\-V\fR option is still working, but shouldn't be used for
  289: debugging of the packets. Better use \fIdhcpdump\fR\|(8) for that, which
  290: is available on my website. I wanted to remove it, but decided only
  291: to do it from the documentation, not from the code. Maybe I'll need
  292: it one day for debugging.
  293: .SH "AUTHOR"
  294: Edwin Groothuis, edwin@mavetju.org (http://www.mavetju.org)
  295: .SH "SEE ALSO"
  296: \fIdhcpd\fR\|(8), \fIdhclient\fR\|(8), dhcpd.\fIconf\fR\|(5), \fIdhcpdump\fR\|(8)
  297: 
  298: .rn }` ''
  299: .IX Title "dhcping 8"
  300: .IX Name "B<dhcping> - send a DHCP request to DHCP server to see if it's up and running"
  301: 
  302: .IX Header "NAME"
  303: 
  304: .IX Header "SYNOPSIS"
  305: 
  306: .IX Header "DESCRIPTION"
  307: 
  308: .IX Item "\fB\-v\fR"
  309: 
  310: .IX Item "\fB\-i\fR"
  311: 
  312: .IX Item "\fB\-r\fR"
  313: 
  314: .IX Item "\fB\-q\fR"
  315: 
  316: .IX Item "\fB\-t\fR \fImaxwait\fR"
  317: 
  318: .IX Item "\fB\-c\fR \fIclient-\s-1IP\s0\-address\fR"
  319: 
  320: .IX Item "\fB\-s\fR \fIserver-\s-1IP\s0\-address\fR"
  321: 
  322: .IX Item "\fB\-h\fR \fIclient-hardware-address\fR"
  323: 
  324: .IX Item "\fB\-g\fR \fIgateway-\s-1IP\s0\-address\fR"
  325: 
  326: .IX Header "RETURN VALUES"
  327: 
  328: .IX Header "SETUP"
  329: 
  330: .IX Header "HOW IT WORKS"
  331: 
  332: .IX Header "SECURITY"
  333: 
  334: .IX Header "BUGS"
  335: 
  336: .IX Header "AUTHOR"
  337: 
  338: .IX Header "SEE ALSO"
  339: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>