Configuring a DHCP Server
- Enabling DHCP
- Enabling the DHCP Server Function
- (Optional) Configuring DHCP Data Restoration
- (Optional) Configuring IP Address Conflict Detection
- (Optional) Configuring a DHCP Server to Dynamically Allocate IP Addresses to BOOTP Clients
- (Optional) Configuring the Abnormal Packet Detection Function
- (Optional) Forcing a DHCP Server to Reply with a DHCP NAK Message
- Configuring an Address Pool
- Creating an Address Pool
- (Optional) Configuring the Range of IP Addresses in an Address Pool
- (Optional) Excluding IP Addresses from an Address Pool
- (Optional) Configuring Fixed IP Addresses in an Address Pool
- (Optional) Configuring an Address Lease Time
- (Optional) Configuring Automatic Reclaim of Conflicting IP Addresses in an Address Pool
- (Optional) Configuring the Alarm Function for IP Address Exhaustion
- (Optional) Configuring the Logging Function for IP Address Allocation
- (Optional) Configuring a Gateway Address for Clients
- (Optional) Configuring a Configuration File for a DHCP Client
- (Optional) Configuring User-defined Options
- (Optional) Configuring DNS Configurations Allocated by a DHCP Server
- (Optional) Configuring NetBIOS Configurations Allocated by a DHCP Server
- (Optional) Configuring a SIP Server Address to Be Allocated by the DHCP Server
- Verifying the DHCP Server Configuration
Enabling DHCP
Context
Before enabling the DHCP server function, enable DHCP in the system view.
The dhcp enable command is the prerequisite for configuring DHCP-related functions, including DHCP relay, DHCP snooping, and DHCP server. These functions take effect only after the dhcp enable command is run. After the undo dhcp enable command is run, all DHCP-related configurations of the device are deleted. After DHCP is enabled again using the dhcp enable command, all DHCP-related configurations of the device are restored to the default configurations.
After DHCP is enabled, if STP is also enabled, address allocation may slow down. By default, STP is enabled. To disable STP, run the undo stp enable command.
Procedure
- Enter the system view.
system-view
- Enable DHCP.
dhcp enable
By default, DHCP is disabled.
- (Optional) Enable dynamic route limiting on DHCP messages.
dhcp speed-limit auto
By default, dynamic rate limiting is disabled on DHCP messages.
- (Optional) Enable the DHCP broadcast suppression function.
dhcp broadcast suppress enable
By default, the DHCP broadcast suppression function is disabled.
Enabling the DHCP Server Function
(Optional) Configuring DHCP Data Restoration
Context
Automatically saving IP address allocation information allows the DHCP server to re-allocate the same configurations (such as IP address and lease time) to clients in the event that the server unexpectedly restarts.
After this function is enabled, the DHCP server stores lease information in lease.txt and conflicting IP addresses in conflict.txt (both data files are saved to the DHCP folder). New data files overwrite earlier data files.
The time displayed in the lease.txt and conflict.txt files is the UTC time rather than the system time, and you do not need to pay attention to time zone information.
To view information about the DHCP database, run the display dhcp server database command.
- During the interval, if the device installed with MCUD, SRUHX1 or SRUHA1 restarts unexpectedly, DHCP data generated at the interval are lost. Users can only recover the last successfully saved DHCP data from storage device files.
Procedure
- Enter the system view.
system-view
- Enable the DHCP server to automatically save IP address allocation information.
dhcp server database enable
By default, the DHCP server does not automatically save IP address allocation information.
- Specify the interval at which the DHCP server saves IP address allocation information.
dhcp server database write-delay interval
By default, IP address allocation information is saved every 7200 seconds in data files. The new data files overwrite the earlier data files.
- Enable the DHCP server to recover IP address allocation information from the data files upon a restart.
dhcp server database recover
By default, the DHCP server is disabled from recovering IP address allocation information from the data files upon a restart.
(Optional) Configuring IP Address Conflict Detection
Context
IP address conflict detection uses ICMP to determine whether an IP address to be allocated conflicts with other IP addresses that are already allocated to clients. After this function is configured, a DHCP server sends an ICMP Echo Request message in which the source address is the IP address of the DHCP server and the destination address is the pre-allocated IP address for IP address conflict detection, before sending a DHCP Offer message to a client.
- If the DHCP server does not receive any ICMP Echo Reply message within the detection period (Number of detections x Maximum wait time for each conflict detection), this IP address is not used by any client. The DHCP server allocates the IP address to the client by sending a DHCP Offer message.
- If the DHCP server receives an ICMP Echo Reply message within the detection period (Number of detections x Maximum wait time for each conflict detection), this IP address is being used by a client. The DHCP server lists this IP address as a conflicting IP address and waits for the next DHCP Discover message to select another available IP address.
If the detection time is too long, clients may fail to obtain IP addresses. You are advised to set the detection time to less than 8 seconds.
Procedure
- Enter the system view.
system-view
- Specify the number of IP address conflict detections before IP address allocation.
dhcp server ping packet number
By default, the number of IP address conflict detections before IP address allocation is 2.
- Specify the maximum wait time for each conflict detection.
dhcp server ping timeout milliseconds
By default, the maximum wait time for each conflict detection is 500 milliseconds.
(Optional) Configuring a DHCP Server to Dynamically Allocate IP Addresses to BOOTP Clients
Context
If you have BOOTP clients on your network and you want them to dynamically obtain IP addresses through DHCP, configure the DHCP server to service these clients.
Procedure
- Enter the system view.
system-view
- Enable the DHCP server to respond to BOOTP requests.
dhcp server bootp
By default, a DHCP server does not respond to BOOTP requests.
- Enable the DHCP server to dynamically allocate IP addresses
to BOOTP clients.
dhcp server bootp automatic
By default, a DHCP server does not dynamically allocate IP addresses to BOOTP clients.
(Optional) Configuring the Abnormal Packet Detection Function
Context
Devices from different vendors may use different DHCP implementation mechanisms. After detecting that the UDP header checksum or magic cookie field in a received DHCP packet fails the check, a device may not allow the DHCP packet to pass through and discards the packet. As a result, DHCP becomes unavailable. In this case, you can configure the device not to check the UDP header checksum or magic cookie field in received DHCP packets, so that DHCP packets with an incorrect UDP header checksum or incorrect value of the magic cookie field can still be properly forwarded.
According to the protocol, if the UDP header checksum is 0, the peer device does not verify the checksum in DHCP packets. If the peer device does not comply with the protocol, the peer device still verifies the checksum even if the UDP header checksum in DHCP packets sent by the local device is 0. In this case, you need to configure the local device to add the UDP header checksum to DHCP packets to be sent, so that the locally sourced DHCP packets can pass the checksum verification of the peer device.
- A device, functioning as a DHCP server, DHCP relay agent, DHCP client, or DHCP snooping-enabled device, can be configured not to check the UDP header checksum or magic cookie field in received DHCP packets.
- Only a device functioning as a DHCP server can be configured to add the UDP header checksum to DHCP packets to be sent.
- After DHCP is enabled on a device, the device checks the IP header checksum and UDP header checksum in received DHCP packets by default. In addition, the function of checking the IP header checksum cannot be disabled.
(Optional) Forcing a DHCP Server to Reply with a DHCP NAK Message
Context
When a DHCP client goes online in two steps, the IP address requested by the DHCP client is in the IP address pool, but no lease record of the DHCP client is found in the address pool. For example, after obtaining an IP address from another DHCP server, a wireless user roams to the current DHCP server and the original IP address is in the address pool of the current DHCP server. Alternatively, the address pool is reset and the original user needs to go online again. In this case, when receiving a DHCP Request message from the DHCP client, the DHCP server keeps silent and does not reply the DHCP client with a DHCP NAK message. The DHCP client can apply for an IP address to go online again in four steps only after the two steps for the client to go online time out. As a result, the DHCP client is slow in obtaining an IP address. To force the DHCP server to reply with a DHCP NAK message, you can run the dhcp server force response command, so that the DHCP client can quickly enter the four-step process for going online and apply for an IP address again.
Configuring an Address Pool
Creating an Address Pool
Context
Create an interface address pool for IP address allocation to clients on the same network segment as the DHCP server's interface, or create a global address pool for IP address allocation to all clients connected to the DHCP server.
After an address pool is created, the following IP addresses on the network segment cannot be automatically assigned:
- Network address (with host bits of all 0s)
- Broadcast address (with host bits of all 1s)
- Gateway address for DHCP clients (configured in (Optional) Configuring a Gateway Address for Clients)
(Optional) Excluding IP Addresses from an Address Pool
Context
To prevent a DHCP server from allocating specific IP addresses, exclude these IP addresses from the address pool.
You do not need to exclude the gateway address configured using the gateway-list or dhcp server gateway-list command from being automatically allocated. The device automatically adds the gateway address into the list of IP addresses that cannot be automatically allocated.
You do not need to exclude the IP address of a server's interface connecting to a client from being automatically allocated. The device automatically sets the interface IP address to the Conflict status during address allocation.
Procedure
- Exclude IP addresses from an interface address pool.
- Exclude IP addresses from a global address pool.
Follow-up Procedure
If you want to add more ranges of IP addresses that cannot be automatically allocated from the address pool, run the dhcp server excluded-ip-address or excluded-ip-address command for multiple times. If you want to delete some configured ranges of IP addresses that cannot be automatically allocated from the address pool, run the undo dhcp server excluded-ip-address or undo excluded-ip-address command.
<HUAWEI> system-view [HUAWEI] ip pool global1 [HUAWEI-ip-pool-global1] network 10.10.10.0 mask 24 [HUAWEI-ip-pool-global1] excluded-ip-address 10.10.10.10 10.10.10.30 [HUAWEI-ip-pool-global1] quit
- If you want to exclude IP addresses in the range from 10.10.10.10 to 10.10.10.40 from the global address pool, run the following commands:
[HUAWEI] ip pool global1 [HUAWEI-ip-pool-global1] excluded-ip-address 10.10.10.10 10.10.10.40 [HUAWEI-ip-pool-global1] quit
- If you want to exclude IP addresses only in the range from 10.10.10.15 to 10.10.10.20 from the global address pool, run the following commands:
[HUAWEI] ip pool global1 [HUAWEI-ip-pool-global1] undo excluded-ip-address 10.10.10.10 10.10.10.14 [HUAWEI-ip-pool-global1] undo excluded-ip-address 10.10.10.21 10.10.10.30 [HUAWEI-ip-pool-global1] quit
(Optional) Configuring Fixed IP Addresses in an Address Pool
Context
A DHCP server leases IP addresses to clients. When the lease expires, the clients must apply for new IP addresses. To ensure stability, certain clients require fixed IP addresses. In this case, configure the DHCP server to allocate fixed IP addresses to these clients. The MAC addresses of these clients are then bound to fixed IP addresses. When such a client applies to the DHCP server for an IP address, the DHCP server searches the binding entries for the MAC address of the client and allocates the matched IP address to the client. DHCP static allocation prevents manual configuration errors and facilitates unified management.
- Ensure that the bound IP address is not configured as the IP address that cannot be allocated.
- IP addresses that are used can also be statically bound to MAC addresses or unbound from MAC addresses. When an IP address is statically bound to a MAC address, ensure that the MAC address to be bound is the same as the MAC address of the user who actually uses the IP address.
- After an IP address is bound to a MAC address, the IP address does not expire. After an automatically allocated IP address is statically bound to a MAC address, the lease time of the IP address becomes unlimited. After the static binding between the IP address and the MAC address is deleted, the lease time of the IP address becomes the same as that configured in the address pool.
Function |
Scenario |
Implementation |
---|---|---|
DHCP static allocation |
Some clients (such as servers and PCs) require fixed IP addresses from a DHCP server. |
The MAC addresses of these clients are bound to fixed IP addresses. When such a client applies to the DHCP server for an IP address, the DHCP server searches the binding entries for the MAC address of the client and allocates the matched IP address to the client. |
IPSG |
Attacks including IP address spoofing and ARP spoofing need to be prevented:
|
The mapping between IP addresses and MAC addresses is set up on a device. When receiving an ARP Request packet, the device searches for the mapped MAC address based on the source IP address of the packet and compares the mapped MAC address with the source MAC address in the packet header. If the two MAC addresses are different from each other, the device considers the packet invalid and discards it. |
Static ARP |
The mapping between IP addresses and MAC addresses is manually configured in the following scenarios:
|
The mapping between IP addresses and MAC addresses is set up on a device. When receiving an ARP Request packet, the device searches for the MAC address mapped to the IP address in the packet and responds with an ARP Reply packet. Static ARP entries are manually configured and maintained. These entries are neither aged nor overwritten by dynamic ARP entries, and therefore improve communication security. |
(Optional) Configuring an Address Lease Time
Context
The default lease time in an address pool is 1 day. An administrator can change an address lease time based on network requirements. IP addresses in the same address pool use the same lease time, and different address pools can have different address leases specified. After the lease of an address pool is changed, newly allocated IP addresses use the new lease. The IP addresses that have been allocated before the lease is changed still use the old lease before the old lease is updated and use the new lease after the old lease is updated.
BOOTP clients do not support Option 51 (the IP address lease option). The lease of IP addresses allocated to BOOTP clients is unlimited, and these IP addresses will not be reclaimed by DHCP servers.
The IP addresses statically allocated to clients are always valid, without being limited by address lease time.
(Optional) Configuring Automatic Reclaim of Conflicting IP Addresses in an Address Pool
Context
When a DHCP server allocates IP addresses to clients, IP address conflict may occur because IP addresses of some hosts have been manually configured. In this case, the DHCP server considers these IP addresses as conflicting IP addresses, and allocates available IP addresses from the conflicting IP addresses to clients only after available IP addresses in the address pool are used up. To reclaim conflicting IP addresses promptly, the administrator can enable automatic reclaim and specify the reclaim interval.
(Optional) Configuring the Logging Function for IP Address Allocation
Context
Configuring the DHCP server to log IP address allocation provides you with records that may facilitate maintenance and diagnostics.
- With this logging function enabled, if a large number of DHCP clients request IP addresses from the DHCP server, the server frequently records logs. The server performance may therefore be affected.
- IP address allocation logs are recorded in the AM module. To view log information, the information center must be enabled. In addition, default settings for log output vary depending on various factors including the log level and output direction. For details, see Information Center Configuration in the CLI-based Configuration - Device Management Configuration Guide.
For example, the level of logs indicating that an IP address is successfully allocated, an IP address is successfully renewed, and an IP address is successfully released is informational, and these logs are not recorded in the log buffer by default. You can run the info-center source AM channel 4 log level informational command to change the level of the logs to be recorded in the log buffer. You can then run the display logbuffer command to check the preceding logs.
(Optional) Configuring a Gateway Address for Clients
Context
If a gateway address for clients is configured on the DHCP server, clients obtain the gateway address from the DHCP server and automatically generate a default route to the gateway address. Then the clients can access the hosts on other network segments. If the DHCP server is configured with Option 121 to allocate classless static routes to clients, the clients generate routes based on only the static routes and does not generate a default route to the gateway address. To load balance traffic and improve network reliability, configure multiple gateway addresses. A maximum of eight gateway addresses can be configured for each address pool.
In the scenario where both VRRP and DHCP are configured, if a VRRP group functions as the DHCP server, configure the gateway address of clients as the virtual IP address of the VRRP group.
If the DHCP server and clients are on the same network segment and the DHCP server functions as the gateway of clients, you do not need to configure a gateway address for clients.
Procedure
- Configure a gateway address in the interface address pool view.
- Configure a gateway address in the global address pool view.
- Configure a gateway address in the DHCP Option template view.
Enter the system view.
system-view
Create a DHCP Option template and enter the DHCP Option template view.
dhcp option template template-name
By default, no DHCP Option template is created.
To allocate network parameters except IP addresses to static clients, configure a DHCP Option template. Network parameters configured in the DHCP Option template view take effect only for static clients. For static clients, if a network parameter is configured in both the DHCP Option template view and global address pool view, only the configuration in the DHCP Option template view takes effect.
To allocate only IP addresses to static clients (for details, see (Optional) Configuring Fixed IP Addresses in an Address Pool), you do not need to configure a DHCP Option template.
Specify a gateway address that the DHCP server sends to clients.
gateway-list ip-address &<1-8>
By default, no egress gateway address is configured.
If you need to configure other items in the DHCP Option template view, complete them first before performing the following steps.
- (Optional) Return to the system view.
quit
- (Optional) Enter the global address pool view.
ip pool ip-pool-name
- (Optional) Bind a DHCP Option
template to static clients.
static-bind ip-address ip-address mac-address mac-address option-template template-name
(Optional) Configuring a Configuration File for a DHCP Client
Context
DHCP can be used to deliver configuration files to clients that require them for startup. You can save the configuration files on the DHCP server or specify the IP address of a dedicated file server. When a configuration file exists on a dedicated file server, the DHCP server needs to specify the IP address of the file server for clients. You can also specify an IP address for the file server by configuring user-defined options for clients.
If the startup configuration file is saved on a file server, the route between the DHCP client and file server must be reachable.
Procedure
- Configure a configuration file based on an interface address pool.
- Configure a configuration file based on a global address pool.
Enter the system view.
system-view
Enter the global address pool view.
ip pool ip-pool-name
Specify the name of the configuration file.
bootfile bootfile
By default, the name is not configured.
Specify the name of the server that hosts the configuration file.
sname sname
By default, the name of the server is not configured.
Specify the IP address of the file server that hosts the configuration file.
next-server ip-address
By default, the file server IP address is not configured.
- In the DHCP Option template view:
Enter the system view.
system-view
Create a DHCP Option template and enter the DHCP Option template view.
dhcp option template template-name
By default, no DHCP Option template is created.
To allocate network parameters except IP addresses to static clients, configure a DHCP Option template. Network parameters configured in the DHCP Option template view take effect only for static clients. For static clients, if a network parameter is configured in both the DHCP Option template view and global address pool view, only the configuration in the DHCP Option template view takes effect.
To allocate only IP addresses to static clients (for details, see (Optional) Configuring Fixed IP Addresses in an Address Pool), you do not need to configure a DHCP Option template.
Specify the name of the configuration file.
bootfile bootfile
By default, the name of the startup configuration file for DHCP clients is not configured.
Specify the name of the server that hosts the configuration file.
sname sname
By default, the name of the server from which a DHCP client obtains the startup configuration file is not configured.
(Optional) Specify the name of the server that hosts the configuration file.
next-server ip-address
By default, the server IP address is not configured for the client after the client automatically obtains the IP address.
If you need to configure other items in the DHCP Option template view, complete them first before performing the following steps.
- (Optional) Return to the system view.
quit
- (Optional) Enter the global address pool view.
ip pool ip-pool-name
- (Optional) Bind a DHCP Option
template to static clients.
static-bind ip-address ip-address mac-address mac-address option-template template-name
(Optional) Configuring User-defined Options
Context
- Based on the options in DHCP Discovery messages
The device inserts an option configured using the dhcp server option (based on an interface address pool) or option (based on a global address pool) command into DHCP Reply messages to be sent to a client only when the client requests this option.
- By forcibly appending the option field
The device inserts an option configured using the dhcp server force insert option (based on an interface address pool) or force insert option (based on a global address pool) command into DHCP Reply messages to be sent to a client regardless of whether the client requests this option.
Procedure
- Configure user-defined options based on an interface address pool.
- Configure user-defined options based on a global address pool.
In the global address pool view:
- Enter the system view.
system-view
(Optional) Enable the DHCP server to trust Option 82.
dhcp server trust option82
By default, the device is enabled to trust Option 82.
- Enter the global address pool view.
ip pool ip-pool-name
(Optional) Force the DHCP server to insert a specified option field into DHCP Reply messages.
force insert option code &<1-254>
By default, the DHCP server does not forcibly insert a specified option field into DHCP Reply messages.
Configure user-defined options.
option code [ sub-option sub-code ] { ascii ascii-string | hex hex-string | cipher cipher-string | ip-address ip-address &<1-8> }
By default, no user-defined option is configured.
If an option carries a password, the option code in ascii or hex type is insecure. Therefore, you are advised to set the option code type to cipher. For security purposes, use a password that is at least six characters long and contains at least two types of the following: lowercase letters, uppercase letters, digits, and special characters.
Not all options can be configured using the preceding command. The following table lists the options and their commands.Table 3-9 Commands for configuring optionsOption
Configuration Command
Description
Option1
mask-length in the network (IP address pool view) ip-address [ mask { mask | mask-length } ]
Subnet mask
Option3
gateway-list ip-address &<1-8>
Gateway address
Option6
dns-list ip-address &<1-8>
DNS server IP address
Option15
domain-name domain-name
Domain name suffix
Option44
nbns-list ip-address &<1-8>
NetBIOS server IP address
Option46
netbios-type { b-node | h-node | m-node | p-node }
NetBIOS node type
Option50
N/A
Requested IP address
Option51
lease { day day [ hour hour [ minute minute ] ] | unlimited }
IP address lease
Option52
N/A
Additional option
Option53
N/A
DHCP message type
Option54
N/A
Server identifier
Option55
N/A
Parameter request list
Option57
N/A
Maximum length of a DHCP message
Option58
N/A
Lease renewal time (T1), which is 50% of the lease time
Option59
N/A
Lease renewal time (T2), which is 87.5% of the lease time
Option61
N/A
Client identifier
Option82
N/A
Relay agent information
Option120
sip-server { ip-address ip-address &<1-2> | list domain-name &<1-2> }
SIP server IP address
Option121
option121 ip-address { ip-address mask-length gateway-address } &<1-8>
A group of classless routes
Option184
option184 { as-ip ip-address | fail-over ip-address dialer-string | ncp-ip ip-address | voice-vlan vlan-id }
Voice parameters
- Enter the system view.
In the DHCP Option template view:
- Enter the system view.
system-view
Create a DHCP Option template and enter the DHCP Option template view.
dhcp option template template-name
By default, no DHCP Option template is created.
To allocate network parameters except IP addresses to static clients, configure a DHCP Option template. Network parameters configured in the DHCP Option template view take effect only for static clients. For static clients, if a network parameter is configured in both the DHCP Option template view and global address pool view, only the configuration in the DHCP Option template view takes effect.
To allocate only IP addresses to static clients (for details, see (Optional) Configuring Fixed IP Addresses in an Address Pool), you do not need to configure a DHCP Option template.
(Optional) Force the DHCP server to insert a specified option field into DHCP Reply messages.
force insert option code &<1-254>
By default, the DHCP server does not forcibly insert a specified option field into DHCP Reply messages.
Configure user-defined options.
option code [ sub-option sub-code ] { ascii ascii-string | hex hex-string | cipher cipher-string | ip-address ip-address &<1-8> }
By default, no user-defined option is configured.
If an option carries a password, the option code in ascii or hex type is insecure. Therefore, you are advised to set the option code type to cipher. For security purposes, use a password that is at least six characters long and contains at least two types of the following: lowercase letters, uppercase letters, digits, and special characters.
Not all options can be configured using the preceding command. See Table 3-9 for the list of options and their commands.
Configure a classless static route to be allocated to clients.
option121 ip-address { ip-address mask-length gateway-address } &<1-8>
By default, no classless static route to be allocated to DHCP clients is configured.
Configure Option 184.
option184 { as-ip ip-address | fail-over ip-address dialer-string | ncp-ip ip-address | voice-vlan vlan-id }
By default, the Option 184 field is not configured.
If you need to configure other items in the DHCP Option template view, complete them first before performing the following steps.
- (Optional) Return to the system view.
quit
- (Optional) Enter the global address pool view.
ip pool ip-pool-name
- (Optional) Bind a DHCP Option
template to static clients.
static-bind ip-address ip-address mac-address mac-address option-template template-name
- Enter the system view.
(Optional) Configuring DNS Configurations Allocated by a DHCP Server
Context
If DHCP clients on your network use DNS and you want them to receive DNS configurations through DHCP, configure the DHCP server to provide DNS configurations.
Procedure
- Based on an interface address pool
- Based on a global address pool in the global address pool
view
- In the DHCP Option template
view
- Enter the system view.
system-view
Create a DHCP Option template and enter the DHCP Option template view.
dhcp option template template-name
By default, no DHCP Option template is created.
To allocate network parameters except IP addresses to static clients, configure a DHCP Option template. Network parameters configured in the DHCP Option template view take effect only for static clients. For static clients, if a network parameter is configured in both the DHCP Option template view and global address pool view, only the configuration in the DHCP Option template view takes effect.
To allocate only IP addresses to static clients (for details, see (Optional) Configuring Fixed IP Addresses in an Address Pool), you do not need to configure a DHCP Option template.
- Configure the DNS server IP address and DNS domain name suffix to be allocated to DHCP clients.
Configure the DNS server IP address to be allocated to DHCP clients.
dns-list ip-address &<1-8>
By default, no DNS server IP address is configured.
Each address pool can be configured with a maximum of eight DNS server IP addresses.
Configure the DNS domain name suffix to be allocated to DHCP clients.
domain-name domain-name
By default, no DNS domain name suffix is configured.
If you need to configure other items in the DHCP Option template view, complete them first before performing the following steps.
- (Optional) Return to the system view.
quit
- (Optional) Enter the global address pool view.
ip pool ip-pool-name
- (Optional) Bind a DHCP Option
template to static clients.
static-bind ip-address ip-address mac-address mac-address option-template template-name
- Enter the system view.
(Optional) Configuring NetBIOS Configurations Allocated by a DHCP Server
Context
If DHCP clients on your network use NetBIOS and you want them to receive NetBIOS configurations through DHCP, configure the DHCP server to provide NetBIOS configurations.
Procedure
- Based on an interface address pool
- Based on a global address pool in the global address pool view
- In the DHCP Option template view
- Enter the system view.
system-view
Create a DHCP Option template and enter the DHCP Option template view.
dhcp option template template-name
By default, no DHCP Option template is created.
To allocate network parameters except IP addresses to static clients, configure a DHCP Option template. Network parameters configured in the DHCP Option template view take effect only for static clients. For static clients, if a network parameter is configured in both the DHCP Option template view and global address pool view, only the configuration in the DHCP Option template view takes effect.
To allocate only IP addresses to static clients (for details, see (Optional) Configuring Fixed IP Addresses in an Address Pool), you do not need to configure a DHCP Option template.
- Configure the NetBIOS server IP address and NetBIOS node type to be allocated to DHCP clients.
Configure the NetBIOS server IP address to be allocated to DHCP clients.
nbns-list ip-address &<1-8>
By default, no NetBIOS server IP address is configured.
Each address pool can be configured with a maximum of eight NetBIOS server IP addresses.
Configure a NetBIOS node type to be allocated to DHCP clients.
netbios-type { b-node | h-node | m-node | p-node }
By default, no NetBIOS node type is configured.
If you need to configure other items in the DHCP Option template view, complete them first before performing the following steps.
- (Optional) Return to the system view.
quit
- (Optional) Enter the global address pool view.
ip pool ip-pool-name
- (Optional) Bind a DHCP Option
template to static clients.
static-bind ip-address ip-address mac-address mac-address option-template template-name
- Enter the system view.
(Optional) Configuring a SIP Server Address to Be Allocated by the DHCP Server
Context
When you configure a SIP server IP address in an address pool, the DHCP server specifies the SIP server IP address when allocating IP addresses to DHCP clients.
Procedure
- Configure a SIP server address in an interface address pool.
- Configure a SIP server address in a global address pool.
- Configure a SIP server address in the DHCP Option template view.
- Enter the system view.
system-view
Create a DHCP Option template and enter the DHCP Option template view.
dhcp option template template-name
By default, no DHCP Option template is created.
To allocate network parameters except IP addresses to static clients, configure a DHCP Option template. Network parameters configured in the DHCP Option template view take effect only for static clients. For static clients, if a network parameter is configured in both the DHCP Option template view and global address pool view, only the configuration in the DHCP Option template view takes effect.
To allocate only IP addresses to static clients (for details, see (Optional) Configuring Fixed IP Addresses in an Address Pool), you do not need to configure a DHCP Option template.
Configure the SIP server IP address to be allocated to DHCP clients.
sip-server { ip-address ip-address &<1-2> | list domain-name &<1-2> }
By default, no SIP server IP address is configured in the DHCP Option template view.
If you need to configure other items in the DHCP Option template view, complete them first before performing the following steps.
- (Optional) Return to the system view.
quit
- (Optional) Enter the global address pool view.
ip pool ip-pool-name
- (Optional) Bind a DHCP Option
template to static clients.
static-bind ip-address ip-address mac-address mac-address option-template template-name
- Enter the system view.
Verifying the DHCP Server Configuration
Procedure
- Check IP address allocation information in address pools using the following commands:
Interface address pool:
display ip pool [ interface interface-pool-name [ start-ip-address [ end-ip-address ] | all | conflict | expired | used ] ]
Global address pool:
display ip pool [ name ip-pool-name [ start-ip-address [ end-ip-address ] | all | conflict | expired | used [ user-type { dhcp | pppoe | l2tp | ipsec | ssl-vpn | ppp } ] ] ]
- Run the display dhcp server database command to view the path for storing the DHCP database.
- Run the display dhcp option template [ name template-name ] command to view the configuration of a DHCP Option template.
- Run the display dhcp server configuration command to check configurations about the DHCP server.
- Enabling DHCP
- Enabling the DHCP Server Function
- (Optional) Configuring DHCP Data Restoration
- (Optional) Configuring IP Address Conflict Detection
- (Optional) Configuring a DHCP Server to Dynamically Allocate IP Addresses to BOOTP Clients
- (Optional) Configuring the Abnormal Packet Detection Function
- (Optional) Forcing a DHCP Server to Reply with a DHCP NAK Message
- Configuring an Address Pool
- Creating an Address Pool
- (Optional) Configuring the Range of IP Addresses in an Address Pool
- (Optional) Excluding IP Addresses from an Address Pool
- (Optional) Configuring Fixed IP Addresses in an Address Pool
- (Optional) Configuring an Address Lease Time
- (Optional) Configuring Automatic Reclaim of Conflicting IP Addresses in an Address Pool
- (Optional) Configuring the Alarm Function for IP Address Exhaustion
- (Optional) Configuring the Logging Function for IP Address Allocation
- (Optional) Configuring a Gateway Address for Clients
- (Optional) Configuring a Configuration File for a DHCP Client
- (Optional) Configuring User-defined Options
- (Optional) Configuring DNS Configurations Allocated by a DHCP Server
- (Optional) Configuring NetBIOS Configurations Allocated by a DHCP Server
- (Optional) Configuring a SIP Server Address to Be Allocated by the DHCP Server
- Verifying the DHCP Server Configuration