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).
Example for Configuring a DHCP Relay Agent (DHCP Relay Agent and DHCP Server on the Same Network)

Example for Configuring a DHCP Relay Agent (DHCP Relay Agent and DHCP Server on the Same Network)

Networking Requirements

In Figure 3-15, SwitchB functions as a DHCP server and resides on a different network segment from DHCP clients. In this networking example, the enterprise wants the DHCP server to dynamically allocate IP addresses to its clients.

Figure 3-15  Networking diagram for configuring a device as a DHCP relay agent

Configuration Roadmap

The configuration roadmap is as follows:

Configure SwitchA as a DHCP relay agent to forward DHCP messages between the DHCP server and clients.

Procedure

  1. Configure DHCP relay on SwitchA.

    # Add interfaces to VLANs.

    <HUAWEI> system-view
    [HUAWEI] sysname SwitchA
    [SwitchA] vlan batch 100 200
    [SwitchA] interface gigabitethernet 0/0/2
    [SwitchA-GigabitEthernet0/0/2] port link-type hybrid
    [SwitchA-GigabitEthernet0/0/2] port hybrid pvid vlan 100
    [SwitchA-GigabitEthernet0/0/2] port hybrid untagged vlan 100
    [SwitchA-GigabitEthernet0/0/2] quit
    [SwitchA] interface gigabitethernet 0/0/1
    [SwitchA-GigabitEthernet0/0/1] port link-type hybrid
    [SwitchA-GigabitEthernet0/0/1] port hybrid pvid vlan 200
    [SwitchA-GigabitEthernet0/0/1] port hybrid untagged vlan 200
    [SwitchA-GigabitEthernet0/0/1] quit
    [SwitchA] interface vlanif 200 
    [SwitchA-Vlanif200] ip address 10.10.20.1 24
    [SwitchA-Vlanif200] quit
    

    # Enable the DHCP relay function on VLANIF 100.

    [SwitchA] dhcp enable
    [SwitchA] interface vlanif 100
    [SwitchA-Vlanif100] ip address 10.20.20.1 24
    [SwitchA-Vlanif100] dhcp select relay 
    [SwitchA-Vlanif100] dhcp relay server-ip 10.10.20.2
    [SwitchA-Vlanif100] quit

  2. Configure a default route on SwitchA.

    [SwitchA] ip route-static 0.0.0.0 0.0.0.0 10.10.20.2
    

  3. Configure SwitchB as the DHCP server based on the global address pool.

    # Enable DHCP.

    <HUAWEI> system-view
    [HUAWEI] sysname SwitchB
    [SwitchB] dhcp enable

    # Configure VLANIF 200 to work in global address pool mode.

    [SwitchB] vlan 200 
    [SwitchB-vlan200] quit
    [SwitchB] interface gigabitethernet 0/0/1
    [SwitchB-GigabitEthernet0/0/1] port link-type hybrid
    [SwitchB-GigabitEthernet0/0/1] port hybrid pvid vlan 200
    [SwitchB-GigabitEthernet0/0/1] port hybrid untagged vlan 200
    [SwitchB-GigabitEthernet0/0/1] quit
    [SwitchB] interface vlanif 200 
    [SwitchB-Vlanif200] ip address 10.10.20.2 24
    [SwitchB-Vlanif200] dhcp select global
    [SwitchB-Vlanif200] quit

    # Create an address pool and set attributes for the address pool.

    [SwitchB] ip pool pool1
    [SwitchB-ip-pool-pool1] network 10.20.20.0 mask 24
    [SwitchB-ip-pool-pool1] gateway-list 10.20.20.1
    [SwitchB-ip-pool-pool1] option121 ip-address 10.10.20.0 24 10.20.20.1
    [SwitchB-ip-pool-pool1] quit

  4. Configure a static route on SwitchB.

    [SwitchB] ip route-static 10.20.20.0 255.255.255.0 10.10.20.1
    

  5. Verify the configuration.

    # On SwitchA, run the display dhcp relay interface vlanif 100 command to view the configuration of the DHCP relay agent.

    [SwitchA] display dhcp relay interface vlanif 100
     DHCP relay agent running information of interface Vlanif100 :
     Server IP address [00] : 10.10.20.2
     Gateway address in use : 10.20.20.1
    

    # On SwitchB, run the display ip pool name pool1 command to view IP address allocation in the address pool. The Used field displays the number of used IP addresses in the address pool.

    [SwitchB] display ip pool name pool1
      Pool-name        : pool1
      Pool-No          : 0
      Lease            : 1 Days 0 Hours 0 Minutes
      Domain-name      : -
      Option-code      : 121
      Option-subcode : --
      Option-type    : hex
      Option-value   : 18640A1414141401
      DNS-server0      : -
      NBNS-server0     : -
      Netbios-type     : -
      Position         : Local
      Status           : Unlocked
      Gateway-0        : 10.20.20.1
      Network          : 10.20.20.0
      Mask             : 255.255.255.0
      VPN instance     : --
      Logging          : Disable
      Conflicted address recycle interval: -
      Address Statistic: Total       :253       Used        :2
                         Idle        :251       Expired     :0
                         Conflict    :0         Disabled     :0
                                                                                    
     -------------------------------------------------------------------------------
      Network section
             Start           End       Total    Used Idle(Expired) Conflict Disabled
     -------------------------------------------------------------------------------
          10.20.20.1    10.20.20.254     253       2        251(0)       0     0
     -------------------------------------------------------------------------------

Configuration Files

  • SwitchA configuration file

    #
    sysname SwitchA
    #
    vlan batch 100 200
    #
    dhcp enable
    #
    interface Vlanif100
     ip address 10.20.20.1 255.255.255.0
     dhcp select relay
     dhcp relay server-ip 10.10.20.2
    #
    interface Vlanif200
     ip address 10.10.20.1 255.255.255.0
    #
    interface GigabitEthernet0/0/1
     port link-type hybrid
     port hybrid pvid vlan 200
     port hybrid untagged vlan 200
    #
    interface GigabitEthernet0/0/2
     port link-type hybrid
     port hybrid pvid vlan 100
     port hybrid untagged vlan 100
    #
    ip route-static 0.0.0.0 0.0.0.0 10.10.20.2
    #
    return
  • SwitchB configuration file

    #
    sysname SwitchB
    #
    vlan batch 200
    #
    dhcp enable
    #
    ip pool pool1
     gateway-list 10.20.20.1
     network 10.20.20.0 mask 255.255.255.0
     option121 ip-address 10.10.20.0 24 10.20.20.1
    #
    interface Vlanif200
     ip address 10.10.20.2 255.255.255.0
     dhcp select global
    #
    interface GigabitEthernet0/0/1
     port link-type hybrid
     port hybrid pvid vlan 200
     port hybrid untagged vlan 200
    #
    ip route-static 10.20.20.0 255.255.255.0 10.10.20.1
    #
    return
Translation
Download
Updated: 2019-04-20

Document ID: EDOC1100065678

Views: 29817

Downloads: 224

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