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

S12700 Series Agile Switches Typical Configuration Examples

This document provides examples for configuring features in typical usage scenarios.
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 Device as a DHCP Relay (Across a GRE Tunnel)

Example for Configuring the Device as a DHCP Relay (Across a GRE Tunnel)

DHCP Relay Overview

A DHCP relay forwards DHCP packets between the DHCP server and clients. When the DHCP server and clients belong to different network segment, the DHCP relay needs to be configured. For DHCP clients, the DHCP relay is the DHCP server; for the DHCP server, the DHCP relay is a DHCP client.

The DHCP relay function applies to large networks with many sparsely-distributed user gateways. To reduce the maintenance workload, the network administrator does not want to configure the DHCP server function on each aggregation switch (user gateway) and requires that the DHCP server function be configured on a core device or an exclusive DHCP server be deployed in the server area. In this case, the aggregation switches functioning as the user gateways need to be configured with the DHCP relay function to implement exchange of DHCP packets between the DHCP server and clients.

The DHCP relay and DHCP server can be deployed across a VPN (such as GRE or MPLS L3VPN) network. A GRE tunnel is used as an example to describe how to configure a DHCP relay.

Configuration Notes

This example applies to all versions of the S12700.

NOTE:
For details about software mappings, visit Hardware Query Tool and search for the desired product model.

Networking Requirements

As shown in Figure 8-5, an enterprise deploys its headquarters and branch in different areas. A GRE tunnel is deployed between the headquarters and branch to enable them to communicate through the Internet. To facilitate unified management, the enterprise administrator deploys the DHCP server on Switch_1 in the headquarters to assign IP addresses to the terminals in the headquarters and branch. The network segments 10.1.1.0/24 and 10.2.1.0/24 are planned for the headquarters and branch respectively.

Figure 8-5  Networking diagram for configuring the device as a DHCP relay

Configuration Roadmap

The configuration roadmap is as follows:

  1. Run OSPF between Switch_1, Switch_2, and Switch_3 to ensure the communication between devices.

  2. On Switch_1 and Switch_3, configure tunnel interfaces and create a GRE tunnel.

  3. On Switch_1, configure the DHCP server based on the global address pool so that the DHCP server can assign IP addresses from the global address pool to the terminals in the headquarters and branch.

  4. On Switch_3, configure the DHCP relay function to function as the branch's gateway to forward DHCP packets between the terminals and DHCP servers so that the terminals can apply to the DHCP server for IP addresses.

NOTE:

Use a Huawei S series switch as an example for the DHCP server (Switch_1).

Configure the interface link types and VLANs on LSW_1 and LSW_2 to implement Layer 2 communication.

