No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

Fat AP and Cloud AP V200R008C00 CLI-based Configuration Guide

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Configuring DHCP

Configuring DHCP

Configuring a DHCP Server

Pre-configuration Tasks

Before configuring a device as a DHCP server, ensure that there are reachable routes between DHCP clients and the device.

Planning Data
Planning DHCP Servers

A client broadcasts DHCP Discovery messages. When multiple DHCP servers (or DHCP relay agents) are deployed on a network segment, the client accepts only the first received DHCP Offer message and therefore may obtain an unexpected IP address. Planning DHCP servers ensures that a client obtains network parameters from an expected DHCP server.

Note the following during DHCP server planning:

  • Plan VLANs to ensure that only one DHCP server (or a DHCP relay agent) can receive DHCP Discovery messages in a VLAN.

  • Configure DHCP snooping on upstream access devices of clients to ensure that the clients can apply to the correct DHCP servers for network parameters. For details on how to configure DHCP snooping on the device, see DHCP Snooping Configuration.

Planning IP Addresses
  • Range of IP addresses that can be automatically allocated

    Plan an IP address range based on the number of concurrent online clients on the network. If the number of IP addresses in this range is too small, some clients cannot obtain IP addresses. If the number of IP addresses in this range is too large, IP address resources are wasted.

  • (Optional) IP addresses that cannot be automatically allocated

    Some IP addresses in an address pool are reserved for devices that require static IP addresses. For example, in an address pool ranging from 192.168.100.1 to 192.168.100.254, 192.168.100.2 is reserved for a DNS server. Exclude 192.168.100.2 from the address pool to prevent the DHCP server from allocating 192.168.100.2 to other clients.

  • IP address allocation

    DHCP supports dynamic and static IP address allocation mechanisms. Select one mechanism based on network requirements.

    • Dynamic allocation

      DHCP allocates an IP address with a limited validity period (known as a lease) to a client. Dynamic allocation applies to hosts that temporarily connect to a network with fewer IP addresses than the total number of hosts. For example, it can be used to allocate IP addresses to laptops used by employees on business trips or mobile terminals in cafes.

    • Static allocation

      DHCP allocates fixed IP addresses to specified clients with special IP address requirements. For example, the file server of an enterprise needs to use a fixed IP address to provide services for extranet users. Compared with manual IP address configuration, DHCP static allocation prevents manual configuration errors and helps network administrators perform unified maintenance and management.

Planning Other Network Parameters

DHCP servers can allocate IP addresses and other network parameters to DHCP clients. You can plan other network parameters as required. For example, to enable a client to communicate with other network devices through a domain name and obtain DNS parameters using DHCP, plan the DNS server IP address and domain name of the client.

Planning Leases

Plan an IP address lease for a client based on the online duration of the client. By default, the IP address lease is one day.

  • In scenarios where clients often move and stay online for a short period of time, for example, in cafes, airports, and hotels, plan a short-term lease to ensure that IP addresses are released quickly after the clients go offline.

  • In scenarios where clients seldom move and stay online for a long period of time, for example, in office areas of an enterprise, plan a long-term lease to prevent services from being affected by frequent lease or address renewals.

Enabling DHCP

Context

Before enabling the DHCP server function, enable DHCP in the system view.

NOTE:
  • 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

  1. Run system-view

    The system view is displayed.

  2. Run dhcp enable

    DHCP is enabled.

    By default, DHCP is disabled.

  3. (Optional) Run dhcp speed-limit auto

    The dynamic rate limiting on DHCP messages is enabled.

    By default, dynamic rate limiting is disabled on DHCP messages.

Configuring a DHCP Server to Allocate IP Addresses to Clients

Context

DHCP servers can allocate IP addresses to DHCP and BOOTP clients.

Creating an Address Pool

Context

Address pools allow DHCP servers to allocate network parameters including IP addresses to clients. You can specify network parameters in an address pool, including an IP address range, gateway address, and the IP address of a DNS server.

Address pools are classified into interface address pools and global address pools.

  • Interface address pool: After an IP address is configured for an interface on a DHCP server, you can create an address pool on the same network segment as this interface. Addresses in the address pool can be allocated only to clients connected to the interface. The interface address pool can allocate IP addresses to clients on the same network segment as the DHCP server. When no DHCP relay agent is deployed, a DHCP server allocates IP addresses to clients connected to one interface or allocates IP addresses on different network segments to clients connected to multiple interfaces.
  • Global address pool: On a DHCP server, you can create an address pool on the specified network segment in the system view. Addresses in the address pool can be allocated to all clients connected to the DHCP server. The global address pool applies to the following scenarios:
    • The DHCP server and clients are not on the same network segment, and a DHCP relay agent is deployed.
    • The DHCP server and clients are on the same network segment, and the DHCP server needs to allocate an IP address to a client connected to one interface or allocate IP addresses to clients connected to multiple interfaces.
NOTE:

Configuring interface address pools is recommended for scenarios where a DHCP server and clients reside on the same network segment.

A DHCP server selects address pools according to the following rules:
  • When no DHCP relay agent is deployed, the DHCP server selects the address pool on the same network segment as the IP address of the interface receiving DHCP Request messages.
  • When DHCP relay agents are deployed, the DHCP server selects the address pool on the same network segment as the IP address specified in the Giaddr field of received DHCP Request messages.

Procedure

  • Create an interface address pool.
    1. Run system-view

      The system view is displayed.

    2. (Optional) Configure a DHCP server to dynamically allocate IP addresses to BOOTP clients.

      NOTE:

      You must configure this step when there are BOOTP clients on the network.

      1. Run dhcp server bootp

        The DHCP server is enabled to respond to BOOTP requests.

        By default, a DHCP server does not respond to BOOTP requests.

      2. Run dhcp server bootp automatic

        The DHCP server is enabled to dynamically allocate IP addresses to BOOTP clients.

        By default, a DHCP server does not dynamically allocate IP addresses to BOOTP clients.

        The device functioning as the DHCP server can also allocate IP addresses to the BOOTP clients in static binding mode using the dhcp server static-bind ip-address ip-address mac-address mac-address [ description description ] command.

    3. Run interface interface-type interface-number

      The interface view is displayed.

    4. Run ip address ip-address { mask | mask-length }

      An IP address is configured for the interface.

      NOTE:

      The IP address segment of the interface is the interface address pool. The interface address mask cannot be set to 31; otherwise, the interface address pool may fail to be configured.

  • Create a global address pool.
    1. Run system-view

      The system view is displayed.

    2. (Optional) Configure a DHCP server to dynamically allocate IP addresses to BOOTP clients.

      NOTE:

      You must configure this step when there are BOOTP clients on the network.

      1. Run dhcp server bootp

        The DHCP server is enabled to respond to BOOTP requests.

        By default, a DHCP server does not respond to BOOTP requests.

      2. Run dhcp server bootp automatic

        The DHCP server is enabled to dynamically allocate IP addresses to BOOTP clients.

        By default, a DHCP server does not dynamically allocate IP addresses to BOOTP clients.

        In addition to dynamically allocating IP addresses to BOOTP clients, the device functioning as the DHCP server can allocate IP addresses to the BOOTP clients in static binding mode using the static-bind ip-address ip-address mac-address mac-address [ option-template template-name | description description ] command in the IP address pool view.

    3. Run ip pool ip-pool-name

      A global address pool is created and the global address pool view is displayed.

      By default, no global address pool is created on the device.

      The parameter ip-pool-name uniquely specifies the name of an address pool. For example, create a global address pool named global_f1 for employees on the first floor as follows:

      [Huawei] ip pool global_f1

    4. Run network ip-address [ mask { mask | mask-length } ]

      The range of IP addresses that can be dynamically allocated from the global address pool is specified.

      By default, the range of IP addresses that can be allocated dynamically to clients is not specified.

      An address pool can be configured with only one IP address segment. The IP address range is determined by the mask length.

      NOTE:

      When specifying the IP address range, ensure that IP addresses within the range are on the same network segment as the interface IP address of the DHCP server or DHCP relay agent to avoid incorrect IP address allocation.

      When configuring an address pool, ensure that IP addresses on the network address segment must be class A, B, or C IP addresses, and the mask cannot be set to 0, 1, 31, or 32.

Enabling the DHCP Server Function

Context

After the DHCP server function is enabled on an interface, the DHCP-enabled device can allocate network parameters including IP addresses to clients.

