DHCP
H3C Low-End Ethernet Switches Configuration Examples
Chapter 2 Configuration Examples
2-11
Switch(dhcp-class)# exit
# Configure a DHCP class for the client connected to Etherent1/0/12 of the DHCP
snooping device and match the port number in the Circuit ID suboption of Option82.
Switch(config)# ip dhcp class office2
Switch(dhcp-class)# relay agent information hex 010600040001000b*
# Create an address pool for Office and specify address ranges for the two DHCP
classes.
Switch(config)# ip dhcp pool office
Switch(dhcp-pool)# network 192.168.10.0
Switch(dhcp-pool)# class office1
Switch(dhcp-pool-class)# address range 192.168.10.2 192.168.10.25
Switch(dhcp-pool-class)# exit
Switch(dhcp-pool)# class office2
Switch(dhcp-pool-class)# address range 192.168.10.100 192.168.10.150
Switch(dhcp-pool-class)# exit
# Configure the lease period, gateway address, DNS server address, and WINS server
address for the address pool.
Switch(dhcp-pool)# lease 0 12
Switch(dhcp-pool)# default-router 192.168.10.1
Switch(dhcp-pool)# dns-server 192.168.100.2
Switch(dhcp-pool)# netbios-name-server 192.168.100.3
After the above-mentioned configuration, the DHCP server can automatically assign an
IP address, the gateway address, DNS server address, and the WINS server address
for each device in Office.
2.3 Precautions
2.3.1 Cooperation Between DHCP Relay Agent and IRF
z
In an IRF network, the DHCP relay agent runs on all the units in the Fabric. But
only the DHCP relay agent running on the master unit can receive and send
packets to perform full DHCP relay agent functions. The DHCP relay agent
running on a slave unit, however, only serves as a backup for the master unit.
z
DHCP is an application-layer protocol based on UDP. Once a slave unit receives a
DHCP request, UDP-Helper redirects the packet to the master unit. Then, the
DHCP relay agent running on the master unit gives a response back to the request
and sends the real time information to each slave unit for backup. In this way,
when the current master unit fails, one of the slaves becomes the new master and
operates as the DHCP relay agent immediately. Therefore, make sure you enable
UDP-Helper before using DHCP relay agent in an IRF system.