59
# Specify the gateway address and the DNS server address.
[SwitchB-dhcp-pool-aa] gateway-list 10.10.1.254
[SwitchB-dhcp-pool-aa] dns-list 10.10.1.20
[SwitchB-dhcp-pool-aa] quit
# Enable DHCP and configure the DHCP server to handle Option 82.
[SwitchB] dhcp enable
[SwitchB] dhcp server relay information enable
# Enable DHCP server on VLAN-interface10.
[SwitchB] interface vlan-interface 10
[SwitchB-Vlan-interface10] dhcp select server
[SwitchB-Vlan-interface10] quit
Verifying the configuration
# Verify that clients matching the user classes can obtain IP addresses in the specified ranges and all
other configuration parameters from the DHCP server. (Details not shown.)
# Display the IP address assigned by the DHCP server.
[SwitchB] display dhcp server ip-in-use
IP address Client identifier/ Lease expiration Type
Hardware address
10.10.1.2 0031-3865-392e-6262- Jan 14 22:25:03 2015 Auto(C)
3363-2e30-3230-352d-
4745-302f-30
10.10.1.11 aabb-aabb-aab1 Jan 14 22:25:03 2015 Auto(C)
Example: Configuring DHCP user class whitelist
Network configuration
As shown in Figure 20, configure the DHCP user class whitelist to allow the DHCP server to assign
IP addresses to clients whose hardware addresses are six bytes long and begin with aabb-aabb.
Figure 20 Network diagram
Procedure
1. Specify IP addresses for the interfaces on the DHCP server. (Details not shown.)
2. Configure DHCP:
# Create DHCP user class ss and configure a match rule to match DHCP requests in which the
hardware address is six bytes long and begins with aabb-aabb.
<SwitchB> system-view
[SwitchB] dhcp class ss
[SwitchB-dhcp-class-ss] if-match rule 1 hardware-address aabb-aabb-0000 mask
ffff-ffff-0000
[SwitchB-dhcp-class-ss] quit
# Create DHCP address pool aa.
[SwitchB] dhcp server ip-pool aa
# Specify the subnet for dynamic allocation.