DHCP relay agent

Problem with multiple DHCP servers on the same segment

Here, I will explain the points to note in DHCP redundancy.

 If the network is configured to obtain IP addresses automatically, if there is only one DHCP server, the DHCP server will be a single point of failure, and if the DHCP server goes down, all the servers configured to automatically obtain IP addresses will fail. clients will not be able to connect to the network.

 Redundant DHCP servers can eliminate single points of failure, but they are not without problems. This section describes the problem.

 If there are multiple DHCP servers on the same segment, the client will receive multiple DHCP Offers. The client selects one of them and sends a DHCP Request.

 You may think that there is no problem because you choose one of them, but if you install multiple DHCP servers, you need to pay attention to the assignment of the IP address of the DHCP server.

 If the IP address leasing range of each DHCP server overlaps, depending on how the leases are made, there will be clients with overlapping IP addresses on the same network.

As a result, the network becomes confused and communication becomes impossible.

 To solve this problem, each DHCP server must be configured with non-overlapping lease ranges.

 But there are also problems. That is, setting IP address pools so that lease ranges do not overlap reduces the number of available IP addresses.

 If there are two DHCP servers, the IP address pools must be divided in half so that they do not overlap.

When installing multiple DHCP servers, it is necessary to take this into account when planning IP addressing.

Problems with the location of the DHCP server

 DHCP client sends DHCP Discover to get information such as IP address. This DHCP Discover is a broadcast.

See the diagram below. What happens if the DHCP server is installed beyond the router?

 Since routers block broadcasts instead of forwarding them, DHCP Discover will not reach the DHCP server beyond the router.

 As a result, the DHCP client cannot deliver DHCP Discover to the DHCP server, so it times out and cannot connect to the network because it cannot obtain an IP address.

Blocking broadcasts by routers means that you need a DHCP server for each network.

 By using DHCP, even if you can automate the setting of IP-related parameters, the number of DHCP servers will increase, and the operation and management of the servers will become difficult, and the benefits of automatic setting will be halved. increase.

 Once you set up a DHCP server, you can’t leave it alone. The OS needs to be updated, and as the number of devices increases, the frequency of malfunctions and failures also increases, and maintenance is also required.

 If you can automatically distribute and centrally manage each network with one DHCP server, there are great advantages in terms of management and cost!

 Therefore, a function called “DHCP relay agent” is provided. By using this function, it becomes possible to relay DHCP broadcast requests.

DHCP relay agent

 Routers block broadcasts instead of forwarding them, so messages cannot reach DHCP servers beyond the router.

To solve this problem, you need to relay DHCP broadcast requests.

 The function that receives this DHCP client request and relays it to a DHCP server on another network is called a DHCP relay agent.

Using this function eliminates the need to install a DHCP server for each network.

There are several ways to implement this functionality in your network.

The first method is to prepare a server that relays DHCP.

The second method is to set up a relay agent on the router.

 Either method registers the IP address of the DHCP server. The DHCP relay agent then converts the broadcast DHCP message to unicast and relays it to the DHCP server.

 By using this DHCP relay agent function, even if the network is divided by routers, a single DHCP server can automatically configure network information such as IP addresses.