Home > Articles

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

This chapter is from the book

Specifying Leases

Chapter 2 describes the use of leases as a mechanism through which a DHCP server knows when a host will stop using an IP address. The DHCP specification allows a lease to be up to 232–2 seconds (49,710 days, or about 135 years).

NOTE

232–2 is expressed as FFFFFFFE16. This is the largest number that can be stored in the 32-bit lease field in a DHCP message. DHCP uses FFFFFFFF16 to represent an infinite lease.

Lease Durations

The DHCP specification does not include rules or requirements for lease allocation or duration; those policies are defined by the network architect and are implemented by the DHCP server. A DHCP client might request a particular lease duration, but the DHCP server will always choose a lease duration based on the policies for lease assignment defined by the network architect.

Default, Minimum, and Maximum Lease Lengths

The ISC server allows the network architect to specify a default lease length, a minimum lease length, and a maximum lease length. The default lease length is used if the client does not request a specific lease. The minimum lease length is used to force the client to take a longer lease than it has requested. The maximum lease length defines the longest lease that the server can allocate. If a client requests a lease longer than the maximum lease length, then the server simply issues a lease equal to the maximum lease length.

The syntax for defining the default, minimum and maximum lease lengths is shown in Example 3.8, and time is expressed in seconds.

Example 3.8

  default-lease-time time;
  max-lease-time time;
  min-lease-time time;

Subnet Lease Lengths

Choosing appropriate lease times for a subnet depends on the types of hosts that will connect to that subnet. Table 3.1 lists some types of subnets that might be a part of the GSI network and examples of lease times.

Table 3.1 Examples of Lease Times

Type of Subnet

Primary Use

Default Lease

GSI training lab

Students with laptops

One class period plus 10 minutes

Conference room

Visitors with laptops

2 hours

"Hotel" office

Staff members who use it daily

12 hours

Telecommuters

DSL/cable service

7 days

Staff offices

Permanent staff members

30 days

Central servers

Organization servers

3 months


NOTE

Hoteling means the temporary use of offices by staff on a daily basis. Each "hotel" office is equipped with a wall jack through which a laptop is connected to the GSI network. Because a different person may use these offices each day, the network must accommodate dynamic allocation of an IP address to the computer or computers in those offices on a daily basis.

Chapter 19, "Tuning a DHCP Service," includes a more detailed discussion of lease times for specific scenarios.

GSI Subnet Leases

In the GSI network, the 192.168.11.0 subnet is used for servers, which have a default lease of 90 days. The 192.168.12.0, 192.168.13.0, and 192.168.14.0 subnets are used for staff offices, and the computers connected to those subnets have a default lease of 30 days. The remaining subnet, 192.168.15.0, is used for hoteling, and computers connected to that subnet have a default lease of 12 hours.

The configuration file for these lease times is shown in Example 3.9.

Example 3.9

# 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
  option routers 192.168.11.254;
  option subnet-mask 255.255.255.0;
  option domain-name-servers 192.168.11.253;
  # default lease = 90 days, max lease = 120 days
  default-lease-time 7776000;
  max-lease-time 10368000;
  }
# 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
  option routers 192.168.12.254;
  option subnet-mask 255.255.255.0;
  option domain-name-servers 192.168.11.253;
  # default lease = 30 days, max lease = 45 days
  default-lease-time 2592000;
  max-lease-time 3888000;
}
# 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
  option routers 192.168.13.254;
  option subnet-mask 255.255.255.0;
  option domain-name-servers 192.168.11.253;
  # default lease = 30 days, max lease = 45 days
  default-lease-time 2592000;
  max-lease-time 3888000;
}
# 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
  option routers 192.168.14.254;
  option subnet-mask 255.255.255.0;
  option domain-name-servers 192.168.11.253;
  # default lease = 30 days, max lease = 45 days
  default-lease-time 2592000;
  max-lease-time 3888000;
}
# Staff subnet 
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
  option routers 192.168.15.254;
  option subnet-mask 255.255.255.0;
  option domain-name-servers 192.168.11.253;
  # default lease = 12 hrs, max lease = 24 hrs
  default-lease-time 43200;
  max-lease-time 86400;
}
  • + Share This
  • 🔖 Save To Your Account