Procedure

  • Enable the DHCP server function based on an interface address pool.
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number

      The interface view is displayed.

    3. Run ip address ip-address { mask | mask-length }

      The interface IP address is configured.

    4. Run dhcp select interface

      The interface is enabled to use the interface address pool to provide the DHCP server function.

      By default, the DHCP server function using the interface address pool is disabled on an interface .

      An interface address pool is actually the network segment where the interface IP address resides, and such an interface address pool applies only to this 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.

  • Enable the DHCP server function based on a global address pool.
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number

      The interface view is displayed.

    3. Configure an IP address for the interface.

      1. Run ip address ip-address { mask | mask-length }

        A primary IP address is configured for the interface.

      2. (Optional) Run ip address ip-address { mask | mask-length } sub

        A secondary IP address is configured for the interface.

      When clients connected to the interface configured with an IP address request IP addresses:

      • If the device and clients are on the same network segment (no relay agent is deployed), the device preferentially allocates IP addresses to clients from the address pool on the same network segment as the interface's primary IP address. If IP addresses in the address pool corresponding to the primary IP address are used up or the address pool is not configured, the device allocates IP addresses to clients from the address pool corresponding to the secondary IP address. If no IP address is configured for the interface or no address pool is on the same network segment as the interface's IP address, clients cannot obtain IP addresses.
        NOTE:

        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.

      • If the device and clients are on different network segments (a relay agent is deployed), the DHCP server parses the IP address specified in the giaddr field of received DHCP request packets, and allocates IP addresses to clients from the address pool on the same network segment as the IP address. If no address pool is on the same network segment as the IP address, clients cannot obtain IP addresses.

    4. Run dhcp select global

      The interface is enabled to use the global address pool to provide the DHCP server function.

      By default, an interface does not use the global address pool to provide the DHCP server function.

      Clients connected to the interface can obtain network parameters including IP addresses from the global interface pool.

      NOTE:

      This step is optional if a DHCP relay agent exists between the device and clients; this step is mandatory if no relay agent exists.

Follow-up Procedure

A DHCP client sends a DHCP Discover message in broadcast mode. When multiple DHCP servers including bogus ones exist on a network segment, the DHCP client accepts only the first received DHCP Offer message and therefore may obtain an unexpected IP address from a bogus DHCP server. To ensure that a client obtains an IP address from the correct DHCP server, configure DHCP snooping on the client. For details on how to configure DHCP snooping, see DHCP Snooping Configuration.

(Optional) Configuring a Range for IP Addresses in an Address Pool

Context

After creating an address pool, you can specify a range for IP addresses in the address pool based on IP address usage.

Procedure

  • Interface address pool:
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number

      The interface view is displayed.

    3. Run dhcp server ip-range start-ip-address end-ip-address

      The range of IP addresses that a DHCP server can allocate to DHCP clients is configured.

    4. Run dhcp server mask { mask | mask-length }

      The subnet mask of IP addresses that a DHCP server can allocate to DHCP clients is configured.

  • Global address pool:
    1. Run system-view

      The system view is displayed.

    2. Run ip pool ip-pool-name

      The global address pool view is displayed.

    3. Run section section-id start-address [ end-address ]

      The IP address segment of the global address pool is specified.

      An IP address pool can contain one or more IP address segments that cannot overlap with each other.

      NOTE:

      Note the following points when specifying IP address segment of the global address pool:

      • If you run the network (IP address pool view) first, ensure that the address segment specified in the section (IP address pool view) command is included in the address range specified in the network (IP address pool view) command.
      • If you run the section (IP address pool view) first, ensure that the address segment specified in the network (IP address pool view) command includes the address range specified in the section (IP address pool view) command.

(Optional) Configuring the Range of IP Addresses That Cannot Be Automatically Allocated to Clients from an Address Pool

Context

Some servers and clients may use specific IP addresses in an address pool, so that the DHCP server does not automatically allocate these IP addresses to other clients. For example, in an enterprise, a DHCP server allocates IP addresses on the network segment 192.168.1.0/24 to employee PCs. On this network segment, 192.168.1.1 is used as the gateway IP address, and 192.168.1.10 is used as the DNS server IP address. The DNS server IP address is manually configured to ensure stability, and other hosts obtain IP addresses using DHCP. Therefore, 192.168.1.10 must be excluded from the range of IP addresses that can be automatically allocated.

NOTE:

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.
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number

      The interface view is displayed.

    3. Run dhcp server excluded-ip-address start-ip-address [ end-ip-address ]

      The range of IP addresses that are not automatically allocated from the address pool is configured.

      By default, all IP addresses are automatically allocated from the address pool.

      To set multiple IP address ranges that cannot be automatically allocated from the address pool, run this command multiple times.

      For example, to exclude 192.168.1.10 from the range of IP addresses that can be automatically allocated, run:

      [Huawei-Vlanif100] dhcp server excluded-ip-address 192.168.1.10

  • Exclude IP addresses from a global address pool.
    1. Run system-view

      The system view is displayed.

    2. Run ip pool ip-pool-name

      The global address pool view is displayed.

    3. Run excluded-ip-address start-ip-address [ end-ip-address ]

      The range of IP addresses that are not automatically allocated from the address pool is configured.

      By default, all IP addresses are automatically allocated from the address pool.

      To set multiple IP address ranges that cannot be automatically allocated from the address pool, run this command multiple times.

      For example, to exclude 192.168.1.10 from the range of IP addresses that can be automatically allocated, run:

      [Huawei-ip-pool-global_f1] excluded-ip-address 192.168.1.10

(Optional) Configuring a DHCP Server to Allocate Fixed IP Addresses to Specified Clients

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.

NOTE:
  • Ensure that the bound IP address is not configured as the IP address that cannot be allocated and is not allocated by the DHCP server.
  • You can run the display ip pool command to view the used IP addresses in the current address pool and select an available IP address to be bound to the MAC address. To bind used IP addresses to MAC addresses, run the reset ip pool command to reclaim used IP addresses first.
  • After an IP address is bound to a MAC address, the IP address does not expire; the binding between the IP and MAC addresses cannot be deleted when the IP address is in use.

Procedure

  • Configure a DHCP server to allocate fixed IP addresses from an interface address pool.
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number

      The interface view is displayed.

    3. Run dhcp server static-bind ip-address ip-address mac-address mac-address [ description description ]

      The DHCP server is configured to allocate fixed IP addresses to specified clients.

      By default, a DHCP server does not allocate fixed IP addresses to specified clients.

  • Configure a DHCP server to allocate fixed IP addresses from a global address pool.
    1. Run system-view

      The system view is displayed.

    2. Run ip pool ip-pool-name

      The global address pool view is displayed.

    3. Run static-bind ip-address ip-address mac-address mac-address [ option-template template-name | description description ]

      The DHCP server is configured to allocate fixed IP addresses to specified clients.

      By default, a DHCP server does not allocate fixed IP addresses to specified clients.

(Optional) Configuring an Address Lease Time

Context

NOTE:

This task does not take effect for BOOTP clients.

Except for allocating fixed IP addresses to specified clients, a DHCP server can dynamically allocate IP addresses with leases to clients. In scenarios where hosts temporarily access the network and the number of idle IP addresses is less than the total number of hosts.

The lease time varies depending on network access requirements. By default, the IP address lease is one day.
  • In locations where clients often move, for example, in cafes, airports, and hotels, plan a short-term lease to ensure that IP addresses are released quickly after the clients go offline.
  • In locations where clients seldom move, for example, in office areas of an enterprise, plan a long-term lease to prevent services from being affected by frequent address renewals.

Different address pools on a DHCP server can be configured with different IP address leases, but the IP addresses in the same address pool must be configured with the same lease.

Procedure

  • Configure a lease time based on an interface address pool.
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number

      The interface view is displayed.

    3. Run dhcp server lease { day day [ hour hour [ minute minute ] ] | unlimited }

      An IP address lease is set.

      By default, the IP address lease is one day.

      If the IP address lease of an address pool is changed using this command, newly assigned IP addresses use the new IP address lease. IP addresses assigned before the change still use the original IP address lease before the lease is updated, and use the new lease after the lease is updated.

  • Configure a lease time based on a global address pool.
    1. Run system-view

      The system view is displayed.

    2. Run ip pool ip-pool-name

      The global address pool view is displayed.

    3. Run lease { day day [ hour hour [ minute minute ] ] | unlimited }

      An IP address lease is set.

      By default, the IP address lease is one day.

      If the IP address lease of an address pool is changed using this command, newly assigned IP addresses use the new IP address lease. IP addresses assigned before the change still use the original IP address lease before the lease is updated, and use the new lease after the lease is updated.

Verifying the Configuration

Run the display ip pool command to view information about the IP address lease. The values of the lease and left fields in the command output indicate the configured lease time and remaining lease time, respectively.

(Optional) Configuring IP Address Conflict Detection Before a DHCP Server Allocates IP Addresses

Context

A DHCP server configured with IP address conflict detection checks whether an IP address to be allocated to a client conflicts with other IP addresses.

After IP address conflict detection is configured, a DHCP server sends an ICMP Echo Request packet to check whether the IP address to be allocated conflicts with other clients' IP addresses before sending a DHCP Offer message. The source and destination IP addresses of the ICMP Echo Request packet are the DHCP server's IP address and the IP address to be allocated, respectively. If the DHCP server does not receive an ICMP Echo Reply packet after the maximum waiting period (specified using the dhcp server ping timeout milliseconds command), it continues to send the ICMP Echo Request packet until the maximum number of detection times (specified using the dhcp server ping packet number command) has been reached.
  • If the DHCP server receives no ICMP Echo Reply packet within the detection period (number of detection times x maximum waiting period), this IP address is not used by any client, and the DHCP server allocates the IP address to the client by sending a DHCP Offer message to the client.
  • If the DHCP server receives an ICMP Echo Reply packet within the detection period (number of detection times x maximum waiting period), this IP address is being used by a client, and the DHCP server lists this IP address as a conflicting IP address and waits for the next DHCP Discover message.

