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 - LAN Access and MAN Access 01

This is NE20E-S2 V800R010C10SPC500 Configuration Guide - LAN Access and MAN Access
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).
Example for Configuring the Sub-interface for dot1q VLAN Tag Termination to Support DHCP Relay

Example for Configuring the Sub-interface for dot1q VLAN Tag Termination to Support DHCP Relay

This example shows how to configure the sub-interface for dot1q VLAN tag termination to support Dynamic Host Configuration Protocol (DHCP) relay so that the DHCP relay agent transmits DHCP request packets from DHCP clients to a DHCP server. This configuration enables the clients to dynamically obtain IP addresses from the DHCP server.

Networking Requirements

If the DHCP client and DHCP server belong to different sub-nets, you need to deploy a DHCP relay agent to forward DHCP request packets from the client to the server so that the client can dynamically obtain IP addresses from the DHCP server.

If a DHCP client connects to a DHCP relay agent through a VLAN tag termination sub-interface, you need to configure the sub-interface to support DHCP relay on the DHCP relay agent. Without the configuration, the DHCP relay agent considers the received user packets with VLAN tags to be invalid. Therefore, the DHCP client cannot dynamically obtain IP addresses from a DHCP server.

As shown in Figure 9-27, a DHCP client and a DHCP server belong to different network segments. The DHCP client is connected to a DHCP relay agent through a CE and then connected to the DHCP server through the DHCP relay agent. The packets sent from the CE to the DHCP relay agent carry one VLAN tag. On the DHCP relay agent, the sub-interface for dot1q VLAN tag termination needs to be configured to support DHCP relay, ensuring that the DHCP client can dynamically obtain an IP address from the DHCP server.

Figure 9-27 Typical networking for configuring the sub-interface for dot1q VLAN tag termination to support DHCP relay
NOTE:

Interfaces 1 through 2 and subinterface1.1 in this example are GE 0/1/1, GE 0/1/2, GE 0/1/1.1, respectively.



Precautions

If the DHCP client sends broadcast packets, the interface that has DHCP relay enabled must support broadcast.

Configuration Roadmap

The configuration roadmap is as follows:

  1. Create a VLAN and configure the Layer 2 forwarding function on the CE so that the packets sent from the CE to the DHCP relay agent carry one VLAN tag.

  2. Configure DHCP relay on the DHCP relay agent and configure the sub-interface for dot1q VLAN tag termination to support DHCP relay so that the DHCP client and server can communicate using DHCP packets.

  3. Enable basic DHCP functions and configure an address pool on the DHCP server so that the DHCP server can assign IP addresses correctly.

Data Preparation

To complete the configuration, you need the following data:

  • User VLAN ID
  • Names of the interfaces that connect the CE and the DHCP client
  • Names and IP addresses of the interfaces that connect the DHCP relay agent and the CE
  • Names and IP addresses of the interfaces that connect the DHCP relay agent and the DHCP server
  • IP address pool range of the DHCP server

Procedure

  1. Create a VLAN and configure the Layer 2 forwarding function on the CE.

    <HUAWEI> system-view
    [~HUAWEI] sysname CE
    [*HUAWEI] commit
    [~CE] vlan 10
    [*CE-vlan10] quit
    [*CE] interface gigabitethernet 0/1/1
    [*CE-GigabitEthernet0/1/1] undo shutdown
    [*CE-GigabitEthernet0/1/1] portswitch
    [*CE-GigabitEthernet0/1/1] port link-type access
    [*CE-GigabitEthernet0/1/1] port default vlan 10
    [*CE-GigabitEthernet0/1/1] quit
    [*CE] interface gigabitethernet 0/1/2
    [*CE-GigabitEthernet0/1/2] undo shutdown
    [*CE-GigabitEthernet0/1/2] portswitch
    [*CE-GigabitEthernet0/1/2] port link-type trunk
    [*CE-GigabitEthernet0/1/2] port trunk allow-pass vlan 10
    [*CE-GigabitEthernet0/1/2] quit
    [*CE] commit

  2. Configure DHCP relay on the DHCP relay agent, and configure the sub-interface for dot1q VLAN tag termination to support DHCP relay.

    # Enable DHCP.

    <HUAWEI> system-view
    [~HUAWEI] sysname DHCP-Relay
    [*HUAWEI] commit
    [~DHCP-Relay] dhcp enable
    [*DHCP-Relay] commit

    # Assign an IP address to the network-side GE 0/1/2 on the DHCP relay agent.

    [~DHCP-Relay] interface gigabitethernet 0/1/2
    [*DHCP-Relay-GigabitEthernet0/1/2] undo shutdown
    [*DHCP-Relay-GigabitEthernet0/1/2] ip address 192.168.2.1 24
    [*DHCP-Relay-GigabitEthernet0/1/2] quit
    [*DHCP-Relay] commit

    # Assign an IP address to the user-side GE 0/1/1.1 on the DHCP relay agent. This IP address must be on the same network segment as the IP address of the DHCP client.

    [~DHCP-Relay] interface gigabitethernet 0/1/1
    [*DHCP-Relay-GigabitEthernet0/1/1] undo shutdown
    [*DHCP-Relay-GigabitEthernet0/1/1] quit
    [*DHCP-Relay] interface gigabitethernet 0/1/1.1
    [*DHCP-Relay-GigabitEthernet0/1/1.1] ip address 192.168.1.1 24
    [*DHCP-Relay-GigabitEthernet0/1/1.1] ip relay address 192.168.3.1
    [*DHCP-Relay-GigabitEthernet0/1/1.1] dhcp select relay
    [*DHCP-Relay-GigabitEthernet0/1/1.1] commit

    # Configure the sub-interface for dot1q VLAN tag termination to support DHCP relay.

    [*DHCP-Relay] interface gigabitethernet 0/1/1.1
    [*DHCP-Relay-GigabitEthernet0/1/1.1] control-vid 1 dot1q-termination
    [*DHCP-Relay-GigabitEthernet0/1/1.1] dot1q termination vid 10
    [*DHCP-Relay-GigabitEthernet0/1/1.1] arp broadcast enable
    [*DHCP-Relay-GigabitEthernet0/1/1.1] quit
    [*DHCP-Relay] commit
    NOTE:
    • If Option82 is not configured on the sub-interface for dot1q VLAN tag termination on the DHCP relay agent, the sub-interface encapsulates only the smallest VLAN ID configured on it in DHCP packets and forwards the packets to DHCP clients.

      In this example, if dot1q termination vid 10 and dot1q termination vid 20 are configured on the sub-interface for dot1q VLAN tag termination, the sub-interface encapsulates VLAN 10 in the DHCP packets and forwards the packets to the DHCP client. In this case, DHCP clients in VLAN 20 cannot obtain IP addresses.

    • If Option82 is configured on the sub-interface for dot1q VLAN tag termination on the DHCP relay agent, the sub-interface encapsulates the corresponding VLAN IDs in the DHCP packets and forwards the packets to DHCP clients.

  3. Configure a DHCP server.

    The configuration details are not provided here.

    • When configuring the DHCP server, ensure that an IP address pool is configured on the DHCP server so that the DHCP server can assign IP addresses to DHCP clients.
    • It is recommended that the address pool lease be configured to improve IP address utilization and DHCP snooping be configured to prevent unauthorized users from attacking the network.

  4. Verify the configuration.

    After the configurations are complete, run the display dhcp relay address command on the DHCP relay agent to view the DHCP configuration on the interface that has DHCP relay enabled.

    [~DHCP-Relay] display dhcp relay address all
    ** GigabitEthernet0/1/1.1 DHCP Relay Address  **
     Dhcp Option          Relay Agent IP       Server IP     
     *                    -                    192.168.3.1

    The DHCP client can obtain an IP address from the DHCP server through the DHCP relay agent.

Configuration Files

  • Configuration file of the DHCP relay agent

    #
     sysname DHCP-Relay
    #
    dhcp enable
    #
    interface GigabitEthernet0/1/1
     undo shutdown
    #
    interface GigabitEthernet0/1/1.1
     encapsulation dot1q-termination
     dot1q termination vid 10
     ip address 192.168.1.1 255.255.255.0
     ip relay address 192.168.3.1
     dhcp select relay
     arp broadcast enable
    #
    interface GigabitEthernet0/1/2
     undo shutdown
     ip address 192.168.2.1 255.255.255.0
    #
    return
  • Configuration file of the CE

    #
     sysname CE
    #
     vlan batch 10
    #
    interface GigabitEthernet0/1/2
     portswitch
     undo shutdown
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface GigabitEthernet0/1/1
     portswitch
     undo shutdown
     port link-type access
     port default vlan 10
    #
    return
Translation
Download
Updated: 2019-01-02

Document ID: EDOC1100055378

Views: 16873

Downloads: 35

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