Dhcp client configuration example, Network requirements, Configuration procedure – H3C Technologies H3C S10500 Series Switches User Manual
Page 79

68
DHCP client configuration example
Network requirements
As shown in
, on a LAN, Switch B contacts the DHCP server via VLAN-interface 2 to obtain an
IP address, DNS server address, and static route information. The IP address resides on network
10.1.1.0/24. The DNS server address is 20.1.1.1. The next hop of the static route to network 20.1.1.0/24
is 10.1.1.2.
The DHCP server uses Option 121 to assign static route information to DHCP clients. The destination
descriptor field comprises two parts, subnet mask length and destination network address. In this
example, the value of the destination descriptor field takes 18 14 01 01, a hexadecimal number
indicating that the subnet mask length is 24 and destination network address is 20.1.1.0. The value of the
next hop address field takes 0A 01 01 02, a hexadecimal number indicating that the next hop is 10.1.1.2.
Figure 32 Network diagram for DHCP client configuration
Configuration procedure
1.
Configure Switch A
# Specify the IP address of VLAN-interface 2.
<SwitchA> system-view
[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2] ip address 10.1.1.1 24
[SwitchA-Vlan-interface2] quit
# Enable the DHCP service.
[SwitchA] dhcp enable
# Exclude an IP address from automatic allocation.
[SwitchA] dhcp server forbidden-ip 10.1.1.2
# Configure DHCP address pool 0 and specify the subnet, lease duration, DNS server address, and a
static route to subnet 20.1.1.0/24.
[SwitchA] dhcp server ip-pool 0
[SwitchA-dhcp-pool-0] network 10.1.1.0 mask 255.255.255.0
[SwitchA-dhcp-pool-0] expired day 10
[SwitchA-dhcp-pool-0] dns-list 20.1.1.1
[SwitchA-dhcp-pool-0] option 121 hex 18 14 01 01 0A 01 01 02
2.
Configure Switch B
# Enable the DHCP client on VLAN-interface 2.
<SwitchB> system-view