Setting Networkwide Options

Most DHCP configuration files begin with a series of parameters that set global options. Listing 27.1 shows a typical small dhcpd.conf file, including many of the global options you might use. Many, but not all, of these global options begin with the keyword option. Whether or not a parameter begins with this keyword, most are followed by a value. This value may be an IP address, a hostname, a number, a Boolean keyword (true or false), or some other data.

Listing 27.1: Sample dhcpd.conf File default-lease-time 86400; max-lease-time 172800; option subnet-mask 255.255.255.0; option routers 172.27.15.1;

option domain-name-servers 172.27.15.2,10.72.81.2; option domain-name "threeroomco.com"; option netbios-name-servers 172.27.15.2; option netbios-node-type 8; get-lease-hostnames true;

subnet 172.27.15.0 netmask 255.255.255.0 { range 172.27.15.50 172.27.15.254;

Table 27.1 summarizes some of the more common global options you might want to set. Many of these options are demonstrated in Listing 27.1. All parameter lines end with semicolons (;). Some parameters take more than one value. For instance, the option domain-name-servers line in Listing 27.1 provides two IP addresses, separated by commas. In most cases, you can substitute hostnames for IP addresses. Doing so puts your server at the mercy of the DNS server, though; if it goes down or is compromised, your DHCP server may be unable to provide the information, or it may provide incorrect information.

Table 27.1 : Common Global DHCP Server Parameters

Parameter

Value

Description

default-lease-time

Integer

Sets the default lease time

in seconds. Clients may

request a specific lease

time that can override this

value. Typical lease times

are between a couple of

hours and several

days—tens or hundreds of

thousands of seconds.

Shorter lease times are in

order if you're planning

major network changes in

the near future or if the

network sees a lot of

changes—for example, if

laptop computers are being

connected for a few hours

and then disconnected.

max-lease-time

Integer

Sets the maximum lease

time, in seconds, the

server will grant. If a client

asks for a lease time

longer than this value, the

server grants a lease of

this value.

min-lease-time

Integer

Sets the minimum lease

time, in seconds, the

server will grant. If a client

asks for a lease time

shorter than this value, the

server grants a lease of

this value.

get-lease-hostnames

Boolean

If true, the server looks up

the hostname associated

Parameter

Value

Description with an IP address and returns that hostname to the client, which may use this value in setting its own hostname. By default or if this parameter is false, the server doesn't do this lookup.

use-host-decl-names

Boolean

If true, the server returns the hostname provided by the client as the client's assigned hostname.

ping-check

Boolean

If true, the server pings an address before assigning a lease on that address to a client. If the server receives a response, the server doesn't assign that address. This may be used to ensure that the server doesn't assign addresses that are already in use (say, by systems misconfigured with static IP addresses they should not be using). If the pinged system is also configured to ignore pings, this check won't work as intended.

option subnet-mask

Subnet mask (dotted quad format)

Sets the subnet mask to be assigned to clients.

option routers

IP addresses

The IP address or addresses for the subnet's router.

Parameter

Value

Description

option

IP addresses

The IP address or

domain-name-servers

addresses of DNS servers

the clients may use.

option domain-name

Domain name

The name of the domain in

which the clients reside.

Parameter

Value

Description

option

IP addresses

The IP address or

netbios-name-servers

addresses of NetBIOS

Name Service (NBNS)

servers, aka Windows

Internet Name Service

(WINS) servers. These

servers can be an

important part of Server

Message Block/Common

Internet File System

(SMB/CIFS) file sharing on

Wndows-dominated

networks.

option netbios-node-type

Binary code

A code for how NetBIOS

clients should attempt

name resolution. Values

are: 1 to use broadcasts,2

to use a WINS server, 4 to

try broadcasts first followed

by a WINS server, and 8 to

try a WINS server first

followed by a broadcast.

The best option is 8 if you

provide a WINS server with

the option

netbios-name-servers

parameter and, of course,

configure the specified

Parameter

Value

Description

system as a WINS server.

Note Table 27.1 is far from complete, but it describes the most common options. For information on more options, consult the dhcp-options and dhcp-eval man pages. Some of the options, such as the NetBIOS options in Table 27.1, set values that DHCP clients may ignore.

Notably absent from Table 27.1 is any method of setting the IP address that clients are to receive. This option does appear in Listing 27.1, though, as part of the subnet declaration. The next two sections cover options for assigning IP addresses in more detail.

0 0

Post a comment