Fix path to the dhcpd.conf file.
[dragonfly.git] / share / man / man8 / dhcp.8
1 .\"     $OpenBSD: dhcp.8,v 1.24 2008/06/08 03:03:37 jdixon Exp $
2 .\"     $DragonFly: src/share/man/man8/dhcp.8,v 1.2 2008/10/15 11:39:49 matthias Exp $
3 .\"
4 .\"
5 .\" Copyright (c) 1999 Aaron Campbell
6 .\" All rights reserved.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\"
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 .\"
29 .Dd October 15, 2008
30 .Dt DHCP 8
31 .Os
32 .Sh NAME
33 .Nm dhcp
34 .Nd configuring DragonFly for DHCP
35 .Sh DESCRIPTION
36 The Dynamic Host Configuration Protocol (DHCP) allows hosts on a TCP/IP network
37 to configure one or more network interfaces based on information collected from
38 a DHCP server in response to a DHCP request.
39 This mechanism is often used, for example, by cable modem and DSL network
40 providers to simplify network configurations for their clients/customers.
41 .Pp
42 Information typically contained within a DHCP response includes an IP
43 address for the interface, subnet mask, broadcast address, router (gateway)
44 listing, domain name server listing, and the interface's MTU.
45 .Pp
46 To set up
47 .Dx
48 as a DHCP client:
49 .Bl -enum -offset indent
50 .It
51 For each interface that is to be configured via DHCP, add
52 .Dq Li DHCP
53 to the
54 .Va ifconfig_ Ns Aq Ar interface
55 variable in
56 .Pa /etc/rc.conf .
57 See
58 .Xr rc.conf 5
59 for more information on the format of this file.
60 .Pp
61 The
62 .Pa /etc/network.subr
63 script reads each of these variables at boot-time and runs the
64 .Xr dhclient 8
65 program for each interface that is to be configured via DHCP.
66 .It
67 [Optional] To tweak settings, edit
68 .Pa /etc/dhclient.conf .
69 This file is shipped with the system.
70 See
71 .Xr dhclient.conf 5
72 and
73 .Xr dhclient 8
74 for details.
75 .El
76 .Pp
77 To set up
78 .Dx
79 as a DHCP server:
80 .Bl -enum -offset indent
81 .It
82 Install
83 .Xr dhcpd 8
84 (available in
85 .Xr pkgsrc 7 ) .
86 .It
87 Edit
88 .Pa /usr/pkg/etc/dhcp/dhcpd.conf .
89 See
90 .Xr dhcpd.conf 5
91 and
92 .Xr dhcpd 8
93 for details.
94 .It
95 Edit
96 .Pa /etc/rc.conf
97 and set
98 .Cm dhcpd_flags="" .
99 This will cause
100 .Dx
101 to start the
102 .Xr dhcpd 8
103 daemon at boot-time and listen for DHCP requests on the local network.
104 To start it manually, execute the following command:
105 .Pp
106 .Dl # /usr/sbin/dhcpd [netif1 netif2 ...]
107 .El
108 .Pp
109 The DHCP client and server use the Berkeley Packet Filter (BPF).
110 Ensure the kernel has been compiled with BPF support
111 and at least one
112 .Pa /dev/bpf*
113 file exists per broadcast network interface that is attached to the system.
114 This is almost always the case and should only be considered if all other
115 troubleshooting options have failed.
116 .Pp
117 See
118 .Xr dhcpd 8
119 for information on other available options.
120 Note, however, that most of the flags are useful only for debugging purposes.
121 .Sh FILES
122 .Bl -tag -width /usr/pkg/etc/dhcpd.conf
123 .It Pa /usr/pkg/etc/dhcp/dhcpd.conf
124 DHCP server configuration file
125 .It Pa /etc/rc.conf
126 configuration file where
127 DHCP client configuration is set for individual interfaces and
128 .Cm dhcpd_flags
129 must be set
130 .It Pa /etc/dhclient.conf
131 DHCP client configuration file
132 .El
133 .Sh SEE ALSO
134 .Xr dhclient.conf 5 ,
135 .Xr dhcpd.conf 5 Pq Pa pkgsrc/net/isc-dhcpd4 ,
136 .Xr dhclient 8 ,
137 .Xr dhcpd 8 Pq Pa pkgsrc/net/isc-dhcpd4 ,
138 .Xr dhcrelay 8 Pq Pa pkgsrc/net/isc-dhcrelay4