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

CLI-based Configuration Guide - IP Service

AR500, AR510, AR531, AR550, AR1500, and AR2500 V200R010

This document describes the concepts and configuration procedures of IP Service features on the device, and provides the configuration examples.
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 Client

Configuring a DHCP Client

Enabling the DHCP Client Function

Context

Before a device can function as a DHCP client, you must enable the DHCP client function.

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. Enter the system view.

    system-view

  2. Enter the interface view or sub-interface view.

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

  3. Enable the DHCP client function.

    ip address dhcp-alloc

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

(Optional) Configuring Attributes

Context

Configuring attributes allows you to specify certain parameters for the DHCP client. You can configure the Option 60 field in either the system view or the interface view. The configuration in the interface view has a higher priority and overrides the configuration in the system view.

Procedure

  1. Enter the system view.

    system-view

  2. Configure the DHCP client to send DHCP Discover messages that carry the Option 60 field.

    dhcp client class-id class-id

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

  3. Enter the interface view or sub-interface view.

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

  4. Configure a hostname for the DHCP client.

    dhcp client hostname hostname

    By default, no hostname is configured for a DHCP client.

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

  5. Configure an identifier for the DHCP client.

    dhcp client client-id client-id

    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. Configure the DHCP client to send DHCP Discover messages that carry the Option 60 field.

    dhcp client class-id class-id

    By default, the Option 60 field is not configured.

(Optional) Configuring an Expected Lease

Context

To enable a DHCP client to determine the lease length, configure an expected lease on the DHCP client. If the expected lease is longer than the global lease, the global lease takes effect.

Procedure

  1. Enter the system view.

    system-view 

  2. Enter the interface view or sub-interface view.

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

  3. Configure the expected lease.

    dhcp client expected-lease time

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

(Optional) Configuring Gateway Detection

Context

To enable a DHCP client to detect the status of the gateway, enable the gateway detection function. 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. Enter the system view.

    system-view

  2. Enter the interface view or sub-interface view.

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

  3. Configure the gateway detection function on the DHCP client.

    dhcp client gateway-detect period period retransmit retransmit timeout time

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

(Optional) Configuring a DHCP Client to Dynamically Obtain Routing Information

Context

To allow a DHCP client to communicate with other network devices, you need to configure a route in which the next hop address is the gateway address of the client. If the gateway address of the client is dynamically obtained from the DHCP server and the route is statically configured on the client, the static route must be manually modified when the gateway address changes. After the DHCP client is configured to dynamically obtain routing entries through DHCP, the next hop address in the static route is automatically updated when the gateway address changes, lowering maintenance costs.

A DHCP server can allocate routing entries to DHCP clients. On a device functioning as the DHCP client, you can set the priorities of routing entries allocated by the DHCP server so that the DHCP client can dynamically update its routing table.

Procedure

  1. Enter the system view.

    system-view

  2. Configure the DHCP client to obtain routing entries through DHCP.

    ip route ip-address { mask | mask-length } interface-type interface-number dhcp [ preference-value  ]

    By default, a DHCP client does not obtain routing entries through DHCP.

  3. Enter the interface view or sub-interface view.

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

  4. Set the priority of routing entries allocated by the DHCP server to DHCP clients.

    dhcp client default-route preference preference-value

    The default priority of routing entries allocated by the DHCP server to DHCP clients is 60.

(Optional) Configuring Option Information Requested by a DHCP Client

Context

The Option 55 field in DHCP Request messages is used to set the request option list. DHCP clients use this option to specify network configuration parameters that need to be obtained from the DHCP server. By default, the Option 55 field carries request options 3, 6, 15, 28, 33, 44, 121, and 184 by default. You can run the dhcp client request option-list exclude command to set a list of default options that are excluded from the Option 55 field or run the dhcp client request option-list command to set a list of other options that the Option 55 field carries besides the default options based on network requirements. The other options include option 4, 7, 17, 42, 43, 66, 67, 120, and 129.

For option meanings, see DHCP Messages in CLI-based Configuration - IP Service Configuration Guide - DHCP Configuration.

Procedure

  1. Enter the system view.

    system-view

  2. Enter the interface view or sub-interface view.

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

  3. Configure a list of default request options that are excluded from the Option 55 field in DHCP Request messages.

    dhcp client request option-list exclude option-code &<1-8>

    By default, the Option 55 field in DHCP Request messages carries request options 3, 6, 15, 28, 33, 44, 121, and 184 by default.

  4. Configure a list of request options that the Option 55 field in DHCP Request messages carries besides the default options.

    dhcp client request option-list option-code &<1-9>

    By default, the Option 55 field in DHCP Request messages carries request options 3, 6, 15, 28, 33, 44, 121, and 184 by default.

(Optional) Configuring the DHCP Client to Deliver Static ARP Entries

Context

When a router functions as a DHCP client and an LTE modem functions as a DHCP server, the DHCP client delivers a static ARP entry after it receives a DHCP ACK packet from the DHCP server.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface interface-type interface-number

    The interface view is displayed.

  3. Run dhcp link arp

    Configure an interface of a DHCP client to deliver a static ARP entry after it receives a DHCP ACK packet from the DHCP server.

    By default, an interface of a DHCP client does not deliver a static ARP entry after it receives a DHCP ACK packet from the DHCP server.

Verifying the DHCP Client Configuration

Procedure

  • On an 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.
Translation
Download
Updated: 2019-05-20

Document ID: EDOC1100034231

Views: 80317

Downloads: 51

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