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

S2720, S5700, and S6720 V200R013C00

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 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 ]
    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. Enable the DHCP client function.

    ip address dhcp-alloc

    By default, the DHCP client function is enabled on VLANIF1 of the S1720GW, S1720GWR, S1720GW-E, and S1720GWR-E. The DHCP client function is disabled on the interfaces of other switches.

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

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

  7. 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 ]
    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 the expected lease.

    dhcp client expected-lease time

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

  5. Renew the lease of the DHCP client's IP address.

    dhcp client renew
    NOTE:
    This command takes effect only if an IP address is already assigned.

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

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

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-04-20

Document ID: EDOC1100065678

Views: 25069

Downloads: 163

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