xref: /dragonfly/contrib/dhcpcd/README.md (revision 2b3f93ea)
1# dhcpcd
2
3dhcpcd is a
4[DHCP](https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol) and a
5[DHCPv6](https://en.wikipedia.org/wiki/DHCPv6) client.
6It's also an IPv4LL (aka [ZeroConf](https://en.wikipedia.org/wiki/Zeroconf))
7client.
8In layperson's terms, dhcpcd runs on your machine and silently configures your
9computer to work on the attached networks without trouble and mostly without
10configuration.
11
12If you're a desktop user then you may also be interested in
13[Network Configurator (dhcpcd-ui)](http://roy.marples.name/projects/dhcpcd-ui)
14which sits in the notification area and monitors the state of the network via
15dhcpcd.
16It also has a nice configuration dialog and the ability to enter a pass phrase
17for wireless networks.
18
19dhcpcd may not be the only daemon running that wants to configure DNS on the
20host, so it uses [openresolv](http://roy.marples.name/projects/openresolv)
21to ensure they can co-exist.
22
23See [BUILDING.md](BUILDING.md) for how to build dhcpcd.
24
25## Configuration
26
27You should read the dhcpcd.conf man page
28and put your options into `/etc/dhcpcd.conf`.
29The default configuration file should work for most people just fine.
30Here it is, in case you lose it.
31
32```
33# A sample configuration for dhcpcd.
34# See dhcpcd.conf(5) for details.
35
36# Allow users of this group to interact with dhcpcd via the control socket.
37#controlgroup wheel
38
39# Inform the DHCP server of our hostname for DDNS.
40hostname
41
42# Use the hardware address of the interface for the Client ID.
43#clientid
44# or
45# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
46# Some non-RFC compliant DHCP servers do not reply with this set.
47# In this case, comment out duid and enable clientid above.
48duid
49
50# Persist interface configuration when dhcpcd exits.
51persistent
52
53# Rapid commit support.
54# Safe to enable by default because it requires the equivalent option set
55# on the server to actually work.
56option rapid_commit
57
58# A list of options to request from the DHCP server.
59option domain_name_servers, domain_name, domain_search, host_name
60option classless_static_routes
61# Respect the network MTU. This is applied to DHCP routes.
62option interface_mtu
63
64# Most distributions have NTP support.
65#option ntp_servers
66
67# A ServerID is required by RFC2131.
68require dhcp_server_identifier
69
70# Generate SLAAC address using the Hardware Address of the interface
71#slaac hwaddr
72# OR generate Stable Private IPv6 Addresses based from the DUID
73slaac private
74```
75
76The dhcpcd man page has a lot of the same options and more,
77which only apply to calling dhcpcd from the command line.
78
79
80## Compatibility
81dhcpcd-5 is only fully command line compatible with dhcpcd-4.
82For compatibility with older versions, use dhcpcd-4.
83
84## Upgrading
85dhcpcd-7 defaults the database directory to `/var/db/dhcpcd` instead of
86`/var/db` and now stores dhcpcd.duid and dhcpcd.secret in there instead of
87in /etc.
88
89dhcpcd-9 defaults the run directory to `/var/run/dhcpcd` instead of
90`/var/run` and the prefix of dhcpcd has been removed from the files therein.
91
92## ChangeLog
93We no longer supply a ChangeLog.
94However, you're more than welcome to read the
95[commit log](https://github.com/NetworkConfiguration/dhcpcd/commits) and
96[release announcements](https://github.com/NetworkConfiguration/dhcpcd/releases).
97