DHCP relay agent
A routed interface can be configured to relay DHCP messages from clients to a DHCP server that exists on a remote broadcast domain. Such a DHCP relay agent can be configured if it fulfills the following criteria:
- The relay agent interface must be on the same broadcast domain/network segment as the DHCP client
- The DHCP server IP address (the helper address) must be reachable from the DHCP relay interface (routing must be employed correctly)
- The DHCP server must have a DHCP scope that is identical to that of the interface configured as a relay agent (subnet mask)
The relay agent and DHCP server will operate as follows:
- The DHCP server will provide an IP address for the client from a scope that is matched to the IP address and subnet mask of the relay agent interface. For example, if a client sends a DHCP request via a relay agent interface that has an IP address of 172.16.3.1/24, the DHCP server will respond by offering an IP address to the client within the 172.16.3.0/24 subnet, if that scope is configured on the server.
- The DHCP server will define the default gateway for the DHCP client as the IP address of the relay agent interface. In other words, the relay agent interface always plays the role of the default gateway for that particular network segment.
It is also possible to define multiple IP helper-addresses on an interface.
The above description focuses on IPv4. For relay agents in an IPv6 environment that uses DHCPv6, take a look at DHCPv6 relay agent.
Links:
https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipapp/command/iap-cr-book/iap-i1.html#wp1413119578
https://networklessons.com/cisco/ccie-routing-switching/cisco-ios-dhcp-relay-agent