Enable DHCP Relay on a Cisco router

mai 20th, 2009 by Alexandre VIOT Leave a reply »
We have seen (here) that a Cisco router can act as a DHCP server on a small network. However, DHCP is a problem when trying to install a DHCP service on a dedicated server which is not on the same subnet as  clients.

In this article, we study how to activate the DHCP relay on the router to forward requests from clients located on a different network.

To better understand the problem, we will quickly  review the functioning of DHCP protocol.

Understanding the problem.

Take a basic network composed of a DCHP server and multiple clients.

dhcpnetworkObtaining a client IP configuration is done in 4 steps:

DHCP DISCOVER: As a first step, the client sending a  configuration request in broadcast.

DHCP Offer: If a DHCP server is present, then it receives the request and responds to client by offering a free IP configuration.

DHCP Request: The client requests to the first DHCP server which responds it to give the proposed configuration ,always broadcast

DHCP Ack: Finally, the server validates the configuration.

Below is a diagram representing the different stages:

dhcp_etape

We must not forget that the client’s request is sent in broadcast, the problem is here.

Indeed, the request of the client cannot cross a router because it is a 3 layer equipment and that it separates the areas of broadcast.

In the diagram below, clients cannot obtain an IP configuration because the DHCP server is placed behind the router:

dhcprelai

To resolve this problem, we must activate DHCP relay on the router. Therefore, it forwards all client’s requests from newtwork A to the DHCP server in the network B.

This is also valid for the following protocols:

  • TFTP
  • DNS
  • Time
  • NetBIOS Name Server
  • NetBIOS Datagram Service
  • BOOTP Server
  • TACACS

Configuring the router

The router configuration is very simple by itself

We must specify to the router which IP address transfer requests arriving on the interface.

Handling is therefore in interface configuration mode.

In our example, the configuration will be on the F0/0 interface

LaboIT(config)#interface FastEthernet0/0

LaboIT(config-if)#ip helper-address 192.168.2.2

The last step is to configure the server to offer leases on the DHCP network address A. We see this in future articles. Windows Server 2008 and a Linux server.

Advertisement

Laisser un commentaire