DHCP Help


DHCP is relatively straightforward to configure. You can probably use the sample configuration file with very little editing, provided that your network uses the same IP address range. Still, certain aspects of DHCP require careful consideration, and this will be covered here.

The following is a 'short list' of the things that need to be accomplished using the sample files, plus some additional information. The first step, of course, is to install the latest version of DHCP on your computer. FreeBSD includes the 'ISC' version of DHCP (note link above) in its 'ports' collection. For other operating systems, such as Linux, you may have to install it as a package, via an 'RPM' or one of the other package systems. Following that, you should do each of these steps in the order specified.

  1. Determine the IP address range you will be using for your network. Typically you will choose a 'private' IP address range, such as 192.168.1/24 . You should have a thorough grasp of subnets and IP addressing on a network before proceeding with this. For additional information on subnets, refer to the DNS 'quick start' page.
    If you have not already configured DNS, you should consider doing so before proceeding with DHCP.
  2. Determine the name of the computer and the domain you will eventually be creating with your domain controller. Additional information regarding the naming of your domain can be found on the DNS 'quick start' page (see link above).
  3. Copy the 'dhcpd.conf' text from the sample, below, into an proper location, making the appropriate changes for your machine and domain names, and your subnet. If you have more than one subnet, or want to allocate multiple address ranges, you should see the documentation on DHCP (man dhcpd, man dhcpd.conf) for more information.
    On FreeBSD, the configuration will reside in '/usr/local/etc/dhcpd.conf'. On other operating systems this may differ. See appropriate documentation if the location of this file is in doubt.
  4. Restart the DHCP daemon. You can either reboot the computer, or you can use some other method that's recommended. The ISC version of DHCP typically requires a complete shutdown and restart of the daemon.

Once your DHCP system is running, you can verify its operation by connecting a computer, configuring it as a 'DHCP Client' (for windows, 'Obtain IP Address Automatically'), and then verifying that an IP address has been correctly assigned, and that you can 'ping' any locations that should be reachable through the network.

The Files

The contents of the various files are shown here. You can 'clip' the text out of the html text and paste it into the appropriately named file, modifying the text as needed for your operating system, machine name, domain name, and network settings.
NOTE:  The 'dhcpd.conf' file shown below was taken from the sample file included with the 'ISC' DHCP implementation, and modified so that it would work on the 192.168.1/24 subnet, with a domain name of WORKGROUP.local, and a server name of FreeBSDServer. If your subnet, domain, and machine name do not match these values, you can edit the sample file here, or make similar changes to the sample file provided by ISC.

dhcpd.conf

This is the only configuration file needed for the ISC DHCP implementation. You should edit it to match your system. The subnet chosen in this file is 192.168.1/24 and the IP address allocation range is 192.168.1.16 through 192.168.1.63 . Also the domain name is specified as 'WORKGROUP.local'. You should make the appropriate changes and save the text to the '/usr/local/etc/dhcpd.conf' file (or its equivalent, based on your operating system).

# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#

# option definitions common to all supported networks...
option domain-name "WORKGROUP.local";
option domain-name-servers 192.168.1.1;

# this code is defined for the "Automatically Determine Proxy Settings" feature
# used by the Windows 'Internet Explorer' and Netscape web browsers.
option custom-proxy-server code 252 = text;

default-lease-time 600;
max-lease-time -1;

# This DHCP server is the official DHCP server for the local network
authoritative;

# ad-hoc DNS update scheme - set to "none" to disable dynamic DNS updates.
# The 'ad-hoc' style works well with BIND on FreeBSD.
ddns-update-style ad-hoc;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

# subnet declaration (trimmed down a bit from the sample)
# see 'man dhcp-options' for list of options.  The options here are
# specified 

subnet 192.168.1.0 netmask 255.255.255.0
{
  # this subnet allocates 192.168.1.16 through 192.168.1.63 - you can change
  # this if you want a different range

  range 192.168.1.16 192.168.1.63;

  # the remaining options allow clients to determine certain things about the
  # network automatically, such as gateways, DNS, and so forth

  option dhcp-server-identifier 192.168.1.1;
  option domain-name-servers 192.168.1.1;
  option subnet-mask 255.255.255.0;
  option broadcast-address 192.168.1.255;

  default-lease-time 600;

# setting the max lease time to '-1' means that leases are typically indefinite
# if you do not want to do this, pick a shorter time in minutes, like 1440 for one day.
  max-lease-time -1;

  # SERVICES - the remaining entries are for various services that DHCP is
  #            advertising to the network.

  # these next 2 are for the Samba server.  If you are NOT running Samba,
  # you can comment them out.
  option netbios-name-servers 192.168.1.1;
  option netbios-node-type 8;

  # the domain name - make sure you update this!
  option domain-name "WORKGROUP.local";

  # uncomment these next lines (and edit them) if you are running NIS
#  option nis-servers 192.168.1.1;
#  option nis-domain "WORKGROUP.local";


  # if your DHCP server is operating as a router (such as NAT) uncomment this
  # line, or put the correct 'gateway' IP address here instead.
#  option routers 192.168.1.1;

  # if you are running the various services these refer to, uncomment them
  # and update the IP address information accordingly
#  option finger-server 192.168.1.1;
#  option time-servers 192.168.1.1;
#  option pop-server 192.168.1.1;
#  option smtp-server 192.168.1.1;
#  option www-server 192.168.1.1;

# Uncomment this if you want to provide a proxy server configuration file and
# indicate the correct web address in the string
#  option custom-proxy-server "http://192.168.1.1/wpad.pac";

}

# for additional configuration options, see the documentation and the sample 'dhcpd.conf'
# file that is installed with the software.



©2004-2013 by Stewart~Frazier Tools, Inc. - all rights reserved
Last Update: 6/23/2013
Back to 'Windows to UNIX®' page
Back to S.F.T. Inc. main page