Monday, February 6, 2012

DHCP Relay

Dynamic Host Configuration Protocol (DHCP) serves to provide configuration parameters in a client/server environment where the DHCP server maintain address pool and lease information which the server used at time of requesting for IP from client side. This concept of DHCP relay is used when client and server does not reside on the same subnet. Look at the figure below; where the DHCP relay agent acts as a middle-man between host and DHCP server. When the host boots up on the network, the DHCP lease process occurs between the DHCP server and host (client).

DHCP lease process involves the following steps:

1. DHCPDISCOVER
In this step the host (client) sends a broadcast message over the network to request for IP address lease. The DHCP relay agent forwards the request to DHCP server after receiving from host.

2. DHCPOFFER
This can be a response from different server. This includes configuration parameters like IP, Lease information, MAC address, domain name etc as a unicast message to the host (client)

3. DHCPREQUEST
This is in response from the DHCP server to client who sends the initial DHCP server request, message means the client is requesting for IP address lease.

4. DHCPACK
This is sent by DHCP server to DHCP client which is the confirmation of assigning IP lease to the client.

As DHCPDISCOVER message is a broadcast over the network and you need a proper routing to route this message across the other segments where it has to be routed. For this you need to configure this on router interface so that it can forward your request to your DHCP server.

NOTE: In a routed network, you would need DHCP Relay Agents if you plan to implement only one DHCP server.



All clients on a network should be able to contact DHCP server. For this your server should be on the network topology and relied on by all TCP/IP based hosts with your environment. If your network is composed of different segments then we have to perform any of the following tasks:

a) Place a DHCP Relay agent on each segment
b) Place a DHCP server on each segment
c) Configure your router to forward a broadcast message


Configuration on Router

HUAWEI

You just need to configure a single command under the interface

[HUAWEI] interface GigabitEthernet 1/0/1
[HUAWEI-GigabitEthernet1/0/1] dhcp select {global | interface | relay}
[HUAWEI-GigabitEthernet1/0/1] dhcp select relay
[HUAWEI-GigabitEthernet1/0/1] ip relay address 192.168.20.20

Verification:

display dhcp relay statistics
display dhcp relay server {all | interface | vlan}

CISCO

Router # ip dhcp relay enable
Router # ip dhcp relay server 192.168.20.20 //Specify DHCP server address

Verification


Router# show ip dhcp relay conf
Router# show ip dhcp relay statistics

I Hope this will be informative for you :)