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

CX11x, CX31x, CX710 (Earlier Than V6.03), and CX91x Series Switch Modules V100R001C10 Configuration Guide 12

The documents describe the configuration of various services supported by the CX11x&CX31x&CX91x series switch modules The description covers configuration examples and function configurations.
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

This section describes the configuration methods of DHCP.

Configuring a DHCP Server Based on the Global Address Pool

If a DHCP server based on a global address pool is configured, all online users of the server can obtain IP addresses from this address pool.

Pre-configuration Tasks

Before configuring a DHCP server based on the global address pool, complete the following tasks:

  • Ensuring that the link between the DHCP client and the device works properly and the DHCP client can communicate with the device

  • (Optional) Configuring the DNS service for the DHCP client

  • (Optional) Configuring the NetBIOS service for the DHCP client

  • (Optional) Configuring routes from the device to the DNS server and the NetBIOS server

  • (Optional) Configuring the customized DHCP option

Configuring the Global Address Pool

Context

The global address pool attributes include the IP address range, IP address lease, IP addresses not to be automatically allocated, and IP addresses to be statically bound to MAC addresses. IP addresses in the global address pool can be assigned dynamically or bound manually as required.

Procedure

  1. Run:

    system-view

    The system view is displayed.

  2. Run:

    dhcp enable

    DHCP is enabled.

  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 exists on the switch modules.

  4. Run:

    gateway-list ip-address &<1-8>

    The egress gateway address is configured for the global address pool of a DHCP server.

    By default, no egress gateway address is specified.

    NOTE:

    When a DHCP client connects to the server or host outside the network segment, data must be forwarded through the egress gateway.

    To load balance traffic and improve network reliability, configure multiple gateways. An address pool can be configured with a maximum of eight gateway addresses. Gateway addresses cannot be subnet broadcast addresses.

  5. Run:

    network ip-address [ mask { mask | mask-length } ]

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

    By default, no network segment address for a global address pool is specified.

    An address pool can contain only one address segment. The address range of the address pool is set by the mask.

    NOTE:

    When configuring the range of dynamically assignable IP addresses in the global address pool, ensure that the range is the same as the network segment on which the DHCP server interface address or the DHCP relay agent interface address resides. This avoids incorrect assignment of IP addresses.

  6. (Optional) Run:

    lease { day day [ hour hour [ minute minute ] ] | unlimited }

    The IP address lease is set.

    By default, the IP address lease is one day.

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

  7. (Optional) Run:

    excluded-ip-address start-ip-address [ end-ip-address ]

    The IP addresses that cannot be automatically allocated in the global address pool are configured.

    By default, all IP addresses in the address pool can be automatically assigned to clients.

    Some IP addresses in the global address pool are reserved for other services, for example, the IP address of the DNS server cannot be allocated to clients. If you run this command multiple times, you can set multiple IP address ranges that cannot be automatically allocated in the DHCP address pool.

  8. (Optional) Run:

    static-bind ip-address ip-address mac-address mac-address

    An IP address in the global address pool is statically bound to the MAC address of a DHCP client.

    By default, the IP address in a global address pool is not bound to any MAC address.

    When a client requires a fixed IP address, bind an idle IP address in the address pool to the client MAC address.

    NOTE:

    When the IP address in the global address pool is statically bound to a MAC address, the IP address must be in the range of IP addresses that can be allocated dynamically.

  9. (Optional) Run:

    next-server ip-address 

    The server IP address for DHCP clients is configured.

    By default, no server IP address is specified.

  10. (Optional) Run:

    vpn-instance vpn-instance-name

    The IP address pool is binded to a VPN instance.

    By default, an IP address pool is not bound to any VPN instance.

  11. (Optional) Run:

    lock

    The IP address pool is locked.

    By default, the IP address pool is unlocked.

  12. Run:

    quit

    The system view is displayed.

  13. (Optional) Run:

    dhcp server bootp

    The DHCP server is configured to respond to BOOTP requests.

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

  14. (Optional) Run:

    dhcp server bootp automatic

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

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

    When the device functions as the DHCP server, the device can allocate IP addresses to BOOTP clients if the BOOTP clients reside on the same network as the DHCP server. You can run the dhcp server bootp automatic command to dynamically allocate IP addresses. You can also run the static-bind ip-address ip-address mac-address mac-address command to allocate IP addresses to BOOTP clients in the static binding mode.

  15. Run:

    commit 

    The configuration is committed.

