< Home

dhcp option template

Function

The dhcp option template command creates a DHCP Option template and enters the DHCP Option template view.

The undo dhcp option template command deletes a configured DHCP Option template.

By default, no DHCP Option template is created on the device.

Format

dhcp option template template-name

undo dhcp option template template-name

Parameters

Parameter

Description

Value

template-name

Specifies the name of the DHCP Option template.

The value is a string of 1 to 31 case-sensitive characters without spaces. The value can contain digits, letters, underscores (_), hyphens (-), and dots (.), but cannot be set to - or --.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command is used on a DHCP server. During network deployment, a DHCP server dynamically allocates IP addresses with leases to clients or allocates fixed IP addresses to some clients. For example, laptops or terminals are often moved to different places in enterprises, and they can obtain IP addresses using the dynamic allocation mode. However, IP addresses obtained dynamically are randomly allocated, and cannot be set to specified IP addresses. To allocate fixed IP addresses to some fixed terminals (such as IP phones), run the static-bind command in the global address view to bind IP addresses to MAC addresses of the clients so that the clients are allocated fixed IP addresses.

In some cases, you need to allocate other network configuration parameters except IP addresses to fixed static terminals. For example, besides obtaining an IP address, an IP phone needs information such as the startup configuration file to register normally. In this case, you can configure a DHCP Option template and configure network configuration parameters except the IP address required by the client in the DHCP Option template. Then bind the DHCP Option template to the fixed terminal in the global address pool. The DHCP server then allocates the IP address and other parameters to the terminal.

Precautions

Network parameters configured in the DHCP Option template view take effect only for static clients. A DHCP Option template can be bound to multiple clients. Run the static-bind ip-address ip-address mac-address mac-address [ option-template template-name ] command to configure a DHCP Option template that is bound to static clients.

Example

# Create a DHCP Option template named test.

<HUAWEI> system-view
[HUAWEI] dhcp option template test
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >