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

NE20E-S2 V800R010C10SPC500 Configuration Guide - IP Services 01

This is NE20E-S2 V800R010C10SPC500 Configuration Guide - IP Services

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 Relay

Configuring DHCP Relay

This section describes how to configure DHCP relay so that DHCP messages can be relayed between DHCP clients and the DHCP server that reside on different network segments.

Usage Scenario

As shown in Figure 4-1, DHCP clients are located on network A, and the DHCP server is located on network B. The DHCP clients request configuration parameters, such as IP addresses from the DHCP server. To allow the DHCP clients to obtain IP addresses from the DHCP server, configure DHCP relay so that the DHCP relay agent can forward DHCP messages between the DHCP clients and the DHCP server.

Figure 4-1 DHCP relay networking

Pre-configuration Tasks

Before configuring DHCP relay, complete the following tasks:

  • Configure a DHCP server.
  • Configure a DHCP relay interface.
  • Configure a route from the DHCP relay agent to the DHCP server.

Configuration Procedures

Figure 4-2 Flowchart for configuring DHCP relay

Configuring Relay

After a DHCP relay agent is configured, it can forward DHCP Request messages form DHCP clients to the DHCP server on a different network segment.

Context

If the DHCP clients and DHCP server reside on different network segments, configure DHCP relay on an interface to forward DHCP Request messages from the DHCP clients to the DHCP server so that the clients can dynamically obtain IP addresses from the DHCP server.

If the DHCP relay has multiple clients, and multiple interfaces on the DHCP relay function as gateways, each gateway uses a public IP address, which wastes resources. If the relay interface on a router uses an unnumbered address as the gateway address, public IP address resources will be greatly saved.

If a relay interface uses an unnumbered IP address, the DHCP relay performs the following operations to ensure DHCP packet forwarding:
  • The DHCP relay generates a user table for the users who go online from the relay interface and saves information, such as users' MAC addresses, online interface, and belonging VLAN.
  • Upon receipt of a response packet from the server, the DHCP relay searches the user table based on the chaddr field for the corresponding online interface and forwards the response packet from this interface.
In addition, the DHCP relay generates two entries after a response packet is received from the server.
  • ARP entry used to notify the ARP module of adding online users
  • Entry used to notify the route management module of delivering the user's host routes
In this way, when forwarding network-to-user traffic, the DHCP relay agent can find host routes based on the destination IP addresses (IP addresses assigned to users) and locate the outbound interfaces (user access interfaces) for DHCP response packets. Based on the ARP entries, the relay agent can obtain the MAC addresses of users.

Procedure

  • Configure basic DHCP relay functions on a common interface.
    1. Run system-view

      The system view is displayed.

    2. Run dhcp enable

      DHCP is enabled globally.

    3. (Optional) Run dhcp-server packet-distribute giaddr

      The relay device is enabled to forward reply packets based on the GIADDR field value.

      In a scenario where a DHCP client applies for IP addresses from the DHCP server through a relay device, if the DHCP client uses the same MAC address but different sub-interfaces to request for IP addresses in different network segments through the BRAS and DHCP relay, the relay device may send return packets to the BAS user upon receipt of DHCP reply packets from the DHCP server. This is because the MAC address of the BRAS is the same as that of the DHCP relay. As a result, the DHCP relay user fails to go online. To address this problem, run the dhcp-server packet-distribute giaddr command to enable a relay device to determine whether to forward the reply packets sent by the DHCP server to the BAS user or DHCP relay user based on the GIADDR field value.

    4. Run interface interface-type interface-number

      The interface view is displayed.

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

      The primary IP address is configured for the interface.

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

      The secondary IP address is configured for the interface.

    7. Run dhcp select relay

      DHCP relay is enabled on the interface.

    8. Run ip relay address ip-address [ dhcp-option { code_60 [ option-text ] | code_1to59 | code_61to254 } ]

      A DHCP server address is associated with the relay interface based on a DHCP option or Option 60.

    9. (Optional) Run ip relay giaddr ip-address [ dhcp-option { code_60 [ option-text ] | code_1to59 | code_61to254 } ]

      A DHCP relay gateway address is configured for the interface.

    10. (Optional) Run dhcp relay source-ip-address ip-address [ dhcp-option { code_60 [ option-text ] | code_1to59 | code_61to254 } ]

      A DHCP relay source IP address is configured for the interface.

    11. Run quit

      Return to the system view.

    12. Run commit

      The configuration is committed.

  • Configure basic DHCP relay functions on an unnumbered interface.
    1. Run system-view

      The system view is displayed.

    2. Run dhcp enable

      DHCP is enabled globally.

    3. Run interface interface-type interface-number

      The interface view of unnumbered address is displayed.

      Currently, an unnumbered address interface can be an Ethernet physical interface, Ethernet physical sub-interface, VLANIF interface, and Ethernet trunk sub-interface.

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

      The primary IP address of the interface is configured.

    5. Run quit

      The system view is displayed.

    6. Run interface interface-type interface-number

      The interface view in which DHCP relay is to be enabled is displayed.

    7. Run ip address unnumbered interface interface-type interface-number

      The unnumbered IP address of the relay interface is configured.

      The interface interface-type interface-number parameter must be the same as the interface of the unnumbered address specified in Step 3.

    8. Run dhcp select relay

      DHCP relay is enabled on the interface.

    9. Run ip relay address ip-address [ dhcp-option { code_60 [ option-text ] | code_1to59 | code_61to254 } ]

      A DHCP server address is associated with the relay interface based on a DHCP option or Option 60.

    10. (Optional) Run ip relay giaddr ip-address [ dhcp-option { code_60 [ option-text ] | code_1to59 | code_61to254 } ]

      A DHCP relay gateway address is configured for the interface.

    11. (Optional) Run dhcp relay source-ip-address ip-address [ dhcp-option { code_60 [ option-text ] | code_1to59 | code_61to254 } ]

      A DHCP relay source IP address is configured for the interface.

    12. (Optional) Run dhcp option82 subscriber-id insert enable self-define self-define-value

      The function to insert the Option 82 Subscriber-ID into DHCP request packets is enabled.

    13. Run quit

      Return to the system view.

    14. (Optional) Run dhcp relay arp user-detect interval interval

      The ARP probe time for the DHCP relay user table is configured.

    15. (Optional) Perform the following steps as required:

      • Run dhcp relay unnumbered table autosave interval

        The DHCP relay agent is enabled to store user entries.

      • Run dhcp relay unnumbered table write-delay

        The interval for storing user entries on the DHCP relay agent is set.

    16. Run commit

      The configuration is committed.

Follow-up Procedure

  • (Optional) Run dhcp dscp-outbound dscp

    The differentiated services code point (DSCP) value is set for DHCP messages.

  • (Optional) Run dhcp ip-ttl ttl-value

    The time to live (TTL) value is set for DHCP messages.

  • (Optional) Run dhcp relay reply broadcast-always

    The DHCP relay is enabled to broadcast response packets upon receipt of client requests.

(Optional) Requesting the DHCP Server to Release the Client IP Address

The DHCP relay agent can request the DHCP server for releasing the IP address assigned to the client.

Context

When a DHCP client does not need an IP address or a user needs to be logged out, run the dhcp relay release command on the DHCP relay agent to send a Release message to the DHCP server. After the DHCP server receives the Release message, the server releases the specified IP address.

Perform the following steps on the Device that functions as a DHCP relay agent:

Procedure

  • Request all the DHCP servers to release the client IP address.
    1. Run system-view

      The system view is displayed.

    2. Run dhcp relay release client-ip-address mac-address

      The DHCP relay agent is configured to request DHCP servers to release the client IP address.

  • Request the specified DHCP server to release the client IP address.
    1. Run system-view

      The system view is displayed.

    2. Run dhcp relay release client-ip-address mac-address [ server-ip-address ]

      The DHCP relay agent is configured to request the specified DHCP server to release the client IP address.

  • Request the DHCP server connected to an interface to release the client IP address.
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number

      The interface view is displayed.

    3. Run dhcp relay release client-ip-address mac-address [ server-ip-address ]

      The DHCP relay agent is configured to request the DHCP server connected to the interface to release the client IP address.

Verifying the Configuration of DHCP Relay

After configuring a DHCP relay agent to transmit DHCP broadcast messages between DHCP clients and the DHCP server that reside on different network segments, verify the configuration.

Prerequisites

DHCP relay has been configured.

Procedure

  • Run the display dhcp relay statistics command to check DHCP relay statistics.
  • Run the display dhcp relay address { all | interface interface-type interface-number } command to check DHCP configurations on DHCP relay interfaces.

Example

Run the display dhcp relay address command. The command output shows DHCP configurations on all interfaces.

<HUAWEI> display dhcp relay address all
    **  GigabitEthernet0/1/0 DHCP Relay Address  **
Dhcp Option          Relay Agent IP       Server IP  
*                    10.1.1.1             70.1.1.2   
                                          101.40.1.2
45                   20.1.1.1             101.40.1.2
60(*)                30.1.1.1             202.40.1.2
60(abc)              40.1.1.1             202.40.1.2

Run the display dhcp relay statistics command. The command output shows DHCP relay statistics, such as the number of incorrect DHCP messages and the number of different types of DHCP messages.

<HUAWEI> display dhcp relay statistics
 The statistics of DHCP RELAY:
    DHCP packets received from clients         : 2
        DHCP DISCOVER packets received         : 1
        DHCP REQUEST packets received          : 1
        DHCP RELEASE packets received          : 0
        DHCP INFORM packets received           : 0
        DHCP DECLINE packets received          : 0
    DHCP packets sent to clients               : 2
        Unicast packets sent to clients        : 0
        Broadcast packets sent to clients      : 2
    DHCP packets received from servers         : 2
        DHCP OFFER packets received            : 1
        DHCP ACK packets received              : 1
        DHCP NAK packets received              : 0
    DHCP packets sent to servers               : 2
    DHCP Bad packets received                  : 0
    Local DHCP RELEASE packets sent to servers : 0
Translation
Download
Updated: 2019-01-02

Document ID: EDOC1100055376

Views: 21923

Downloads: 48

Average rating:
This Document Applies to these Products

Related Version

Related Documents

Share
Previous Next