Before a device can function as a DHCP server, you must enable DHCP. You can then enable the DHCP server function to operate based on an interface address pool or based on a global address pool.
system-view
interface interface-type interface-number[.subinterface-number ]
Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731S-H, S5731-S, S5731S-S, S6720-HI, S5732-H, S6730-H, S6730S-H, S6730-S, S6730S-S, S6720-EI, and S6720S-EI support sub-interfaces.
The interface is switched to Layer 3 mode.
By default, an Ethernet interface works in Layer 2 mode.
Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support switching between Layer 2 and Layer 3 modes.
ip address ip-address { mask | mask-length }
dhcp select interface
By default, the DHCP server function using the interface address pool is disabled on an interface
If the device functioning as the DHCP server provides the DHCP service for clients connected to multiple interfaces, repeat this step to enable the DHCP server function on all the interfaces.
system-view
interface interface-type interface-number[.subinterface-number ]
Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731S-H, S5731-S, S5731S-S, S6720-HI, S5732-H, S6730-H, S6730S-H, S6730-S, S6730S-S, S6720-EI, and S6720S-EI support sub-interfaces.
The interface is switched to Layer 3 mode.
By default, an Ethernet interface works in Layer 2 mode.
Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support switching between Layer 2 and Layer 3 modes.
ip address ip-address { mask | mask-length }
ip address ip-address { mask | mask-length } sub
The device can select a global address pool based on the primary and secondary IP addresses of an interface only in scenarios where the DHCP server and DHCP clients are on the same network segment.
When clients connected to the interface configured with an IP address request IP addresses:
dhcp select global
By default, an interface does not use the global address pool to provide the DHCP server function.