(Optional) Configuring the DNS Service and NetBIOS Service on the DHCP Client

Context

To ensure normal operations of DHCP clients, you can specify the DNS server address and the NetBIOS server address when the DHCP server assigns an IP address to the DHCP client.NetBIOS:Network Basic Input Output System. When a DHCP client uses the NetBIOS protocol for communication, host names must be mapped to IP addresses. Based on the modes of obtaining mapping, NetBIOS nodes are classified into the following types:
  • b-node: indicates a node in broadcast mode. This node obtains mappings in broadcast mode.

  • p-node: indicates a node in peer-to-peer mode. This node obtains mappings by communicating with the NetBIOS server.

  • m-node: indicates a node in mixed mode. An m-node is a p-node that has some broadcast features.

  • h-node: indicates a node in hybrid mode. An h-node is a b-type node enabled with the end-to-end communication mechanism.

Procedure

  1. Run:

    system-view

    The system view is displayed.

  2. Run:

    ip pool ip-pool-name

    The IP address pool view is displayed.

  3. Run:

    domain-name domain-name

    The DNS domain name to be assigned to a DHCP client is configured.

  4. Run:

    dns-list ip-address &<1-8>

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

    To load balance the traffic and improve network reliability, configure multiple DNS servers. Each address pool can be configured with a maximum of eight DNS server addresses.

  5. Run:

    nbns-list ip-address &<1-8>

    The IP address of the NetBIOS server used by the DHCP client is assigned.

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

  6. Run:

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

    The NetBIOS node type of the DHCP client is configured.

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

  7. Run:

    commit 

    The configuration is committed.

(Optional) Configuring a DHCP Option for the Global Address Pool

Context

As DHCP develops, new options are emerging. To use these options, add them to the attribute list of the DHCP server manually. If the DHCP server is configured with the options, the DHCP client obtains the configuration of the options from the DHCP packet replied by the DHCP server when the client requests an IP address from the server.

Procedure

  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:

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

    A user-defined option that a DHCP server assigns to a DHCP client is specified.

    No user-defined option is specified by default.

    NOTE:
    • To ensure accuracy, read the Request For Comments (RFC) before configuring options.

    • When the password is contained in option, the ascii or hex type is insecure. Set the option type to cipher. A secure password should contain at least two types of the following: lowercase letters, uppercase letters, number, and special characters. In addition, the password must consist of six or more than six characters.

  4. Run:

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

    A classless static route that a DHCP server assigns to a DHCP client is specified.

    No classless static route is specified by default.

  5. Run:

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

    The Option184 that a DHCP server delivers to a DHCP client is specified.

    The Option184 is not specified by default.

  6. Run:

    commit 

    The configuration is committed.

(Optional) Preventing Repeated IP Address Allocation

Context

Before assigning an address to a client, the switch modules used as the DHCP server needs to ping the IP address to avoid address conflicts.

After the dhcp server ping command is executed, the DHCP server can prevent repeated IP address allocation. The DHCP server pings an IP address to be allocated. If there is no response to the ping packet within a certain period, the DHCP server continues to send ping packets to this IP address until the number of ping packets reaches the maximum value. If there is still no response, this IP address is not in use, and the DHCP server allocates the IP address to a client.

Duplicate IP address detection on the DHCP server should not be too long. Otherwise, the client cannot obtain an IP address. It is recommended that the configured total detection time (Maximum number of send ping packets x Maximum response time) be smaller than 8s.

Procedure

  1. Run:

    system-view

    The system view is displayed.

  2. Run:

    dhcp server ping packet number

    The maximum number of ping packets to be sent by the switch modules is set.

    By default, the DHCP server sends 0 ping packets, indicating that no ping operation is performed.

  3. Run:

    dhcp server ping timeout milliseconds

    The period in which the switch modules waits for the response to a ping packet is set.

    By default, the period in which the switch modules waits for the response to a ping packet is 500 ms.

  4. Run:

    commit 

    The configuration is committed.