This configuration task takes effect for both the interface and global address pools.

NOTE:

If the detection period is too long, clients may fail to obtain IP addresses. Set the detection period to less than 8 seconds.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run dhcp server ping packet number

    The number of times that the device detects IP address conflicts before allocating IP addresses is set to 0.

    By default, the device detects IP address conflicts twice before allocating IP addresses.

  3. Run dhcp server ping timeout milliseconds

    The maximum wait time for each conflict detection is set.

    By default, the maximum wait time for each conflict detection is 500 milliseconds.

(Optional) Configuring a DHCP Server to Automatically Save IP Address Allocation Information

Context

If a DHCP server is restarted after an upgrade or is faulty, IP address allocation information on the DHCP server is lost. After the restart, the DHCP server must re-allocate IP addresses. To prevent data loss and to support data recovery upon a restart, configure a DHCP server to automatically save IP address allocation information, including address leases and conflicting IP addresses, in files. When the DHCP server restarts, it can recover the data from the files.

This configuration task takes effect for both the interface and global address pools.

NOTE:
  • After this function is enabled, the DHCP server generates lease.txt and conflict.txt files in the DHCP folder in storage. The lease.txt file stores lease information, and the conflict.txt file stores conflicting IP addresses. To view information about the DHCP database, run the display dhcp server database command.

  • The lease.txt and conflict.txt files are overwritten periodically; therefore, you are advised to back up and save the two files to other locations.

  • 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.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run dhcp server database enable

    The DHCP server is enabled to automatically save IP address allocation information.

    By default, the DHCP server does not automatically save IP address allocation information.

  3. Run dhcp server database write-delay interval

    The interval at which the DHCP server saves IP address allocation information is set.

    By default, IP address allocation information is saved every 300 seconds in data files. The new data files overwrite the earlier data files.

  4. Run dhcp server database recover

    The DHCP server is enabled to recover IP address allocation information.

    After this command is run, the DHCP server can recover IP address allocation information from the data files in storage when the server restarts.

