
124
Assign IP addresses
To clients
10.10.1.2 to 10.10.1.10
The DHCP request contains Option 82.
10.10.1.11 to 10.10.1.26
The hardware address in the request is six bytes long and
begins with
aabb-aabb-aab
.
Router B assigns the DNS server address 10.10.1.20/24 and the gateway address 10.10.1.254/24 to
clients on subnet 10.10.1.0/24.
Figure 34 Network diagram
Procedure
1.
Specify IP addresses for the interfaces on the DHCP server. (Details not shown.)
2.
Configure DHCP:
# Enable DHCP and configure the DHCP server to handle Option 82.
<RouterB> system-view
[RouterB] dhcp enable
[RouterB] dhcp server relay information enable
# Enable the DHCP server on the interface GigabitEthernet1/0/1.
[RouterB] interface gigabitethernet 1/0/1
[RouterB-GigabitEthernet1/0/1] dhcp select server
[RouterB-GigabitEthernet1/0/1] quit
# Create DHCP user class
tt
and configure a match rule to match DHCP requests that contain
Option 82.
[RouterB] dhcp class tt
[RouterB-dhcp-class-tt] if-match rule 1 option 82
[RouterB-dhcp-class-tt] quit
# 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-aab
.
[RouterB] dhcp class ss
[RouterB-dhcp-class-ss] if-match rule 1 hardware-address aabb-aabb-aab0 mask
ffff-ffff-fff0
[RouterB-dhcp-class-ss] quit
# Create DHCP address pool
aa
.
[RouterB] dhcp server ip-pool aa
# Specify the subnet for dynamic allocation.
[RouterB-dhcp-pool-aa] network 10.10.1.0 mask 255.255.255.0