Home > Articles

Configuring the DHCP Server

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

In this chapter

  • Specifying the Basic Network Architecture

  • Required Configuration Parameters

  • Specifying Leases

  • Other DHCP Options

  • Extending a Lease and Moving Between Subnets

  • Other Configuration Information

In managing an enterprise network, the network architect designs the network architecture and determines the configuration parameters to be assigned to hosts throughout the network. When the network architecture has been determined, the network architect must indicate the structure of the network to the DHCP server. Based on that structure, the DHCP server selects configuration parameters and appropriate addresses for DHCP clients.

The examples in this chapter are based on the GSI network architecture example and scenarios described in Chapter 2, "An Example of DHCP in Operation." The configuration files are designed for use with the ISC DHCP server and use the syntax of the ISC DHCP server configuration files.

Specifying the Basic Network Architecture

The network architect describes the network architecture to the DHCP server by identifying the IP subnets, the addresses, and the subnet masks for each of those subnets. Using this information, the DHCP server associates incoming DHCP messages with subnets in the network. Based on the subnet from which a DHCP message was received, the server selects an appropriate IP address to assign to the client or determines that a DHCP client has moved to a new subnet.

The ISC DHCP server configuration file is an ASCII text file that contains a series of declarations describing the network to be managed by the server. The server reads and parses the file when it first starts running.

Subnet Declarations

The basic subnet declaration in the ISC server configuration file follows the format in Example 3.1.

Example 3.1

subnet subnet-address netmask subnet-mask {
    subnet declarations
    }

In this subnet declaration, subnet-address is the IP address of the subnet, and subnet-mask is the subnet mask to be used with this subnet. Both subnet-address and subnet-mask are written in dotted-decimal notation.

NOTE

In the examples in this chapter, keywords are shown in bold, and arguments that must be supplied are shown in italic.

The sample network shown in Figure 3.1 is described with the partial configuration file shown in Example 3.2. The sample configuration file includes a subnet declaration for each of the five subnets, with the IP address for each subnet and the 255.255.255.0 subnet mask. Figure 3.1 shows the IP addresses in the network.

Figure 3.1 IP addresses in the GSI network.

You can include comments in the configuration file for the ISC server as lines that begin with the # character. Example 3.2 includes several comments that explain some of the details of the configuration file.

Example 3.2

  # Server subnet
  subnet 192.168.11.0 netmask 255.255.255.0 {
    }
  # Staff subnet 1
  subnet 192.168.12.0 netmask 255.255.255.0 {
    }
  # Staff subnet 2
  subnet 192.168.13.0 netmask 255.255.255.0 {
    }
  # Staff subnet 3
  subnet 192.168.14.0 netmask 255.255.255.0 {
    }
  # Staff subnet 4
  subnet 192.168.15.0 netmask 255.255.255.0 {
    }

Subnet Address Allocation

In addition to defining the subnets, the network architect must define the range of addresses within each subnet, or scope, that is available for allocation by the server. Any addresses assigned to hosts or devices through some other mechanism must be excluded from the range of available addresses for each subnet. For example, in the GSI network, the router interface on each subnet is assigned the host address 254. Thus, on the 192.168.11.0 subnet, the router uses address 192.168.11.254.

The network architect manually configures the router interfaces, rather than using DHCP to assign the addresses. The server is configured so that the range of available addresses on each subnet does not include the router's address.

In the ISC server configuration file, the syntax for specifying the range of available addresses in a subnet is shown in Example 3.3.

Example 3.3

range first-available-address last-available-address;

Example 3.4 gives the configuration file for the GSI network, specifying that IP addresses 1 through 251 are available on the server subnet and IP addresses 1 through 253 are available on the other subnets for assignment to DHCP clients in each subnet. This configuration file reserves host address 254 on each subnet for the router interface on that subnet. The server subnet declaration also reserves addresses for a DHCP server and a DNS server.

Example 3.4

# Server subnet
subnet 192.168.11.0 netmask 255.255.255.0 {
  range 192.168.11.1 192.168.11.251;
  # 192.168.11.252 reserved for DHCP server
  # 192.168.11.253 reserved for DNS server
  # 192.168.11.254 reserved for router interface
}
# Staff subnet 1
subnet 192.168.12.0 netmask 255.255.255.0 {
  range 192.168.12.1 192.168.12.253;
  # 192.168.12.254 reserved for router interface
}
# Staff subnet 2
subnet 192.168.13.0 netmask 255.255.255.0 {
  range 192.168.13.1 192.168.13.253;
  # 192.168.13.254 reserved for router interface
  }
# Staff subnet 3
subnet 192.168.14.0 netmask 255.255.255.0 {
  range 192.168.14.1 192.168.14.253;
  # 192.168.14.254 reserved for router interface
}
# Staff subnet 4
subnet 192.168.15.0 netmask 255.255.255.0 {
  range 192.168.15.1 192.168.15.253;
  # 192.168.15.254 reserved for router interface
  }
  • + Share This
  • 🔖 Save To Your Account