(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.

Procedure

  • Interface address pool:
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number

      The interface view is displayed.

    3. Run dhcp server conflict auto-recycle interval day day [ hour hour [ minute minute ] ]

      Automatic reclaim of conflicting IP addresses in the interface address pool is enabled and the interval for the automatic reclaim is configured.

      By default, automatic reclaim of conflicting IP addresses in the interface address pool is disabled.

  • Global address pool:
    1. Run system-view

      The system view is displayed.

    2. Run ip pool ip-pool-name

      The global address pool view is displayed.

    3. Run conflict auto-recycle interval day day [ hour hour [ minute minute ] ]

      Automatic reclaim of conflicting IP addresses in the global address pool is enabled and the interval for the automatic reclaim is configured.

      By default, automatic reclaim of conflicting IP addresses in the global address pool is disabled.

(Optional) Configuring the Percentage of Alarms Indicating Used Up IP Addresses in an Address Pool and the Percentage of the Clear Alarms

Context

When IP addresses in an address pool are used up, alarms are sent to notify the administrator.

Procedure

  • Interface address pool:
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number

      The interface view is displayed.

    3. Run dhcp server alarm ip-used percentage alarm-resume-percentage alarm-percentage

      The percentage of alarms indicating used up IP addresses in an address pool and the percentage of the clear alarms are configured.

      By default, the percentage of the alarms is 100%, and the percentage of the clear alarms is 50%.

  • Global address pool:
    1. Run system-view

      The system view is displayed.

    2. Run ip pool ip-pool-name

      The global address pool view is displayed.

    3. Run alarm ip-used percentage alarm-resume-percentage alarm-percentage

      The percentage of the alarms indicating that IP addresses in an address pool are used up and the percentage of the clear alarms are configured.

      By default, the percentage of the alarms is 100%, and the percentage of the clear alarms is 50%.

(Optional) Configuring a DHCP Server to Allocate Network Parameters Besides IP Addresses

Context

DHCP servers can allocate other network parameters in addition to IP addresses to DHCP clients. These parameters include the IP address of a DNS server, startup configuration file, and self-defined options.

When network parameters, excluding IP addresses, are allocated to dynamic and static clients, configuration commands are the same if an interface address pool is used but are different if a global address pool is used. This is because:
  • Network parameters for dynamic clients are configured in the global address pool view.
  • Network parameters for static clients are configured in the global address pool and DHCP Option template views.

    Network parameters configured in the DHCP Option template view take effect only for static clients. If a network parameter is configured differently in the global address pool and DHCP Option template views, the configuration in the DHCP Option template view takes effect.

Configuring a Gateway Address for Clients

Context

When a DHCP client connects to a DHCP server or host outside the local network segment, data must be forwarded through an egress gateway. You can perform this task to configure an egress gateway address for the client. This task is required only when the global address pool is used. For the interface address pool, if a device functions as the gateway and the DHCP server, the IP address of the interface through which the DHCP server connects to the client is the egress gateway address of the client. In this case, you do not need to configure the egress gateway address. If different devices function as the gateway and the DHCP server respectively, you need to configure the egress gateway address.

NOTE:
  • For a global address pool:

    If a gateway address is configured on the DHCP server, a DHCP client obtains the gateway address from the DHCP server and automatically generates a default route to the gateway address.

    If you run the option121 command on the DHCP server to allocate classless static routes to DHCP clients, the DHCP client uses an allocated classless static route and does not automatically generate a default route to the gateway address.

  • For an interface address pool:

    The egress gateway address is the IP address of the interface connecting the DHCP server to the DHCP client. The DHCP client obtains the IP address as the gateway address and automatically generates a default route to the gateway address.

    If you run the dhcp server option121 command on the DHCP server to allocate classless static routes to DHCP clients, the DHCP client uses an allocated classless static route and does not automatically generate a default route to the gateway address.

Do not configure a gateway address for DHCP clients in the following scenarios:
  • When no DHCP relay agent is deployed, the gateway address is the IP address of the interface connecting the DHCP server to the DHCP client.
  • When a DHCP relay agent is deployed, the gateway address is the IP address of the interface connecting the DHCP relay agent to the client.

To load balance traffic and improve network reliability, configure multiple egress gateways. Each address pool can be configured with a maximum of eight gateway addresses.

When a global address pool is used to allocate network parameters, configuration commands are different for dynamic and static clients. Network parameters for dynamic clients are configured in the global address pool view, and network parameters for static clients are configured in either the global address pool view or DHCP Option template view. The DHCP Option template must be configured when static clients require network parameters that are different from those of dynamic clients. Network parameters configured in the DHCP Option template view take effect only for static clients. If a network parameter is configured differently in the global address pool and DHCP Option template views, the configuration in the DHCP Option template view takes effect.

Procedure

  • In the interface address pool view:
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number

      The interface view is displayed.

    3. Run dhcp server gateway-list ip-address &<1-8>

      A default gateway IP address that a DHCP server pre-allocates to DHCP clients is configured.

      By default, no egress gateway address is configured.

  • In the global address pool view:
    1. Run system-view

      The system view is displayed.

    2. Run ip pool ip-pool-name

      The global address pool view is displayed.

    3. Run gateway-list ip-address &<1-8>

      A gateway address for DHCP clients is configured.

      By default, no egress gateway address is configured.

  • In the DHCP Option template view:

    1. Run system-view

      The system view is displayed.

    2. Run dhcp option template template-name

      A DHCP Option template is created and its view is displayed.

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

      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. If a network parameter is configured differently in the global address pool and DHCP Option template views, the configuration in the DHCP Option template view takes effect.

      To allocate IP addresses only to static clients (for details, see (Optional) Configuring a DHCP Server to Allocate Fixed IP Addresses to Specified Clients), you do not need to configure a DHCP Option template.

    3. Run gateway-list ip-address &<1-8>

      A gateway address for DHCP clients is configured.

      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.

    4. (Optional) Run quit

      Return to the system view.

    5. (Optional) Run ip pool ip-pool-name

      The global address pool view is displayed.

    6. (Optional) Run static-bind ip-address ip-address mac-address mac-address [ option-template template-name | description description ]

      A DHCP Option template is bound to static clients.

Configuring DNS and the NetBIOS Service on DHCP Clients

Context

To enable DHCP clients to communicate with devices on other networks through host names, configure the DNS or NetBIOS service.

DNS, defined by RFC 1034 and provided by TCP/IP, translates host names into IP addresses.

NetBIOS, defined by IBM, is applicable to small LANs with dozens of PCs to provide the following services:

  • Host naming services on a network segment through UDP port 137
  • Data services (through UDP port 138), including data transmitting between programs, browser notification services, and network neighbor setup on users' desktop systems
  • Session services (through TCP port 139), including file sharing and printing

Clients running on Microsoft Windows use the NetBIOS protocol for communication. The Windows Internet Naming Service (WINS) server translates host names into IP addresses. Since NetBIOS is vulnerable to attacks, it is optional on Windows operating systems later than Windows 2000. Users can enable or disable NetBIOS as required.

When a DHCP client uses the NetBIOS protocol for communication, its host name must be mapped to an IP address. Based on the modes to obtain mapping, NetBIOS nodes are classified into the following types:
  • b-node: in broadcast mode

    This node obtains its mapping in broadcast mode.

  • p-node: in peer-to-peer mode

    This node obtains its mapping by communicating with the NetBIOS server in unicast mode.

  • m-node: in mixed mode

    An m-node is a p-node that has certain broadcast features. The node first sends broadcast packets to obtain its mapping. If no mapping is obtained, the node sends unicast packets.

  • h-node: in hybrid mode

    An h-node is a b-node enabled with an end-to-end communication mechanism. The node first sends unicast packets to obtain its mapping. If no mapping is obtained, the node sends broadcast packets.

NOTE:

When installing a Microsoft Windows operating system on a PC, you must define a host name. Otherwise, the system generates a host name at random. Host names are unique on a network.

When a global address pool is used to allocate network parameters, configuration commands are different for dynamic and static clients. Network parameters for dynamic clients are configured in the global address pool view, and network parameters for static clients are configured in either the global address pool view or DHCP Option template view. The DHCP Option template must be configured when static clients require network parameters that are different from those of dynamic clients. Network parameters configured in the DHCP Option template view take effect only for static clients. If a network parameter is configured differently in the global address pool and DHCP Option template views, the configuration in the DHCP Option template view takes effect.

Procedure

  • Based on an interface address pool:

    • Configure a DNS service.

      1. Run system-view

        The system view is displayed.

      2. Run interface interface-type interface-number

        The VLANIF interface view is displayed.

      3. Run the following commands to configure the IP address of the DNS server and domain name for the DHCP clients.
        • Run dhcp server dns-list { ip-address &<1-8> | unnumbered interface interface-type interface-number }

          The IP address of the DNS server is configured for DHCP clients.

          By default, no DNS server IP address is configured in an address pool.

          Each address pool can be configured with a maximum of eight DNS server IP addresses.

        • Run dhcp server domain-name domain-name

          The domain name is allocated to DHCP clients.

          By default, no domain name is allocated.

    • Configure a NetBIOS service.

      1. Run system-view

        The system view is displayed.

      2. Run interface interface-type interface-number

        The VLANIF interface view is displayed.

      3. Run the following commands to configure the IP address of the NetBIOS server and NetBIOS node type for the DHCP clients.
        • Run dhcp server nbns-list ip-address &<1-8>

          The IP address of the NetBIOS server is configured for DHCP clients.

          By default, no NetBIOS server IP address is configured in an address pool.

          Each address pool can be configured with a maximum of eight NetBIOS server IP addresses.

        • Run dhcp server netbios-type { b-node | h-node | m-node | p-node }

          The NetBIOS node type for DHCP clients is configured.

          By default, no NetBIOS node type is configured for DHCP clients.

  • Based on a global address pool:

    • In the global address pool view:

      • Configure a DNS service.

        1. Run system-view

          The system view is displayed.

        2. Run ip pool ip-pool-name

          The global address pool view is displayed.

        3. Run the following commands to configure the IP address of the DNS server and domain name suffix for the DHCP clients.
          • Run dns-list ip-address &<1-8>

            The IP address of the DNS server is configured for DHCP clients.

            By default, no DNS server IP address is configured in an address pool.

            Each address pool can be configured with a maximum of eight DNS server IP addresses.

          • Run domain-name domain-name

            The domain name suffix is allocated to DHCP clients.

            By default, no domain name suffix is allocated.

      • Configure a NetBIOS service.

        1. Run system-view

          The system view is displayed.

        2. Run ip pool ip-pool-name

          The global address pool view is displayed.

        3. Run the following commands to configure the IP address of the NetBIOS server and NetBIOS node type for the DHCP clients.
          • Run nbns-list ip-address &<1-8>

            The IP address of the NetBIOS server is configured for DHCP clients.

            By default, no NetBIOS server IP address is configured in an address pool.

            Each address pool can be configured with a maximum of eight NetBIOS server IP addresses.

          • Run netbios-type { b-node | h-node | m-node | p-node }

            The NetBIOS node type for DHCP clients is configured.

            By default, no NetBIOS node type is configured for DHCP clients.

    • In the DHCP Option template view:

      • Configure a DNS service.

        1. Run system-view

          The system view is displayed.

        2. Run dhcp option template template-name

          A DHCP Option template is created and its view is displayed.

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

          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. If a network parameter is configured differently in the global address pool and DHCP Option template views, the configuration in the DHCP Option template view takes effect.

          To allocate IP addresses only to static clients (for details, see (Optional) Configuring a DHCP Server to Allocate Fixed IP Addresses to Specified Clients), you do not need to configure a DHCP Option template.

        3. Run the following commands to configure the IP address of the DNS server and domain name suffix for the DHCP clients.
          • Run dns-list ip-address &<1-8>

            The IP address of the DNS server is configured for DHCP clients.

            By default, no DNS server IP address is configured in an address pool.

            Each address pool can be configured with a maximum of eight DNS server IP addresses.

          • Run domain-name domain-name

            The domain name suffix is allocated to DHCP clients.

            By default, no domain name suffix is allocated.

          If you need to configure other items in the DHCP Option template view, complete them first before performing the following steps.

        4. (Optional) Run quit

          Return to the system view.

        5. (Optional) Run ip pool ip-pool-name

          The global address pool view is displayed.

        6. (Optional) Run static-bind ip-address ip-address mac-address mac-address [ option-template template-name | description description ]

          A DHCP Option template is bound to static clients.

      • Configure a NetBIOS service.

        1. Run system-view

          The system view is displayed.

        2. Run dhcp option template template-name

          A DHCP Option template is created and its view is displayed.

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

          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. If a network parameter is configured differently in the global address pool and DHCP Option template views, the configuration in the DHCP Option template view takes effect.

          To allocate IP addresses only to static clients (for details, see (Optional) Configuring a DHCP Server to Allocate Fixed IP Addresses to Specified Clients), you do not need to configure a DHCP Option template.

        3. Run the following commands to configure the IP address of the NetBIOS server and NetBIOS node type for the DHCP clients.
          • Run nbns-list ip-address &<1-8>

            The IP address of the NetBIOS server is configured for DHCP clients.

            By default, no NetBIOS server IP address is configured in an address pool.

            Each address pool can be configured with a maximum of eight NetBIOS server IP addresses.

          • Run netbios-type { b-node | h-node | m-node | p-node }

            The NetBIOS node type for DHCP clients is configured.

            By default, no NetBIOS node type is configured for DHCP clients.

          To configure other items in the DHCP Option template view, do so and then perform the following steps when you have completed the other configurations.

        4. (Optional) Run quit

          Return to the system view.

        5. (Optional) Run ip pool ip-pool-name

          The global address pool view is displayed.

        6. (Optional) Run static-bind ip-address ip-address mac-address mac-address [ option-template template-name | description description ]

          A DHCP Option template is bound to static clients.

Configuring a SIP Server IP Address Allocated to a DHCP Client

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

  • Interface address pool:
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number

      The interface view is displayed.

    3. Run dhcp server sip-server { ip-address ip-address &<1-2> | list domain-name &<1-2> }

      A SIP server IP address allocated to a DHCP client is configured.

      By default, the SIP server IP address is not configured.

  • Global address pool:
    1. Run system-view

      The system view is displayed.

    2. Run ip pool ip-pool-name

      The global address pool view is displayed.

    3. Run sip-server { ip-address ip-address &<1-2> | list domain-name &<1-2> }

      A SIP server IP address allocated to a DHCP client is configured.

      By default, the SIP server IP address is not configured.

Configuring a Configuration File for a DHCP Client

Context

Some clients require certain network parameters, in addition to IP addresses, to be configured before they can work normally. A DHCP server can allocate configuration information such as the startup configuration file to clients. Configuration files are usually saved on the DHCP server or a dedicated file server. The DHCP server can specify the address of the file server so that clients can easily obtain files from the file server.

When a global address pool is used to allocate network parameters, configuration commands are different for dynamic and static clients. Network parameters for dynamic clients are configured in the global address pool view, and network parameters for static clients are configured in either the global address pool view or DHCP Option template view. The DHCP Option template must be configured when static clients require network parameters that are different from those of dynamic clients. Network parameters configured in the DHCP Option template view take effect only for static clients. If a network parameter is configured differently in the global address pool and DHCP Option template views, the configuration in the DHCP Option template view takes effect.

NOTE:

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.
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number

      The interface view is displayed.

    3. Run dhcp server bootfile bootfile

      The name of the startup configuration file for DHCP clients is configured.

      By default, the name is not configured.

    4. Run dhcp server sname sname

      The name of the server from which DHCP clients obtain the startup configuration file is configured.

      By default, the name of the server is not configured.

    5. (Optional) Run dhcp server next-server ip-address

      The IP address of the server is configured for the client after the client automatically obtains an IP address.

      By default, the server IP address is not configured.

      You can also specify an IP address for the file server by configuring user-defined options for clients.

  • Configure configuration files based on a global address pool.

    • In the global address pool view:

      1. Run system-view

        The system view is displayed.

      2. Run ip pool ip-pool-name

        The global address pool view is displayed.

      3. Run bootfile bootfile

        The name of the startup configuration file for DHCP clients is configured.

        By default, the name of the startup configuration file for DHCP clients is not configured.

      4. Run sname sname

        The name of the server from which DHCP clients obtain the startup configuration file is configured.

        By default, the name of the server from which a DHCP client obtains the startup configuration file is not configured.

      5. (Optional) Run next-server ip-address

        The IP address of a server is configured to provide the network service for the client after the client automatically obtains the IP address.

        By default, the server IP address is not configured for the client after the client automatically obtains the IP address.

        To obtain files from the file server, perform this step. To specify the IP address of the file server, configure user-defined options for clients.

    • In the DHCP Option template view:

      1. Run system-view

        The system view is displayed.

      2. Run dhcp option template template-name

        A DHCP Option template is created and its view is displayed.

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

        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. If a network parameter is configured differently in the global address pool and DHCP Option template views, the configuration in the DHCP Option template view takes effect.

        To allocate IP addresses only to static clients (for details, see (Optional) Configuring a DHCP Server to Allocate Fixed IP Addresses to Specified Clients), you do not need to configure a DHCP Option template.

      3. Run bootfile bootfile

        The name of the startup configuration file for DHCP clients is configured.

        By default, the name of the startup configuration file for DHCP clients is not configured.

      4. Run sname sname

        The name of the server from which DHCP clients obtain the startup configuration file is configured.

        By default, the name of the server from which a DHCP client obtains the startup configuration file is not configured.

      5. (Optional) Run next-server ip-address

        The IP address of a server is configured to provide the network service for the client after the client automatically obtains the IP address.

        By default, the server IP address is not configured for the client after the client automatically obtains the IP address.

        To obtain files from the file server, perform this step. To specify the IP address of the file server, configure user-defined options for clients.

        To configure other items in the DHCP Option template view, do so and then perform the following steps when you have completed the other configurations.

      6. (Optional) Run quit

        Return to the system view.

      7. (Optional) Run ip pool ip-pool-name

        The global address pool view is displayed.

      8. (Optional) Run static-bind ip-address ip-address mac-address mac-address [ option-template template-name | description description ]

        A DHCP Option template is bound to static clients.

Configuring User-defined Options for Clients

Context

Vendors can define DHCP options. A device functioning as a DHCP server can allocate vendor-defined network parameters to clients using the following methods:
  • Based on the options in DHCP Discovery messages:

    Options are configured using the dhcp server option (based on an interface address pool) or option (based on a global address pool) command. The device provides options only when requested by clients.

  • By forcibly appending the Options field:

    Options are 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. The device inserts the Options field to DHCP Response message, regardless of whether the options are requested by clients.

When a global address pool is used to allocate network parameters, configuration commands are different for dynamic and static clients. Network parameters for dynamic clients are configured in the global address pool view, and network parameters for static clients are configured in either the global address pool view or DHCP Option template view. The DHCP Option template must be configured when static clients require network parameters that are different from those of dynamic clients. Network parameters configured in the DHCP Option template view take effect only for static clients. If a network parameter is configured differently in the global address pool and DHCP Option template views, the configuration in the DHCP Option template view takes effect.

Procedure

  • Configure user-defined options for clients based on an interface address pool.
    1. Run system-view

      The system view is displayed.

    2. (Optional) Run dhcp server trust option82

      The DHCP server is enabled to trust Option 82.

      By default, the device is enabled to trust Option 82.

      The Option 82 field is called the DHCP relay agent information field. It records the location of a DHCP client, based on which a DHCP server can select address allocation policies including IP addresses and other network parameters. Vendors can define Option 82 based on their requirements. Currently, a device functioning as the DHCP server cannot allocate network parameters to clients based on policies. After the device is enabled to trust Option 82, the device normally allocates IP addresses to clients. If the device is disabled from trusting Option 82, the device discards received messages carrying Option 82.

    3. (Optional) Run dhcp anti-attack check duplicate option [ option-start [ to option-end ] ] &<1-254>

      The device is enabled to check and discard DHCP messages with duplicate options.

      By default, a device does not check and discard DHCP messages with duplicate options.

    4. Run interface interface-type interface-number

      The interface view is displayed.

    5. (Optional) Run dhcp server force insert option code &<1-254>

      The DHCP server is configured to forcibly insert an Option field to DHCP Reply messages sent to DHCP clients.

      By default, the DHCP server does not forcibly insert an Option field to DHCP Reply messages.

      After this function is configured, the device inserts an Option field to a DHCP Reply message regardless of whether the option has been requested.

    6. Run dhcp server option code [ sub-option sub-code ] { ascii ascii-string | hex hex-string | cipher cipher-string | ip-address ip-address &<1-8> }

      DHCP options are configured.

      By default, no option is configured.

      NOTE:

      If an option carries a password, using ascii or hex is insecure. Using cipher is recommended. For security purposes, the password must be at least six characters long and contain at least two of the following: digits, lowercase letters, uppercase letters, and special characters.

      After an option is configured, the device provides this option only when requested by clients.

      Some options are configured using other commands, as described in the following table.
      Table 7-52  Commands for configuring options

      Option

      Configuration Command

      Description

      Option1 Mask-length in the ip address ip-address { mask | mask-length } command. Subnet mask
      Option3 Ip-address in the ip address ip-address { mask | mask-length } command. Gateway address
      Option6 dhcp server dns-list ip-address &<1-8> DNS server IP address
      Option15 dhcp server domain-name (interface view) domain-name Domain name
      Option44 dhcp server nbns-list ip-address &<1-8> NetBIOS server IP address
      Option46 dhcp server netbios-type { b-node | h-node | m-node | p-node } NetBIOS node type
      Option50 N/A Requested IP address
      Option51 dhcp server 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
      Option121 dhcp server option121 ip-address { ip-address mask-length gateway-address } &<1-8> A group of classless routes
      Option184 dhcp server option184 { as-ip ip-address | fail-over ip-address dialer-string | ncp-ip ip-address | voice-vlan vlan-id } Voice parameters

    7. Run dhcp server option121 ip-address { ip-address mask-length gateway-address } &<1-8>

      A classless static route allocated to a DHCP client is configured.

      By default, no classless static route allocated to DHCP clients is configured.

    8. Run dhcp server option184 { as-ip ip-address | fail-over ip-address dialer-string | ncp-ip ip-address | voice-vlan vlan-id }

      Option 184 allocated to DHCP clients is configured.

      By default, the Option 184 field is not configured.

    9. Run dhcp client request option-list exclude option-code &<1-3>

      The option to be excluded from the DHCP client request list is configured.

      By default, the option to be excluded from the DHCP client request list is not configured.

  • Configure user-defined options for clients based on a global address pool.

    • In the global address pool view:

      1. Run system-view

        The system view is displayed.

      2. (Optional) Run dhcp server trust option82

        The DHCP server is enabled to trust Option 82.

        By default, the device is enabled to trust Option 82.

        The Option 82 field is called the DHCP relay agent information field. It records the location of a DHCP client, based on which a DHCP server can select address allocation policies including IP addresses and other network parameters. Vendors can define Option 82 based on their requirements. Currently, a device functioning as the DHCP server cannot allocate network parameters to clients based on policies. After the device is enabled to trust Option 82, the device normally allocates IP addresses to clients. If the device is disabled from trusting Option 82, the device discards received messages carrying Option 82.

      3. Run ip pool ip-pool-name

        The global address pool view is displayed.

      4. (Optional) Run force insert option code &<1-254>

        The DHCP server is configured to forcibly insert an Option field to DHCP Reply messages sent to DHCP clients.

        By default, the DHCP server does not forcibly insert an Option field to DHCP Reply messages.

      5. Run option code [ sub-option sub-code ] { ascii ascii-string | hex hex-string | cipher cipher-string | ip-address ip-address &<1-8> }

        DHCP options are configured.

        By default, no option is configured.

        NOTE:

        If an option carries a password, using ascii or hex is insecure. Using cipher is recommended. For security purposes, the password must be at least six characters long and contain at least two of the following: digits, lowercase letters, uppercase letters, and special characters.

        Some options are configured using other commands, as described in the following table.
        Table 7-53  Commands for configuring options

        Option

        Configuration Command

        Description

        Option1 mask-length in the network (IP address pool view) ip-address [ mask { mask | mask-length } ] command 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
        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 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
        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
      6. Run option121 ip-address { ip-address mask-length gateway-address } &<1-8>

        A classless static route allocated to a DHCP client is configured.

        By default, no classless static route allocated to DHCP clients is configured.

      7. Run option184 { as-ip ip-address | fail-over ip-address dialer-string | ncp-ip ip-address | voice-vlan vlan-id }

        Option 184 allocated to DHCP clients is configured.

        By default, the Option 184 field is not configured.

    • In the DHCP Option template view:

      1. Run system-view

        The system view is displayed.

      2. Run dhcp option template template-name

        A DHCP Option template is created and its view is displayed.

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

        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. If a network parameter is configured differently in the global address pool and DHCP Option template views, the configuration in the DHCP Option template view takes effect.

        To allocate IP addresses only to static clients (for details, see (Optional) Configuring a DHCP Server to Allocate Fixed IP Addresses to Specified Clients), you do not need to configure a DHCP Option template.

      3. (Optional) Run force insert option code &<1-254>

        The DHCP server is configured to forcibly insert an Option field to DHCP Reply messages sent to DHCP clients.

        By default, the DHCP server does not forcibly insert an Option field to DHCP Reply messages.

      4. Run option code [ sub-option sub-code ] { ascii ascii-string | hex hex-string | cipher cipher-string | ip-address ip-address &<1-8> }

        DHCP options are configured.

        By default, no option is configured.

        NOTE:

        If an option carries a password, using ascii or hex is insecure. Using cipher is recommended. For security purposes, the password must be at least six characters long and contain at least two of the following: digits, lowercase letters, uppercase letters, and special characters.

        Some options are configured using commands, as described in Table 7-53.

      5. Run option121 ip-address { ip-address mask-length gateway-address } &<1-8>

        A classless static route allocated to a DHCP client is configured.

        By default, no classless static route allocated to DHCP clients is configured.

      6. Run option184 { as-ip ip-address | fail-over ip-address dialer-string | ncp-ip ip-address | voice-vlan vlan-id }

        Option 184 allocated to DHCP clients is configured.

        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.

      7. (Optional) Run quit

        Return to the system view.

      8. (Optional) Run ip pool ip-pool-name

        The global address pool view is displayed.

      9. (Optional) Run static-bind ip-address ip-address mac-address mac-address [ option-template template-name | description description ]

        A DHCP Option template is bound to static clients.

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.

Configuring a DHCP Relay Agent

Pre-configuration Tasks

Before configuring a DHCP relay agent, complete the following tasks:

  • Configure a DHCP server.

    If a access point functions as the DHCP server, refer to Configuring a DHCP Server for configuration details.

  • Configure a routing protocol between the device and DHCP server to ensure that there are reachable routes between them.

Enabling DHCP

Context

Before enabling the DHCP relay function, enable DHCP in the system view.

NOTE:
  • 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

  1. Run system-view

    The system view is displayed.

  2. Run dhcp enable

    DHCP is enabled.

    By default, DHCP is disabled.

  3. (Optional) Run dhcp speed-limit auto

    The dynamic rate limiting on DHCP messages is enabled.

    By default, dynamic rate limiting is disabled on DHCP messages.

Enabling the DHCP Relay Function

Context

Enable the DHCP relay function on an interface so that the interface functions as a DHCP relay agent.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface interface-type interface-number

    The VLANIF interface view is displayed.

  3. Run ip address ip-address { mask | mask-length }

    An IP address is configured for the interface.

    NOTE:
    • The DHCP relay function is configured on the user-side gateway interface typically. The IP address of the gateway interface must be on the same network segment as the address pool configured on the DHCP server; otherwise, DHCP clients cannot obtain IP addresses.

  4. Run dhcp select relay

    The DHCP relay function is enabled on the interface. If the proxy mode parameter is specified, the proxy mode of the DHCP relay agent is enabled.

    By default, the DHCP relay function is disabled on an interface.

    NOTE:
    • You cannot deploy a DHCP relay agent between a DHCP client and a DHCP relay agent in proxy mode, and can deploy a DHCP relay agent between a DHCP server and a DHCP relay agent in proxy mode. A DHCP relay agent in proxy mode must be configured as the first DHCP relay agent connected to DHCP clients.
    • The DHCP server function and the proxy mode of the DHCP relay agent cannot be configured on the same interface of the device.

Specifying an IP Address for the DHCP Server on a DHCP Relay Agent

Context

A device functioning as a DHCP relay agent transparently transmits DHCP Discovery messages to the destination DHCP server. The DHCP server can then allocate network parameters including IP addresses to clients. After an IP address is specified for the DHCP server on the DHCP relay agent, clients can send DHCP Discovery messages to the DHCP server to apply for IP addresses.

The device supports two configuration methods:
  • In the interface view: Specify an IP address for the DHCP server in the interface view. This method is recommended for configuring DHCP relay on an interface or multiple interfaces on which DHCP servers have different IP addresses.

  • In the DHCP server group view: Create a DHCP server group in the system view, add members (IP addresses of specified DHCP servers) to the group, and apply the DHCP server group to an interface. This method is recommended for configuring DHCP relay on multiple interfaces that map the same DHCP server.

A maximum of 16 DHCP relay agents are allowed between a DHCP server and a DHCP client. If there are more than 16 DHCP relay agents, DHCP messages are discarded.

You can configure multiple DHCP server addresses on an interface of a device functioning as a DHCP relay agent. The device functioning as a DHCP relay agent processes a received broadcast DHCP Discover message as follows:
  • The device forwards the message to all DHCP servers by default, and does not check whether the DHCP server status is Down. The device changes the forwarding order each time it forwards a DHCP Discover message.
  • If the ip relay address cycle command is configured, the device forwards a DHCP Discover message to one DHCP server at a time and does not check whether the DHCP server status is Down. Each time the device receives a DHCP Discover message, it forwards the message to a different DHCP server to implement load balancing among DHCP servers.

Procedure

  • Specify an IP address for the DHCP server in the interface view.
    1. Run system-view

      The system view is displayed.

    2. (Optional) Run ip relay address cycle

      The DHCP server polling function is configured on the DHCP relay agent.

      By default, DHCP server polling is disabled on a DHCP relay agent.

    3. (Optional) Run dhcp set ttl { unvaried | ttl-value }

      The TTL value is set for DHCP Discovery messages after they are forwarded by the DHCP relay agent at Layer 3.

      By default, the TTL value of DHCP Discovery messages decreases by 1 after they are forwarded by the DHCP relay agent at Layer 3.

      NOTE:
      If the DHCP relay agent connects to a special client whose TTL value of DHCP Discovery messages is 1, and if there are routing devices between the DHCP relay agent and DHCP server, run the dhcp set ttl ttl-value command to specify a fixed TTL value (16 is recommended) for DHCP Discovery messages after they are forwarded by the DHCP relay agent at Layer 3.

    4. Run interface interface-type interface-number

      The interface view is displayed.

    5. Run dhcp relay server-ip ip-address

      An IP address is specified for a DHCP server.

      By default, no IP addresses are specified.

      Each interface supports a maximum of eight IP addresses of DHCP servers.

    6. (Optional) Run dhcp relay gateway-switch enable

      DHCP relay gateway switching is enabled.

      By default, DHCP relay gateway switching is disabled.

      After primary and secondary IP addresses are configured on an interface, the primary IP address functions as the gateway address in most cases. If clients cannot use the primary IP address to apply for IP addresses, configure DHCP relay gateway switching to allow the clients to use secondary IP addresses to apply for IP addresses. After DHCP relay gateway switching is enabled, configure address pools on the same network segment as the secondary IP addresses on the connected DHCP server.

      • The gateway address switches from the primary IP address to a secondary IP address only when a user fails at least three times to obtain an IP address using the primary IP address and the interval between the last failure and first failure exceeds 24 seconds.
      • Each interface supports one primary IP address and secondary IP addresses. The system tries the secondary IP addresses one by one based on the IP address configuration sequence until users successfully obtain IP addresses.

  • Specify an IP address for the DHCP server in the DHCP server group view.
    1. Run system-view

      The system view is displayed.

    2. (Optional) Run ip relay address cycle

      The DHCP server polling function is configured on the DHCP relay agent.

      By default, DHCP server polling is disabled on a DHCP relay agent.

    3. (Optional) Run dhcp set ttl { unvaried | ttl-value }

      The TTL value is set for DHCP Discovery messages after they are forwarded by the DHCP relay agent at Layer 3.

      By default, the TTL value of DHCP Discovery messages decreases by 1 after they are forwarded by the DHCP relay agent at Layer 3.

      NOTE:
      If the DHCP relay agent connects to a special client whose TTL value of DHCP Discovery messages is 1, and if there are routing devices between the DHCP relay agent and DHCP server, run the dhcp set ttl ttl-value command to specify a fixed TTL value (16 is recommended) for DHCP Discovery messages after they are forwarded by the DHCP relay agent at Layer 3.

    4. Run dhcp server group group-name

      A DHCP server group is created, and its view is displayed.

      By default, no DHCP server group is configured.

      A maximum of 32 DHCP server groups can be configured on a device.

    5. Run dhcp-server ip-address [ ip-address-index ]

      DHCP server members are configured in the DHCP server group.

      By default, no DHCP server member is configured in a DHCP server group.

      A maximum of 20 DHCP servers can be added to a DHCP server group.

    6. (Optional) Run gateway ip-address

      A gateway address is specified for clients.

      If the IP address of the interface that connects the DHCP relay agent to clients functions as the gateway address, skip this step.

      The gateway address specified in this step must be the same as the egress gateway address of clients specified on the DHCP server. If the device functions as the DHCP server, refer to Configuring a Gateway Address for Clients for details about how to specify the egress gateway address for clients.

    7. Run quit

      Return to the system view.

    8. Run interface interface-type interface-number

      The interface view is displayed.

    9. Run dhcp relay server-select group-name

      A DHCP server group is configured on the interface.

(Optional) Configuring Strategies for Processing Option 82 Information on a DHCP Relay Agent

Context

Option 82 is also called the Relay Agent Information Option. It records the location of a DHCP client, based on which a DHCP server can select address allocation policies including IP addresses and other network parameters. You can configure strategies for processing Option 82 information on a DHCP relay agent.

You are advised to perform the configuration on a user-side device. If the DHCP relay agent connects to a DHCP snooping-enabled device, configure the strategies for processing Option 82 information on the DHCP snooping device. When a device functions as the DHCP snooping device, for details on how to perform the configuration, see Inserting the Option 82 Field in a DHCP Message.

NOTE:

If the device functions as the first-hop DHCP relay agent, it can process Option 82 information. If the device functions as the second-hop or subsequent DHCP relay agent, it cannot process Option 82 information.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run dhcp relay trust option82

    The DHCP relay agent is enabled to trust Option 82.

    By default, a DHCP relay agent does not trust Option 82.

    When this function is enabled, the DHCP relay agent can receive and forward DHCP messages that carry Option 82. If the DHCP relay agent is disabled from trusting Option 82 using the undo dhcp relay trust option82 command, the device discards the DHCP messages carrying Option 82.

  3. Configure strategies for processing Option 82 information on the DHCP relay agent.

    • Configure the DHCP relay agent to insert the Option 82 field to DHCP messages in a VLAN view. This configuration takes effect on all DHCP messages from this VLAN received on the interfaces of the DHCP relay agent.

      1. Run vlan vlan-id

        The VLAN view is displayed.

      2. Run dhcp option82 { insert | rebuild } enable interface interface-type interface-number1 [ to interface-number2 ]

        The DHCP relay agent is enabled to insert the Option 82 field to received DHCP messages.

        By default, a DHCP relay agent is disabled from inserting the Option 82 field to received DHCP messages.

      3. Run quit

        Return to the system view.

    • Configure the DHCP relay agent to insert the Option 82 field to DHCP messages in an interface view. This configuration takes effect on DHCP messages received on the specified interface.

      1. Run interface interface-type interface-number

        The interface view is displayed.

      2. Configure strategies for processing Option 82 information in two methods. If the two methods are both used, method 2 takes effect.
        • Method 1:

          Run dhcp option82 { insert | rebuild } enable

          The DHCP relay agent is enabled to insert the Option 82 field to received DHCP messages.

          By default, a DHCP relay agent is disabled from inserting the Option 82 field to received DHCP messages.

          DHCP messages received on the DHCP relay agent may carry the Option 82 field. Select a strategy based on network requirements.

          • When insert is configured: If a DHCP message does not carry the Option 82 field, the DHCP relay agent inserts the Option 82 field. If a DHCP message carries the Option 82 field, the DHCP relay agent checks whether the Option 82 field contains remote-id. If yes, the Option 82 field remains unchanged; if no, the DHCP relay agent inserts remote-id.
          • When rebuild is configured: If a DHCP message does not carry the Option 82 field, the DHCP relay agent inserts the Option 82 field. If a DHCP message carries the Option 82 field, the DHCP relay agent deletes the original Option 82 field and inserts the locally configured Option 82 field.
        • Method 2:

          1. Run dhcp relay information enable

            The DHCP relay agent is enabled to support Option 82 field.

            By default, a DHCP relay agent does not support Option 82.

          2. Run dhcp relay information strategy { drop | keep | replace }

            A strategy for processing Option 82 information is configured on the DHCP relay agent.

            The default strategy is replace.

            DHCP messages received on the DHCP relay agent may carry the Option 82 field. Select a strategy based on network requirements.

            • When replace is configured: If a DHCP message does not carry the Option 82 field, the DHCP relay agent inserts the Option 82 field. If a DHCP message carries the Option 82 field, the DHCP relay agent deletes the original Option 82 field and inserts the locally configured Option 82 field.

            • When drop is configured: If a DHCP message does not carry the Option 82 field, the DHCP relay agent forwards the message directly without processing it. If a DHCP message carries the Option 82 field, the DHCP relay agent discards the Option 82 field and forwards the message.

            • When keep is configured: If a DHCP message does not carry the Option 82 field, the DHCP relay agent forwards the message directly without processing it. If a DHCP message carries the Option 82 field, the DHCP relay agent retains the Option 82 field and forwards the message.

      3. Run quit

        Return to the system view.

  4. (Optional) Set the format of the Option 82 field.

    Configure the format of the Option 82 field in the system or interface view. If the configuration is performed in the system view, it takes effect on all interfaces of the device. If the configuration is performed in an interface view, it takes effect only on the specified interface.

    If the strategy for processing Option 82 information is drop or keep on the DHCP relay agent, skip this step.

    • All Option82 fields configured in the system view or in the same interface view share a length of 1-255 bytes. If their total length exceeds 255 bytes, some Option82 information will be lost.

    • There is no limit on the number of Option 82 fields configured on the device. However, a large number of Option 82 fields will occupy a lot of memory and prolong the device processing time. To ensure device performance, you are advised to configure Option 82 fields based on the service requirements and device memory size.

    • In the system view:

      Run dhcp option82 [ vlan vlan-id ] [ ce-vlan ce-vlan-id ] [ circuit-id | remote-id ] format { default | common | extend | user-defined text }

      The format of the Option 82 field is configured.

      By default, the Option 82 field is in the default format.

    • In the interface view:

      1. Run interface interface-type interface-number

        The interface view is displayed.

      2. Run dhcp option82 [ vlan vlan-id ] [ ce-vlan ce-vlan-id ] [ circuit-id | remote-id ] format { default | common | extend | user-defined text }

        The format of the Option 82 field is configured.

        By default, the Option 82 field is in the default format.

      3. Run quit

        Return to the system view.

(Optional) Configuring User Entry Detection on a DHCP Relay Agent

Context

After user entry detection is enabled on a DHCP relay agent, the DHCP relay agent creates a user entry after a user obtains an IP address through DHCP relay.
  • When receiving a Release or Decline message from a DHCP client, the DHCP relay agent deletes the matching user entry.
  • When receiving an ACK message from the DHCP server, the DHCP relay agent checks whether the IP address and MAC address of the DHCP client match the user entry.
    • If the IP address and MAC address are the same as those in the user entry, the DHCP relay agent continues to forward the ACK message.
    • If the IP address and MAC address are different from those in the user entry, the DHCP relay agent sends a Decline message to the DHCP server and sends a NAK message to the DHCP client to prohibit the client from using the IP address.
NOTE:

When the number of user entries reaches the maximum value, the device does not record user entries for new online users, and does not perform address conflict detection for these users. Therefore, it is recommended that you reduce the lease time appropriately based on the actual usage scenario after configuring user entry detection on the DHCP relay agent. This configuration ensures that user entries of offline users can be cleared promptly and the device can perform address conflict detection for online users.

If the device is configured as a DHCP relay agent in proxy mode, new users cannot obtain IP addresses when the number of user entries reaches the maximum value. It is recommended that you reduce the lease time appropriately based on the actual usage scenario so that user entries of offline users can be cleared promptly and new users can go online properly.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run dhcp relay detect enable

    User entry detection is enabled on a DHCP relay agent.

    By default, user entry detection is disabled on a DHCP relay agent.

Verifying the Configuration
  • Run the display dhcp relay user-table { all | ip-address ip-address | mac-address mac-address } command to check user entry information on a DHCP relay agent.

Verifying the DHCP Relay Agent Configuration

Procedure

  • Run the display dhcp relay { all | interface interface-type interface-number } command to view information about the DHCP server or DHCP server group on the interface functioning as a DHCP relay agent.
  • Run the display dhcp server group [ group-name ] command to view the configuration of the DHCP server group.
  • Run the display dhcp relay user-table { all | ip-address ip-address | mac-address mac-address } command to view user entries on a DHCP relay agent.

Configuring a Device as a DHCP Client

Pre-configuration Tasks

Before configuring a DHCP client, complete the following tasks:

  • Configure a DHCP server.

  • (Optional) Configure a DHCP relay agent.

  • Configure a routing protocol between the device and DHCP server to ensure that there are reachable routes between them.

NOTE:

Only interfaces on the wired side of a device can function as DHCP clients.

(Optional) Configuring Attributes for a DHCP Client

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run dhcp client class-id class-id

    The DHCP client is configured to send DHCP Discovery messages that carry the Option 60 field.

    By default, the value of the Option 60 field is in the format of "huawei-device model"

    Option 60 identifies the vendor type and configuration of a DHCP client. Vendors can define the Option 60 field to convey specified identification information or configurations of clients to DHCP servers.

  3. Run interface vlanif interface-number

    The VLANIF interface view is displayed.

  4. Run dhcp client hostname hostname

    A host name is configured for the DHCP client.

    By default, no host name is configured for a DHCP client.

    A host name allows access to a DHCP client through a domain name. A domain name consists of a host name and domain name suffix.

  5. Run dhcp client client-id client-id

    An identifier is configured for the DHCP client.

    By default, a client's MAC address is used as its identifier.

    Client identifier information is entered in the Option 61 field to uniquely identify the DHCP client.

  6. Run dhcp client class-id class-id

    The DHCP client is configured to send DHCP Discovery messages that carry the Option 60 field.

    By default, the Option 60 field is not configured.

    The Option 60 field can be configured in the system view and in the interface view. The configuration in the interface view has a higher priority than that in the system view. That is, if the Option 60 field is configured in both views, the configuration in the interface view takes effect.

(Optional) Configuring an Expected Lease for a DHCP Client

Context

When a DHCP server dynamically allocates an IP address with a lease to a client, the DHCP server compares the configured lease with the expected lease of the client and selects the smaller value as the lease of the IP address. A device functioning as a DHCP client supports the configuration of an expected lease.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface interface-type interface-number

    The VLANIF interface view is displayed.

  3. Run dhcp client expected-lease time

    An expected lease is configured for the DHCP client.

    By default, no expected lease is configured for a DHCP client.

(Optional) Configuring the Gateway Detection Function on a DHCP Client

Context

A DHCP client enabled with the gateway detection function sends an ARP Request packet to detect the gateway status after obtaining an IP address. If the DHCP client receives no ARP Reply packet within the detection period, it considers the gateway address incorrect or the gateway device faulty, and then re-applies for an IP address.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface vlanif interface-number

    The VLANIF interface view is displayed.

  3. Run dhcp client gateway-detect period period retransmit retransmit timeout time

    The gateway detection function is configured on the DHCP client.

    By default, the gateway detection function is not configured on a DHCP client.

Enabling the DHCP Client Function

Context

After an interface is enabled with the DHCP client function, the interface can obtain network parameters including the IP address from the DHCP server.

If the allocated IP address and IP addresses of other interfaces are on the same network segment, the interface does not use this IP address and does not re-apply for an IP address. To allow the interface to re-apply for an IP address, run the shutdown and then the undo shutdown commands on the interface. Alternatively, run the undo ip address dhcp-alloc and then the ip address dhcp-alloc command on the interface.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface interface-type interface-number

    The VLANIF interface view is displayed.

  3. Run ip address dhcp-alloc

    The DHCP client function is enabled.

    By default, the DHCP client function is disabled on an interface.

Verifying the DHCP Client Configuration

Procedure

  • On a VLANIF interface enabled with the DHCP client function, run the display this command to view the configuration of the DHCP client.
  • Run the display dhcp client command to view the status of the DHCP client.

Configuring a Device as a BOOTP Client

Pre-configuration Tasks

Before configuring a device as a BOOTP client, complete the following tasks:

  • Configure a DHCP server.

  • (Optional) Configure a DHCP relay agent.

  • Configure a routing protocol between the device and DHCP server to ensure that there are reachable routes between them.

(Optional) Configuring Attributes for a BOOTP Client

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface interface-type interface-number

    The VLANIF interface view is displayed.

  3. Run dhcp client hostname hostname

    A host name is configured for the BOOTP client.

    By default, no host name is configured for a BOOTP client.

    A host name allows access to a BOOTP client through a domain name. A domain name consists of a host name and domain name suffix.

  4. Run dhcp client client-id client-id

    An identifier is configured for the BOOTP client.

    By default, a client's MAC address is used as its identifier.

(Optional) Configuring the Gateway Detection Function on a BOOTP Client

Context

A BOOTP client enabled with the gateway detection function sends an ARP Request packet to detect the gateway status after obtaining an IP address. If the BOOTP client receives no ARP Reply packet within the detection period, it considers the gateway address incorrect or the gateway device faulty, and then re-applies for an IP address.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface interface-type interface-number

    The VLANIF interface view is displayed.

  3. Run dhcp client gateway-detect period period retransmit retransmit timeout time

    The gateway detection function is configured on the BOOTP client.

    By default, the gateway detection function is not configured on a BOOTP client.

Enabling the BOOTP Client Function

Context

After an interface is enabled with the BOOTP client function, the interface can obtain network parameters including the IP address from the DHCP server.

If the allocated IP address and IP addresses of other interfaces are on the same network segment, the interface does not use the allocated IP address and does not re-apply for an IP address. To allow the interface to re-apply for an IP address, run the shutdown and then the undo shutdown commands on the interface. Alternatively, run the undo ip address bootp-alloc and then the ip address bootp-alloc commands on the interface.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface interface-type interface-number

    The VLANIF interface view is displayed.

  3. Run ip address bootp-alloc

    The BOOTP client function is enabled.

    By default, the BOOTP client function is disabled.

Verifying the DHCP Client Configuration

Procedure

  • On a VLANIF interface enabled with the DHCP client function, run the display this command to view the configuration of the DHCP client.
  • Run the display dhcp client command to view the status of the DHCP client.

Maintaining DHCP

Viewing Statistics About DHCP Messages

Context

Statistics about received and sent DHCP messages provide useful information for fault locating during routine maintenance.

Procedure

  • Run the display dhcp server statistics command to check statistics about DHCP messages sent and received on a DHCP server.
  • Run the display dhcp relay statistics command to check statistics about DHCP messages sent and received on a DHCP relay agent.
  • Run the display dhcp statistics command to view statistics about DHCP messages sent and received on a device.
Clearing Statistics About DHCP Messages

Context

Before collecting statistics about DHCP messages during routine maintenance, clear the existing statistics.

DHCP statistics cannot be restored after they are cleared. Exercise caution when performing this operation.

Procedure

  • Run the reset dhcp server statistics command to clear statistics about DHCP messages sent and received on a DHCP server.
  • Run the reset dhcp relay statistics command to clear statistics about DHCP messages sent and received on a DHCP relay agent.
  • Run the reset dhcp statistics command to clear statistics about DHCP messages sent and received on a device.
Resetting a DHCP Address Pool

Context

To force a DHCP server to re-allocate IP addresses to clients or to set IP addresses in an address pool to idle (idle IP addresses will be preferentially allocated), reset an address pool.

Procedure

  • Run the following commands to reset address pools on the device.

    • Interface address pool:

      reset ip pool interface interface-name { start-ip-address [ end-ip-address ] | all | conflict | expired | used }

    • Global address pool:

      reset ip pool name ip-pool-name { start-ip-address [ end-ip-address ] | all | conflict | expired | used }

  • Configure a DHCP relay agent to request a DHCP server to release IP addresses of clients.

    After a DHCP relay agent is configured to request the DHCP server to release IP addresses of clients, it sends DHCP Release messages to the specified DHCP server. After receiving the message, the DHCP server restores specified IP addresses to the idle status. Released IP addresses can then be allocated to other clients. Run the following commands to configure the DHCP relay agent to request the DHCP server to release IP addresses of clients:

    1. Run the system-view command to enter the system view.

    2. Run interface interface-type interface-number

      The VLANIF interface view is displayed.

    3. Run the dhcp relay release client-ip-address mac-address [ server-ip-address ] command to request the DHCP server to release IP addresses allocated to DHCP clients.

      • When you run the preceding command in the system view:
        • If no DHCP server is specified, the DHCP relay agent sends DHCP Release messages to all DHCP servers connected to DHCP relay-enabled interfaces.
        • If a DHCP server is specified, the DHCP relay agent sends DHCP Release messages to only the specified DHCP server.
      • When you run the preceding command in the interface view:
        • If no DHCP server is specified, the DHCP relay agent sends DHCP Release messages to the DHCP server connected to this interface.
        • If a DHCP server is specified, the DHCP relay agent sends DHCP Release messages to only the specified DHCP server.

Locking a DHCP Address Pool

Context

When a DHCP server is migrated, address pools on the DHCP server need to be transferred to a DHCP server on the live network. To prevent impacting clients that have obtained IP address from the to-be-migrated DHCP server, lock the address pools on the DHCP server. After the migration, new users apply for IP addresses from the new address pool.

Procedure

  1. Run the system-view command to enter the system view.
  2. Run the ip pool ip-pool-name command to enter the global address pool view.
  3. Run the lock command to lock the address pool.

    By default, address pools on a device are not locked.

Translation
Download
Updated: 2019-01-11

Document ID: EDOC1000176006

Views: 129791

Downloads: 312

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next