The traditional role of routers in DHCP has been simply to act as a proxy device.DHCP proxy function is still the most common for routers.
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 was not able to function as a proxy for these broadcasts, it would be necessary to put a DHCP server on every network segment.
The DHCP server needs two c
IP Helper Configuration Example:
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface Ethernet0
Router1(config-if)#ip helper-address 192.20.1.1
Router1(config-if)#ip helper-address 192.20.10.7
Router1(config-if)#exit
Router1(config)#end
Router1#
NB: 192.20.1.1 and 192.20.10.7 is DHCP server IP Address
ritical pieces of information before it can allocate an IP address to the client.
1) It must know the subnet that the client is connected to. The subnet information is needed to ensure that the address that the server allocates will actually work on client’s network segment.
2) It needs the client device’s MAC address. MAC address is necessary so that the server can find any information that is unique to this workstation. This is particularly true if you need to ensure that the end device always 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 uses the all-zeroes address, 0.0.0.0, as the IP source address. It uses a general broadcast address,255.255.255.255, for the destination.
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.
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 192.20.1.1
192.20.10.7
Directed broadcast forwarding is disabled
<removed for brevity>
Router1#