(Optional) Configuring Automatic Saving of DHCP Data

Context

When the device functions as the DHCP server, you can enable automatic saving of DHCP data so that IP address information is saved to the storage device periodically.

You can configure the device to save DHCP data to the storage device. When a fault occurs, you can restore data from the storage device.

Procedure

  1. Run:

    system-view

    The system view is displayed.

  2. Run:

    dhcp server database enable

    The function that saves DHCP data to the storage device is enabled.

    By default, DHCP data is not saved to the storage device.

    After this command is executed, the system generates the lease.txt and conflict.txt files and saves them in the dhcp folder of the storage device. The two files save the address lease information and address conflict information. Run the command display dhcp server database to check the storage device for saving DHCP data.

  3. Run:

    dhcp server database write-delay interval

    The interval for saving DHCP data is set.

    After the device is configured to automatically save DHCP data, the device saves data every 300 seconds by default and the latest data overwrites the previous data.

  4. Run:

    dhcp server database recover

    The DHCP data in the storage device is restored.

    After this command is executed, the device restores DHCP data from the storage device during a restart.

  5. Run:

    commit 

    The configuration is committed.

(Optional) Configuring the DHCP Server to trust Option 82

Procedure

  1. Run:

    system-view

    The system view is displayed.

  2. Run:

    undo dhcp server option82-trusted disable 

    The switch modules is configured to trust Option 82.

    By default, the DHCP server trusts Option 82.

  3. Run:

    commit 

    The configuration is committed.

Checking the Configuration

Procedure

  • Run the display ip pool [ name ip-pool-name [ start-ip-address [ end-ip-address ] | all | conflict | expired | used ] ] command to check information about the specified global address pool.
  • Run the display dhcp server database command to check information about the DHCP database.

Configuring a DHCP Relay Agent

By using a DHCP relay agent, a DHCP client can communicate with a DHCP server on another network segment to obtain an IP address and other configuration information.

Pre-configuration Tasks

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

  • Configuring a DHCP server

  • Configuring a route from the device used as the DHCP relay agent to the DHCP server

Configuration Process

Figure 6-33 shows the configuration process.

Figure 6-33 DHCP relay agent configuration process

Configuring DHCP Relay on an Interface

Context

When the network where a DHCP client resides does not have a DHCP server, a DHCP relay agent can be configured to forward DHCP messages of the client to a DHCP server.

NOTE:

A DHCP message is forwarded between a DHCP client and a DHCP server at most 16 times, and then the DHCP message is discarded.

Procedure

  1. Run:

    system-view

    The system view is displayed.

  2. Run:

    dhcp enable

    DHCP is enabled.

  3. Run:

    interface interface-type interface-number

    The interface view is displayed.

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

    If an Ethernet interface already has Layer 2 configuration, this command fails to be executed on the interface. Before running this command on the interface, delete all the Layer 2 configuration of the interface.

    NOTE:

    If many Ethernet interfaces need to be switched to Layer 3 mode, run the undo portswitch batch interface-type { interface-number1 [ to interface-number2 ] } &<1-10> command in the system view to switch these interfaces to Layer 3 mode in batches.

  5. Run:

    ip address ip-address { mask | mask-length }

    An IP address is assigned to the interface.

  6. Run:

    dhcp select relay

    The DHCP relay function is enabled on the interface.

  7. Run:

    commit

    The configuration is committed.

Follow-up Procedure

When the DHCP relay function is enabled on an interface, specify the DHCP server IP address on the interface in either of the following ways:
Configuring a Destination DHCP Server Group

Context

After a DHCP server group is created and server IP addresses are added to the group, the switch modules used as the DHCP relay agent can forward messages to multiple servers.

