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