xref: /dragonfly/share/man/man8/dhcp.8 (revision 19fe1c42)
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.3 2008/10/15 12:48:34 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
36The Dynamic Host Configuration Protocol (DHCP) allows hosts on a TCP/IP network
37to configure one or more network interfaces based on information collected from
38a DHCP server in response to a DHCP request.
39This mechanism is often used, for example, by cable modem and DSL network
40providers to simplify network configurations for their clients/customers.
41.Pp
42Information typically contained within a DHCP response includes an IP
43address for the interface, subnet mask, broadcast address, router (gateway)
44listing, domain name server listing, and the interface's MTU.
45.Pp
46To set up
47.Dx
48as a DHCP client:
49.Bl -enum -offset indent
50.It
51For each interface that is to be configured via DHCP, add
52.Dq Li DHCP
53to the
54.Va ifconfig_ Ns Aq Ar interface
55variable in
56.Pa /etc/rc.conf .
57See
58.Xr rc.conf 5
59for more information on the format of this file.
60.Pp
61The
62.Pa /etc/network.subr
63script reads each of these variables at boot-time and runs the
64.Xr dhclient 8
65program for each interface that is to be configured via DHCP.
66.It
67[Optional] To tweak settings, edit
68.Pa /etc/dhclient.conf .
69This file is shipped with the system.
70See
71.Xr dhclient.conf 5
72and
73.Xr dhclient 8
74for details.
75.El
76.Pp
77To set up
78.Dx
79as a DHCP server:
80.Bl -enum -offset indent
81.It
82Install
83.Xr dhcpd 8
84(available in
85.Xr pkgsrc 7 ) .
86.It
87Edit
88.Pa /usr/pkg/etc/dhcp/dhcpd.conf .
89See
90.Xr dhcpd.conf 5
91and
92.Xr dhcpd 8
93for details.
94.It
95Edit
96.Pa /etc/rc.conf
97and set
98.Cm dhcpd_flags="" .
99This will cause
100.Dx
101to start the
102.Xr dhcpd 8
103daemon at boot-time and listen for DHCP requests on the local network.
104To start it manually, execute the following command:
105.Pp
106.Dl # /usr/pkg/sbin/dhcpd [netif1 netif2 ...]
107.El
108.Pp
109The DHCP client and server use the Berkeley Packet Filter (BPF).
110Ensure the kernel has been compiled with BPF support
111and at least one
112.Pa /dev/bpf*
113file exists per broadcast network interface that is attached to the system.
114This is almost always the case and should only be considered if all other
115troubleshooting options have failed.
116.Pp
117See
118.Xr dhcpd 8
119for information on other available options.
120Note, 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
124DHCP server configuration file
125.It Pa /etc/rc.conf
126configuration file where
127DHCP client configuration is set for individual interfaces and
128.Cm dhcpd_flags
129must be set
130.It Pa /etc/dhclient.conf
131DHCP 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
139