Procedure

  1. Run:

    system-view

    The system view is displayed.

  2. Run:

    dhcp relay server group group-name

    A DHCP server group is created and the DHCP server group view is displayed.

    You can configure a maximum of 256 DHCP server groups in the system, and a maximum of 20 DHCP servers in a DHCP server group.

  3. Run:

    server ip-address [ ip-address-index ]

    A DHCP server is added to a DHCP server group.

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

  4. Run:

    gateway ip-address

    A gateway address is configured for the DHCP server.

  5. (Optional) Run:

    vpn-instance vpn-instance-name

    The DHCP server group is bound to the created VPN instance.

  6. Run:

    commit

    The configuration is committed.

Binding an Interface to a DHCP Server

Context

After the DHCP relay function is enabled on an interface, bind a DHCP server group to the interface so that DHCP clients can access DHCP servers in the bound server group.

Procedure

  1. Run:

    system-view

    The system view is displayed.

  2. Run:

    interface interface-type interface-number

    The interface view is displayed.

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

    If an Ethernet interface already has Layer 2 configuration, this command fails to be executed on the interface. Before running this command on the interface, delete all the Layer 2 configuration of the interface.

    NOTE:

    If many Ethernet interfaces need to be switched to Layer 3 mode, run the undo portswitch batch interface-type { interface-number1 [ to interface-number2 ] } &<1-10> command in the system view to switch these interfaces to Layer 3 mode in batches.

  4. You can bind a DHCP relay interface to a DHCP server group or a DHCP server.

    • Bind a DHCP relay interface to a DHCP server group.

      Run:

      dhcp relay binding server group group-name

      The DHCP relay interface is bound to a DHCP server group.

    • Bind a DHCP relay interface to a DHCP server.

      1. Run:

        dhcp relay binding server ip ip-addresss

        The DHCP server IP address is specified on an interface enabled with DHCP relay.

      2. Run:

        dhcp relay gateway ip-address

        A gateway address is specified for the DHCP relay agent.

        By default, no gateway address is specified for the DHCP relay agent.

  5. (Optional) Run:

    dhcp relay gateway-switch enable

    DHCP relay gateway switching is enabled.

    By default, DHCP relay gateway switching is disabled.

  6. Run:

    commit

    The configuration is committed.

(Optional) Configuring the DHCP Relay Agent to Send DHCP Release Messages

Context

If a user is forcibly disconnected, you can manually release the IP address assigned to the user on the DHCP server. You can configure the DHCP relay agent to actively send DHCP Release messages to the DHCP server. The DHCP server then releases the specified IP addresses.

Procedure

  1. Run:

    system-view

    The system view is displayed.

  2. (Optional) Run:

    interface interface-type interface-number

    The interface view is displayed.

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

    If an Ethernet interface already has Layer 2 configuration, this command fails to be executed on the interface. Before running this command on the interface, delete all the Layer 2 configuration of the interface.

    NOTE:

    If many Ethernet interfaces need to be switched to Layer 3 mode, run the undo portswitch batch interface-type { interface-number1 [ to interface-number2 ] } &<1-10> command in the system view to switch these interfaces to Layer 3 mode in batches.

  4. Run:

    dhcp relay release client-ip-address mac-address [ server-ip-address ]

    The DHCP relay agent is configured to send DHCP Release messages to the DHCP server.

    • When you use the dhcp relay release command in the system view:
      • If no DHCP server is specified, the DHCP relay agent will send DHCP Release messages to the servers in all DHCP server groups bound to the DHCP relay interfaces.
      • If a DHCP server is specified, the DHCP relay agent sends DHCP Release messages to only the specified DHCP server.
    • When you use the dhcp relay release command in the interface view:
      • If no DHCP server is specified, the DHCP relay agent will send DHCP Release messages to all the servers in the DHCP server group bound to this VLANIF interface.
      • If a DHCP server is specified, the DHCP relay agent sends DHCP Release messages to only the specified DHCP server.

Checking the Configuration

Procedure

  • Run the display dhcp relay interface interface-type interface-number command to view the DHCP server group or the DHCP servers on the DHCP relay interface.
  • Run the display dhcp relay server group [ group-name ] command to view the DHCP server group configuration.
Translation
Download
Updated: 2019-08-09

Document ID: EDOC1000041694

Views: 58447

Downloads: 3621

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