Verifying the configuration, Dhcp user class configuration example, Network requirement – H3C Technologies H3C S5560 Series Switches User Manual
Page 64

49
[SwitchA] interface vlan-interface 20
[SwitchA-Vlan-interface20] dhcp select server
[SwitchA-Vlan-interface20] quit
# Exclude IP addresses (addresses of the DNS server, WINS server and gateways).
[SwitchA] dhcp server forbidden-ip 10.1.1.2
[SwitchA] dhcp server forbidden-ip 10.1.1.4
[SwitchA] dhcp server forbidden-ip 10.1.1.126
[SwitchA] dhcp server forbidden-ip 10.1.1.254
# Configure DHCP address pool 1 to assign IP addresses and other configuration parameters to
clients in subnet 10.1.1.0/25.
[SwitchA] dhcp server ip-pool 1
[SwitchA-dhcp-pool-1] network 10.1.1.0 mask 255.255.255.128
[SwitchA-dhcp-pool-1] expired day 10 hour 12
[SwitchA-dhcp-pool-1] domain-name aabbcc.com
[SwitchA-dhcp-pool-1] dns-list 10.1.1.2
[SwitchA-dhcp-pool-1] gateway-list 10.1.1.126
[SwitchA-dhcp-pool-1] nbns-list 10.1.1.4
[SwitchA-dhcp-pool-1] quit
# Configure DHCP address pool 2 to assign IP addresses and other configuration parameters to
clients in subnet 10.1.1.128/25.
[SwitchA] dhcp server ip-pool 2
[SwitchA-dhcp-pool-2] network 10.1.1.128 mask 255.255.255.128
[SwitchA-dhcp-pool-2] expired day 5
[SwitchA-dhcp-pool-2] domain-name aabbcc.com
[SwitchA-dhcp-pool-2] dns-list 10.1.1.2
[SwitchA-dhcp-pool-2] gateway-list 10.1.1.254
Verifying the configuration
# Verify that clients on subnets 10.1.1.0/25 and 10.1.1.128/25 can obtain correct IP addresses and all
other network parameters from Switch A. (Details not shown.)
# On the DHCP server, display the IP addresses assigned to the clients.
[SwitchA] display dhcp server ip-in-use
DHCP user class configuration example
Network requirement
As shown in
, the DHCP relay agent (Switch A) forwards the packets from DHCP clients to the
DHCP server. Enable switch A to support Option 82 so that switch A can add Option 82 in the DHCP
requests sent by the DHCP clients.
The DHCP server (Switch B) assigns IP addresses and other configuration parameters to the DHCP clients.
If the DHCP requests the DHCP server receives contain Option 82, the server assigns IP addresses in the
range of 10.10.1.2 to 10.10.1.10 to the clients.
For clients in subnet 10.10.1.0/24, the DNS server address is 10.10.1.20/24 and the gateway address is
10.10.1.254/24.