Procedure

  1. Configure an IP address for each physical interface on Switch_1 through Switch_3.

    # Configure Switch_1.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch_1
    [Switch_1] vlan batch 10 30
    [Switch_1] interface gigabitethernet 1/0/0
    [Switch_1-GigabitEthernet1/0/0] port link-type trunk
    [Switch_1-GigabitEthernet1/0/0] port trunk allow-pass vlan 10
    [Switch_1-GigabitEthernet1/0/0] quit
    [Switch_1] interface gigabitethernet 2/0/0
    [Switch_1-GigabitEthernet2/0/0] port link-type trunk
    [Switch_1-GigabitEthernet2/0/0] port trunk allow-pass vlan 30
    [Switch_1-GigabitEthernet2/0/0] quit
    [Switch_1] interface vlanif 10
    [Switch_1-Vlanif10] ip address 20.1.1.1 24
    [Switch_1-Vlanif10] quit
    [Switch_1] interface vlanif 30
    [Switch_1-Vlanif30] ip address 10.1.1.1 24
    [Switch_1-Vlanif30] quit

    # Configure Switch_2.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch_2
    [Switch_2] vlan batch 10 20
    [Switch_2] interface gigabitethernet 1/0/0
    [Switch_2-GigabitEthernet1/0/0] port link-type trunk
    [Switch_2-GigabitEthernet1/0/0] port trunk allow-pass vlan 10
    [Switch_2-GigabitEthernet1/0/0] quit
    [Switch_2] interface gigabitethernet 2/0/0
    [Switch_2-GigabitEthernet2/0/0] port link-type trunk
    [Switch_2-GigabitEthernet2/0/0] port trunk allow-pass vlan 20
    [Switch_2-GigabitEthernet2/0/0] quit
    [Switch_2] interface vlanif 10
    [Switch_2-Vlanif10] ip address 20.1.1.2 24
    [Switch_2-Vlanif10] quit
    [Switch_2] interface vlanif 20
    [Switch_2-Vlanif20] ip address 30.1.1.1 24
    [Switch_2-Vlanif20] quit

    # Configure Switch_3.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch_3
    [Switch_3] vlan batch 20 30
    [Switch_3] interface gigabitethernet 1/0/0
    [Switch_3-GigabitEthernet1/0/0] port link-type trunk
    [Switch_3-GigabitEthernet1/0/0] port trunk allow-pass vlan 20
    [Switch_3-GigabitEthernet1/0/0] quit
    [Switch_3] interface gigabitethernet 2/0/0
    [Switch_3-GigabitEthernet2/0/0] port link-type trunk
    [Switch_3-GigabitEthernet2/0/0] port trunk allow-pass vlan 30
    [Switch_3-GigabitEthernet2/0/0] quit
    [Switch_3] interface vlanif 20
    [Switch_3-Vlanif20] ip address 30.1.1.2 24
    [Switch_3-Vlanif20] quit
    [Switch_3] interface vlanif 30
    [Switch_3-Vlanif30] ip address 10.2.1.1 24
    [Switch_3-Vlanif30] quit

  2. Run OSPF between Switch_1, Switch_2, and Switch_3.

    # Configure Switch_1.

    [Switch_1] ospf 1
    [Switch_1-ospf-1] area 0
    [Switch_1-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255
    [Switch_1-ospf-1-area-0.0.0.0] quit
    [Switch_1-ospf-1] quit

    # Configure Switch_2.

    [Switch_2] ospf 1
    [Switch_2-ospf-1] area 0
    [Switch_2-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255
    [Switch_2-ospf-1-area-0.0.0.0] network 30.1.1.0 0.0.0.255
    [Switch_2-ospf-1-area-0.0.0.0] quit
    [Switch_2-ospf-1] quit

    # Configure Switch_3.

    [Switch_3] ospf 1
    [Switch_3-ospf-1] area 0
    [Switch_3-ospf-1-area-0.0.0.0] network 30.1.1.0 0.0.0.255
    [Switch_3-ospf-1-area-0.0.0.0] quit
    [Switch_3-ospf-1] quit

  3. Configure static routes.

    # Configure a static route to the network segment on Switch_1.
    [Switch_1] ip route-static 10.2.1.0 255.255.255.0 tunnel 1
    # Configure a static route to the server segment on Switch_3.
    [Switch_3] ip route-static 10.1.1.0 255.255.255.0 tunnel 1

  4. Configure tunnel interfaces.

    # Configure Switch_1.

    [Switch_1] interface tunnel 1
    [Switch_1-Tunnel1] tunnel-protocol gre
    [Switch_1-Tunnel1] ip address 40.1.1.1 24
    [Switch_1-Tunnel1] source 20.1.1.1
    [Switch_1-Tunnel1] destination 30.1.1.2
    [Switch_1-Tunnel1] quit

    # Configure Switch_3.

    [Switch_3] interface tunnel 1
    [Switch_3-Tunnel1] tunnel-protocol gre
    [Switch_3-Tunnel1] ip address 40.1.1.2 24
    [Switch_3-Tunnel1] source 30.1.1.2
    [Switch_3-Tunnel1] destination 20.1.1.1
    [Switch_3-Tunnel1] quit

  5. Configure the DHCP server function on Switch_1.

    # Enable the DHCP service. By default, the service is disabled.

    [Switch_1] dhcp enable

    # Create a global address pool and configure related parameters.

    [Switch_1] ip pool pool1
    [Switch_1-ip-pool-pool1] network 10.2.1.0 mask 255.255.255.0  //Network segment for terminals in the branch
    [Switch_1-ip-pool-pool1] gateway-list 10.2.1.1  //Gateway address for terminals in the branch
    [Switch_1-ip-pool-pool1] quit
    [Switch_1] ip pool pool2
    [Switch_1-ip-pool-pool2] network 10.1.1.0 mask 255.255.255.0  //Network segment for terminals in the headquarters
    [Switch_1-ip-pool-pool2] gateway-list 10.1.1.1  //Gateway address for terminals in the headquarters
    [Switch_1-ip-pool-pool2] quit
    # Configure the terminals connected to VLANIF30 to obtain IP addresses from the global address pool.
    [Switch_1] interface vlanif 30
    [Switch_1-Vlanif30] dhcp select global  //Enable the DHCP server function based on the global address pool on the interface. By default, the function is disabled.
    [Switch_1-Vlanif30] quit

  6. # Configure the DHCP relay function on Switch_3.

    # Enable the DHCP service. By default, the service is disabled.

    [Switch_3] dhcp enable
    # Configure the DHCP relay function on VLANIF 30 and specifies the DHCP server address for the relay.
    [Switch_3] interface vlanif 30
    [Switch_3-Vlanif30] dhcp select relay   //Enable the DHCP relay function. By default, the function is disabled.
    [Switch_3-Vlanif30] dhcp relay server-ip 10.1.1.1  //Configure the DHCP server IP address for the DHCP relay agent.
    [Switch_3-Vlanif30] quit

  7. Configure each terminal (using the PC running Windows 7 as an example) to automatically obtain an IP address.

    1. Right-click Network and choose Properties to display the Network and Sharing Center window.
    2. Click Local Area Connection to display the Local Area Connection Status window.
    3. Click Properties to display the Local Area Connection Properties window.
    4. Select Internet Protocol Version 4 (TCP/IPv4) and click Properties to display the Internet Protocol Version 4 (TCP/IPv4) Properties window. Select Obtain an IP address automatically, and click OK.

  8. Verify the configuration. The following uses the command output in V200R010C00 as an example.

    # Run the display dhcp relay interface vlanif 30 command on Switch_3 to check the DHCP relay configuration.

    [Switch_3] display dhcp relay interface vlanif 30
     DHCP relay agent running information of interface Vlanif30 :
     Server IP address [00] : 10.1.1.1
     Gateway address in use : 10.2.1.1

    # Run the display ip pool command on Switch_1 to check the IP address allocation of pool1 and pool2. For example, the headquarters has 100 terminals and the branch has 50 terminals.

    [Switch_1] display ip pool name pool1
      Pool-name        : pool1
      Pool-No          : 0
      Lease            : 1 Days 0 Hours 0 Minutes
      Domain-name      : -
      DNS-server0      : -
      NBNS-server0     : -
      Netbios-type     : -
      Position         : Local           Status             : Unlocked
      Gateway-0        : 10.2.1.1
      Network          : 10.2.1.0
      Mask             : 255.255.255.0
      VPN instance     : --
      Logging          : Disable
      Conflicted address recycle interval: -
      Address Statistic: Total       :253       Used        :50
      Idle        :203       Expired     :0
      Conflict    :0         Disable     :0
    
     -------------------------------------------------------------------------------
      Network section
             Start           End       Total    Used Idle(Expired) Conflict Disabled
     -------------------------------------------------------------------------------
            10.2.1.1      10.2.1.254     253      50        203(0)       0     0
     -------------------------------------------------------------------------------
    [Switch_1] display ip pool name pool2
      Pool-name        : pool2
      Pool-No          : 1
      Lease            : 1 Days 0 Hours 0 Minutes
      Domain-name      : -
      DNS-server0      : -
      NBNS-server0     : -
      Netbios-type     : -
      Position         : Local           Status             : Unlocked
      Gateway-0        : 10.1.1.1
      Network          : 10.1.1.0
      Mask             : 255.255.255.0
      VPN instance     : --
      Logging          : Disable
      Conflicted address recycle interval: -
      Address Statistic: Total       :253       Used        :50
      Idle        :203       Expired     :0
      Conflict    :0         Disable     :0
    
     -------------------------------------------------------------------------------
      Network section
             Start           End       Total    Used Idle(Expired) Conflict Disabled
     -------------------------------------------------------------------------------
            10.1.1.1      10.1.1.254     253     100        153(0)       0     0
     -------------------------------------------------------------------------------

Configuration Files

  • Configuration file of Switch_1

    #
    sysname Switch_1
    #
    vlan batch 10 30
    #
    dhcp enable
    # 
    ip pool pool1
     gateway-list 10.2.1.1
     network 10.2.1.0 mask 255.255.255.0
    # 
    ip pool pool2
     gateway-list 10.1.1.1
     network 10.1.1.0 mask 255.255.255.0
    # 
    interface Vlanif10
     ip address 20.1.1.1 255.255.255.0
    #
    interface Vlanif30
     ip address 10.1.1.1 255.255.255.0
     dhcp select global
    #
    interface GigabitEthernet1/0/0
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface GigabitEthernet2/0/0
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    interface Tunnel1
     ip address 40.1.1.1 255.255.255.0
     tunnel-protocol gre
     source 20.1.1.1
     destination 30.1.1.2
    #
    ospf 1
     area 0.0.0.0
      network 20.1.1.0 0.0.0.255
    #
    ip route-static 10.2.1.0 255.255.255.0 Tunnel1
    #
    return
  • Configuration file of Switch_2

    #
    sysname Switch_2
    #
    vlan batch 10 20
    #
    interface Vlanif10
     ip address 20.1.1.2 255.255.255.0
    #
    interface Vlanif20
     ip address 30.1.1.1 255.255.255.0
    #
    interface GigabitEthernet1/0/0
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface GigabitEthernet2/0/0
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    ospf 1
     area 0.0.0.0
      network 20.1.1.0 0.0.0.255
      network 30.1.1.0 0.0.0.255
    #
    return
  • Configuration file of Switch_3

    #
    sysname Switch_3
    #
    vlan batch 20 30
    #
    dhcp enable
    # 
    interface Vlanif20
     ip address 30.1.1.2 255.255.255.0
    #
    interface Vlanif30
     ip address 10.2.1.1 255.255.255.0
     dhcp select relay
     dhcp relay server-ip 10.1.1.1  
    #
    interface GigabitEthernet1/0/0
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface GigabitEthernet2/0/0
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    interface Tunnel1
     ip address 40.1.1.2 255.255.255.0
     tunnel-protocol gre
     source 30.1.1.2
     destination 20.1.1.1
    #
    ospf 1
     area 0.0.0.0
      network 30.1.1.0 0.0.0.255
    #
    ip route-static 10.1.1.0 255.255.255.0 Tunnel1
    #
    return
Download
Updated: 2019-05-16

Document ID: EDOC1000069466

Views: 189470

Downloads: 1849

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