Page 461 / 998 Scroll up to view Page 456 - 460
DHCP support
Dynamic Host Configuration Protocol
5-1
iMG/RG Software Reference Manual (System Administration)
5. System Administration
5.1
Dynamic Host Configuration Protocol
The
Dynamic Host Configuration Protocol
(DHCP) is defined in RFC 1541 and provides a mechanism for pass-
ing configuration information to hosts on a TCP/IP network.
DHCP is based on the
Bootstrap Protocol
(BOOTP) defined in RFC 1542, but adds automatic allocation of
reusable network addresses and additional configuration options.
DHCP is based on a client–server model, where the server is the host that allocates network addresses and ini-
tialization parameters, and the client is the host that requests these parameters from the server.
There are a number of parameters that a DHCP server can supply to clients in addition to assigning IP
addresses. They can supply addresses of DNS server, WINS Server, Cookie server etc.… Also, they can supply
the gateway address for the LAN.
DHCP supports three mechanisms for IP address allocation
In the
automatic allocation
mechanism, DHCP assigns a permanent IP address to a host.
In the
dynamic allocation
mechanism, DHCP assigns an IP address to a host for a limited period of time, or
until the host explicitly relinquishes the address.
In the
manual allocation
mechanism, the network administrator assigns a host’s IP address, and DHCP is
used simply to convey the assigned address to the host. A particular network will use one or more of these
mechanisms, depending on the policies of the network administrator.
Dynamic allocation
is the only one of the three mechanisms that allows automatic reuse of an address that is
no longer needed by the host to which it was assigned.
Dynamic allocation
is particularly useful for assigning an
address to a host that will be connected to the network only temporarily, or for sharing a limited pool of IP
addresses among a group of hosts that do not need permanent IP addresses.
Dynamic allocation
may also be a good choice for assigning an IP address to a new host being permanently con-
nected to a network where IP addresses are sufficiently scarce that it is important to reclaim them when old
hosts are retired.
5.1.1
DHCP support
The gateway devices are able to act both as DHCP server and as DHCP client.
Typically, DHCP server features are activated on the internal network to assign IP address to hosts connected
to the internal interfaces. The DHCP client function, instead, is used on the external interface to get IP
addresses from the ISP.
Page 462 / 998
Dynamic Host Configuration Protocol
DHCP server
iMG/RG Software Reference Manual (System Administration)
5-2
The devices also support DHCP relay functionality. In this case the intelligent Multiservice Gateway picks up
DHCP requests sent by hosts connected to the internal interfaces, and forwards their requests to an external
DHCP server and then routes back to the hosts the replies that are received from the server.
5.1.2
DHCP server
The DHCP protocol allows a host that is unknown to the network administrator to be automatically assigned a
new IP address out of a pool of IP addresses for its network. In order for this to work, the network administra-
tor allocates address pools for each available subnet and enters them into the
dhcpd.conf
file.
On start-up, the DHCP server software reads the
dhcpd.conf
file and stores a list of available addresses on
each subnet. When a client requests an address using the DHCP protocol, the server allocates an address for
it.
Each client is assigned a lease, which expires after an amount of time chosen by the administrator (by default,
12 hours). Some time before the leases expire, the clients to which leases are assigned are expected to renew
them in order to continue to use the addresses. Once a lease has expired, the client to which that lease was
assigned is no longer permitted to use the leased IP address and must resort back to the DHCPDISCOVER
mechanism (see RFC 2131) to request a new lease.
In order to keep track of leases across system reboots and server restarts, the server keeps a list of leases it
has assigned in the
dhcpd.leases
file (stored in ISFS).
Before a lease is granted to a host, it records the lease in this file. Upon start-up, after reading the
dhcpd.conf
file, the DHCP server reads the
dhcpd.leases
file to gain information about which leases had been assigned
before reboot.
New leases are appended to the end of the lease file.
In order to prevent the file from becoming arbitrarily large, the server periodically creates a new
dhcp.leases
file from its lease database in memory.
If the system crashes in the middle of this process, only the lease file present in flash memory can be restored.
This gives a window of vulnerability whereby leases may be lost.
This server also provides BOOTP support. Unlike DHCP, the BOOTP protocol does not provide a protocol
for recovering dynamically assigned addresses once they are no longer needed. It is still possible to dynamically
assign addresses to BOOTP clients, but some administrative process for reclaiming addresses is required. By
default, leases are granted to BOOTP clients in perpetuity, although the network administrator may set an ear-
lier cut-off date or a shorter lease length for BOOTP leases if that makes sense.
5.1.2.1 Example
This paragraph provides a guide to configuring the DHCP server using commands available on the CLI.
Let's assuming that in the system there has been defined an internal interface (where the DHCP Server module
will run) with the following IP address and netmask:
192.168.219.1 255.255.255.
Page 463 / 998
DHCP server
Dynamic Host Configuration Protocol
5-3
iMG/RG Software Reference Manual (System Administration)
The following DHCP server configuration will create a range of 10 available IP addresses in the 19.168.219.0
subnet:
dhcpserver add subnet mysubnet 192.168.219.0 255.255.255.0
192.168.219.10 192.168.219.20
dhcpserver set subnet mysubnet defaultleasetime 1800
dhcpserver set subnet mysubnet maxleasetime 86000
dhcpserver subnet mysubnet add option domain-name-servers
192.168.220.30
dhcpserver subnet mysubnet add option routers 192.168.221.40
dhcpserver subnet mysubnet add option irc-server 10.5.7.20
dhcpserver subnet mysubnet add option auto-configure 1
Default lease time and maximum lease time are set to 1800 seconds and 86000 seconds, respectively.
Four DHCP options are configured, in addition to the usual IP address and subnet mask:
DNS server address of 192.168.220.30;
Default gateway address of 192.168.221.40;
IRC server address of 10.5.7.20;
And the
auto-configure
option, which will allow use of address auto-configuration by clients on the net-
work.
Instead of specifying the
domain-name-servers
and
routers
options manually, the following commands could
have been used which provide automatic values for these options:
dhcpserver set subnet mysubnet hostisdnsserver enabled
dhcpserver set subnet mysubnet hostisdefaultgateway enabled
This will result in the DHCP server taking the IP address of the IP interface it is running on, and supplying that
address to DHCP clients as the DNS server and default gateway, respectively. This is especially useful in a
deployment that utilizes the DNS relay on the residential gateway.
Note:
Note that for DHCP clients using DHCPINFORM, the above declarations mean that the server would
supply the given configuration options to any client that is on the 192.168.219.x subnet. This even
includes clients that are not included in the available address ranges – this is sensible, since ideally the
DHCP server should not have addresses available to give out that may already belong to hosts on the
same subnet.
The CLI can also be used to define fixed host/IP address mappings. For example, the command:
dhcpserver add fixedhost myhost 192.168.219.5 00:20:2b:01:02:03
Will add a fixed mapping of the IP address 192.168.219.5 to a host whose ethernet MAC address is
00:20:2b:01:02:03.
Note:
Note that fixed IP mappings cannot overlap with dynamic IP ranges on a subnet, and vice-versa (you will
receive an error message if you try to do this).
Page 464 / 998
Dynamic Host Configuration Protocol
DHCP client
iMG/RG Software Reference Manual (System Administration)
5-4
Note:
Note that you will still need to have a suitable subnet declaration – for example, a subnet 192.169.219.0
with netmask 255.255.255.0, as shown earlier. Any configuration options you define in this subnet will
also be offered to every fixed host you have added which is also on the given subnet.
It is also possible to assign a maximum lease duration to fixed DHCP clients as follows:
dhcpserver set fixedhost myhost maxleasetime 7200
In this context, fixed lease duration would normally be used to allow DHCP clients to see changes in offered
options quickly. The IP address itself is always guaranteed to be available for assignment to the specific host
(unless there are other DHCP servers on the same network that are deliberately configured to conflict).
You might see the following message if you have ever turned off the DHCP server:
Note:
Note the DHCP server is not currently enabled.
If you see this, issue the following command:
dhcpserver enable
The final step is to tell the system to update the DHCP server software with the new IP interface and configu-
ration that has been defined. To do this, issue the following command:
dhcpserver update
Note:
NO configuration changes that you have made on the DHCP server will take effect until you enter the
DHCPSERVER UPDATE command.
5.1.3
DHCP client
A DHCP client uses the facilities of the IP stack to transmit and receive DHCP packets. This information is pro-
cessed by the client and passed back to the IP stack to complete interface configuration for the lease duration.
A DHCP client is created on a given interface by using the IP SET INTERFACE command with the parameter
DHCP enabled. After this, the IP settings are discovered for the interface (It's possible define one or more
interfaceconfig
rules to customize the option that must be requested).
This section describes how these settings are discovered.
Firstly, the interface is disabled for all non-DHCP traffic. This will reset the IP address and subnet mask of each
nominated interface to 0.0.0.0.
The DHCP client learns its required configuration details via a DHCPDISCOVER request.
If configuration details are not successfully obtained using DHCP, the DHCP client will retry indefinitely in
order to learn them, as described in RFC2131 (unless the interface is disabled). Retry characteristics can be
defined using DHCPCLIENT SET RETRY command.
Once the DHCP client has accepted a suitable configuration for the interface, it has to configure the IP stack
appropriately. This involves allocating the new IP address to the interface and configuring the subnet for the
interface.
Page 465 / 998
DHCP client
Dynamic Host Configuration Protocol
5-5
iMG/RG Software Reference Manual (System Administration)
Addresses allocated by DHCP expire after the specified lease time runs out. If this happens, the DHCP client
must relearn its configuration by repeating the process described above. The client will attempt to initiate
renewal of a held lease well before it is due to expire (approximately half way through the total duration of the
lease). This avoids the problem of an active interface being unexpectedly disabled and dropping normal IP traffic.
The DHCP client on the AT-RG624/634 DHCP conforms to most of the specification given in RFC2131. A sub-
set of the DHCP options described in RFC2132 is supported.
The residential Gateway DHCP client accepts and makes use of the following information:
IP address
Subnet mask
Default route (one only)
Domain name servers (up to two can be usefully supported by DNS relay)
Host name or DHCP-client-identifier. This option can be used to specify a client identifier in a host declara-
tion, so that a DHCP server can find the host record by matching against the client identifier. This option
can be useful when attempting to operate the DHCP client with a Microsoft DHCP server.
Note:
When attempting to use a DHCP client with a Microsoft DHCP server, then
send dhcpclient-identifier
is
mandatory, and must be specifically set to the MAC address of the device upon which the client is
running; otherwise DHCP will not work at all.
5.1.3.1 Lease requirements and requests
The DHCP protocol allows the client to request that the server send it specific information, and not send it
other information that it is not prepared to accept. The protocol also allows the client to reject offers from
servers if they do not contain information the client needs, or if the information provided is not satisfactory.
Using the DHCPCLIENT INTERFACE CONFIG ADD REQUESTED OPTION command causes the client to
request that any server responding to the client send the client its values for the specified options. Only the
option names should be specified in the request statement - not option parameters.
Using the DHCPCLIENT INTERFACE CONFIG ADD REQUIRED OPTION command configures a list of
options that must be sent in order for an offer to be accepted. Offers that do not contain
all
the listed options
will be ignored.
Using the DHCPCLIENT INTERFACE CONFIG ADD SENT OPTION command causes the client to send the
specified options to the server with the specified values. Options that are always sent in the DHCP protocol
should not be specified here, except that the client can specify a
requested-lease-time
option other than the
default requested lease time, which is two hours. The other obvious use for this statement is to send informa-
tion to the server that will allow it to differentiate between this client and other clients or kinds of clients.

Rate

4 / 5 based on 3 votes.

Popular Allied-Telesis Models

Bookmark Our Site

Press Ctrl + D to add this site to your favorites!

Share
Top