What is DHCPv4 Relay?

In enterprise networks, dedicated servers are usually used to provide DHCP, DNS, TFTP, and FTP services. The clients are not generally on the same subnet as those servers. The clients used to broadcast messages to locate the servers and get services. Now, look at the figure below. Laptop0 is attempting to acquire an IPv4 address from a DHCP server using a broadcast message, but it has failed to get the IP address.
The Laptop0 is configured with the Automatic Private IP Addressing (APIPA). Router0 is not configured as a DHCPv4 server and cannot forward the broadcast message. The DHCPv4 server is configured but located on a different network, so Laptop0 cannot receive an IP address using DHCP.

The Figure 2 below illustrates release and renew the process of the IP address, first we have released the IP addressing information with ipconfig /release command and then again trying to get the IP address from DHCP server using ipconfig /renew command but again attempting to renew its IPv4 address failed.
Notice when the IPv4 address is released, the address is shown to be 0.0.0.0. With ipconfig /renew command laptop0 broadcast a DHCPDISCOVER message but cannot locate the DHCPv4 server. Because routers do not forward broadcasts so, the request is not successful.

So, we can solve this problem by adding DHCPv4 servers on all the subnets. However, this solution creates additional costs and administrative overhead over the network. So, what is a better solution?
A better solution is the Cisco IOS helper-address configuration. The Cisco IOS helper enables a router to forward DHCPv4 broadcasts to the DHCPv4 server. When a router is configured to forward address assignment/parameter requests, it is called a DHCPv4 relay agent.
Look at the example topology: When Laptop0 sends a request to locate a DHCPv4 server to Router0. If Router0 is configured as a DHCPv4 relay agent, it will forward the request to the DHCPv4 server on subnet 172.16.0.0/24 network.
DHCPv4 Relay Agent Configuration
The figure below illustrates the Relay Agent configuration on Router0. The command for configuring a relay agent is the ip helper-address interface configuration mode command.
After the configuration as a DHCPv4 relay agent, the Router accepts broadcast requests for the DHCPv4 service. Then, it forwards those requests as a unicast to the IPv4 address configured with ip helper-address. The show ip interface command is used to verify the configuration.


Now, you can verify the IP address configuration on Laptop0 and Laptop1. Both are now able to acquire an IPv4 address from the DHCPv4 server. The figure below illustrates the IPv4 address leased from the DHCPv4 server to Laptop0.

The ip helper-address command also forwards Port 37 for Time, Port 49 for TACACS, Port 53 for DNS, Port 67 for DHCP/BOOTP client, Port 68 for DHCP/BOOTP server, Port 69 for TFTP, Port 137 for NetBIOS name service and Port 138 for NetBIOS datagram service.
FAQs
What is DHCPv4 relay?
It is a process in which a router or a relay agent forwards DHCP requests from clients to a DHCP server located on a different network segment.
How does the DHCPv4 relay work?
The relay agent receives DHCP broadcast messages from clients, changes the destination address to the DHCP server’s address, and forwards the message to the server. The server then sends the response back to the relay agent, which forwards it to the client.
Why is the DHCPv4 relay important?
DHCPv4 relay is essential because it allows DHCP servers to be located on different network segments, reducing the need for multiple DHCP servers and simplifying network management.
What are the benefits of using DHCPv4 relay?
Benefits include centralized DHCP management, reduced administrative overhead, and improved network scalability.
How do you configure the DHCPv4 relay on a router?
To configure the DHCPv4 relay, you need to set up a DHCP relay profile, configure helper addresses, and assign the profile to the appropriate interfaces on the router.