You want to configure your router to pass DHCP requests from local clients to a centralized DHCP server.
The ip helper-address configuration command allows the router to forward local DHCP requests to one or more centralized DHCP servers:
Router1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#interface Ethernet0 Router1(config-if)#ip helper-address 172.25.1.1 Router1(config-if)#ip helper-address 172.25.10.7 Router1(config-if)#end Router1#
The traditional role of a router in DHCP has been to act as a proxy device that forwards information between the client and server. This proxy function is still the most common for routers, but Cisco routers have had DHCP server and client features since IOS level 12.0(1)T.
Because the initial DHCP request comes from a client that typically doesn't have an IP address, it must find the server using a Layer 2 broadcast. So, if the router is not able to function as a proxy for these broadcasts, there must be a DHCP server on every network segment.
The DHCP server needs two critical pieces of information before it can allocate an IP address to the client: the subnet that the client is connected to and the client device's MAC address. The subnet information is needed to ensure that the address that the server allocates will actually work on client's network segment, while the MAC address allows the server to find any information that is unique to a workstation. This is essential if you need to ensure that a particular end device gets the same IP address every time it connects to the network.
So the DHCP proxy, which is the router itself, must convert the local broadcast from the client to a unicast packet and forward it to the server. This is what the ip helper-address command does.
When the DHCP client sends the DHCP request packet, it doesn't have an IP address. So it uses the all-zeros address (0.0.0.0) as the IP source address. It also doesn't know how to reach the DHCP server, so it uses a general broadcast address (255.255.255.255) for the destination.
The router must replace the source address with its own IP address, for the interface that received the request. And it replaces the destination address with the address specified in the ip helper-address command. The client device's MAC address is included in the payload of the original DHCP request packet, so the router doesn't need to do anything to ensure that the server receives this information.
The DHCP server now has enough information to assign an address from the correct address pool, since it now knows what the originating subnet was for the DHCP request. The server then sends a unicast response back to the proxy router, which in turn sends the request back to the correct MAC address.
The example shows two ip helper-address commands. You should include one of these commands for each of your DHCP servers. The router will forward the DHCP broadcasts to all of these addresses. Most organizations use at least two DHCP servers because, although the utilization is light, the functionality is critical. If the client device receives several responses to a DHCP request, it will usually select the one it receives first.
It is important to note that the ip helper-address command does not just forward DHCP requests. In fact, although you can configure it to forward any UDP broadcast you want, it will forward UDP broadcast packets for several different UDP ports to the specified address by default. In some cases, this unwanted traffic can cause problems on the network or the DHCP server. Recipe 20.2 focuses on this issue.
The show ip interface command includes information about the helper addresses configured on an interface:
Router1#show ip interface Ethernet0 Ethernet0 is up, line protocol is up Internet address is 192.168.30.1/24 Broadcast address is 255.255.255.255 Address determined by setup command MTU is 1500 bytes Helper addresses are 172.25.1.3 172.25.1.1 Directed broadcast forwarding is disabled <lines removed for brevity> Router1#
Top |