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

Configuration Guide - IP Service

S1720, S2700, S5700, and S6720 V200R012(C00 and C20)

This document describes the configurations of IP Service, including IP address, ARP, DHCP, DHCP policy VLAN, DNS, mDNS gateway, mDNS relay, UDP Helper, IP performance optimization, IPv6, DHCPv6, IPv6 DNS, IPv6 over IPv4 tunnel, and IPv4 over IPv6 tunnel.
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 a DHCP Server to Allocate IP Addresses to Clients

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[.subinterface-number ]

      The interface view or sub-interface view is displayed.

      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support sub-interfaces.

    4. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.
      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support switching between Layer 2 and Layer 3 modes.

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

    5. (Optional) Run vpn-instance vpn-instance-name

      A VPN instance is configured for the address pool.

      By default, no VPN instance is configured for an address pool.

      In most cases, an address pool allocates IP addresses to clients on only one network segment to prevent IP address conflicts. In a BGP/MPLS IP VPN scenario, different VPNs use IP addresses on the same network segment. If clients in different VPNs apply to the same DHCP server for IP addresses, perform this step to use the same address pool to allocate IP addresses on the same network segment to the clients.

      Only the S1720GF, S1720GW, S1720GW-E, S1720GWR, S1720GWR-E, S1720GFR-P, S1720X, S1720X-E, S2720EI, S5720EI, S5720HI, S5720I-SI, S5720LI, S5720S-LI, S5720S-SI, S5720SI, S5730HI, S5730S-EI, S5730SI, S6720EI, S6720HI, S6720LI, S6720S-EI, S6720S-LI, S6720S-SI, and S6720SI support this step.

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[.subinterface-number ]

      The interface view or sub-interface view is displayed.

      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support sub-interfaces.

    3. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.
      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support switching between Layer 2 and Layer 3 modes.

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

      The interface IP address is configured.

    5. 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[.subinterface-number ]

      The interface view or sub-interface view is displayed.

      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support sub-interfaces.

    3. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.
      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support switching between Layer 2 and Layer 3 modes.

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

    5. 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 in the S1720, S2700, S5700, and S6720 V200R012(C00&C20) Configuration Guide - Security.

(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[.subinterface-number ]

      The interface view or sub-interface view is displayed.

      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support sub-interfaces.

    3. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.
      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support switching between Layer 2 and Layer 3 modes.

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

    5. 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[.subinterface-number ]

      The interface view or sub-interface view is displayed.

      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support sub-interfaces.

    3. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.
      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support switching between Layer 2 and Layer 3 modes.

    4. 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.
  • IP addresses that are used can also be statically bound to MAC addresses or unbound from MAC addresses. When an IP address is statically bound to a MAC address, ensure that the MAC address to be bound is the same as the MAC address of the user who actually uses the IP address.
  • After an IP address is bound to a MAC address, the IP address does not expire. After an automatically allocated IP address is statically bound to a MAC address, the lease time of the IP address becomes unlimited. After the static binding between the IP address and the MAC address is deleted, the lease time of the IP address becomes the same as that configured in the address pool.
The binding of IP addresses and MAC addresses is used in DHCP static allocation, IPSG (for details on how to configure IPSG, see IPSG Configuration in the S1720, S2700, S5700, and S6720 V200R012(C00&C20) Configuration Guide - Security), and static ARP. Table 3-9 lists different usage scenarios and implementations of these functions.
Table 3-9  Differences between DHCP static allocation, IPSG, and static ARP
Function Scenario Implementation
DHCP static allocation

Some clients (such as servers and PCs) require fixed IP addresses from a DHCP server.

The MAC addresses of these clients are bound to fixed IP addresses. When such a client applies to the DHCP server for an IP address, the DHCP server searches the binding entries for the MAC address of the client and allocates the matched IP address to the client.

IPSG
Attacks including IP address spoofing and ARP spoofing need to be prevented:
  • IP address spoofing: An attacker uses a forged IP address and its own MAC address to obtain rights of the attacked device and intercept packets destined for the attacked device.
  • ARP spoofing: An attacker sends ARP packets using a forged MAC address to intercept packets destined for the attacked device or using the MAC address of the gateway to intercept all packets destined for the gateway.

The mapping between IP addresses and MAC addresses is set up on a device. When receiving an ARP Request packet, the device searches for the mapped MAC address based on the source IP address of the packet and compares the mapped MAC address with the source MAC address in the packet header. If the two MAC addresses are different from each other, the device considers the packet invalid and discards it.

Static ARP
The mapping between IP addresses and MAC addresses is manually configured in the following scenarios:
  • Packets whose destination IP addresses are not on the local network segment need to be forwarded by a gateway on the local network segment.
  • Destination IP addresses of invalid packets need to be bound to a nonexistent MAC address to filter them out.
  • Critical devices need to forward packet securely and be protected against attacks, such as ARP flooding. In this situation, static ARP entries can be configured to bind MAC addresses to specific IP addresses. Network attackers cannot modify the mapping between the IP and MAC addresses, which ensures communication between the two devices.

The mapping between IP addresses and MAC addresses is set up on a device. When receiving an ARP Request packet, the device searches for the MAC address mapped to the IP address in the packet and responds with an ARP Reply packet.

Static ARP entries are manually configured and maintained. These entries are neither aged nor overwritten by dynamic ARP entries, and therefore improve communication security.

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[.subinterface-number ]

      The interface view or sub-interface view is displayed.

      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support sub-interfaces.

    3. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.
      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support switching between Layer 2 and Layer 3 modes.

    4. 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[.subinterface-number ]

      The interface view or sub-interface view is displayed.

      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support sub-interfaces.

    3. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.
      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support switching between Layer 2 and Layer 3 modes.

    4. 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 2.

    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 7200 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[.subinterface-number ]

      The interface view or sub-interface view is displayed.

      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support sub-interfaces.

    3. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.
      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support switching between Layer 2 and Layer 3 modes.

    4. 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[.subinterface-number ]

      The interface view or sub-interface view is displayed.

      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support sub-interfaces.

    3. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.
      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support switching between Layer 2 and Layer 3 modes.

    4. 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 Record Logs When Allocating IP Addresses

Context

When a DHCP server allocates IP addresses to clients, configure the server to record address allocation logs, facilitating routine maintenance and fault locating.

NOTE:

With this log function enabled, if a large number of DHCP clients request IP addresses from the DHCP server, the server frequently records logs. The server performance may therefore be affected.

Procedure

  • Interface address pool:
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number[.subinterface-number ]

      The interface view or sub-interface view is displayed.

      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support sub-interfaces.

    3. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.
      NOTE:

      Only the S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI support switching between Layer 2 and Layer 3 modes.

    4. Run dhcp server logging [ allocation-fail | allocation-success | release | renew-fail | renew-success | detect-conflict | recycle-conflict ] *

      The DHCP server is enabled to record IP address allocation logs.

      By default, the log function 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 logging [ allocation-fail | allocation-success | release | renew-fail | renew-success | detect-conflict | recycle-conflict ] *

      The DHCP server is enabled to record IP address allocation logs.

      By default, the log function is disabled.

Translation
Download
Updated: 2018-12-24

Document ID: EDOC1100038342

Views: 90215

Downloads: 291

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