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

S1720, S2700, S5700, and S6720 V200R012(C00 and C20)

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 Client

Example for Configuring a DHCP Client

Networking Requirements

In Figure 3-18, Switch_1 functions as a DHCP client and needs to dynamically obtain an IP address, DNS server address, and gateway address from a DHCP server (Switch_2).

Figure 3-18  Networking diagram for configuring a DHCP client

Configuration Roadmap

  1. Configure Switch_1 as a DHCP client to dynamically obtain an IP address from the DHCP server.
  2. Configure Switch_2 as a DHCP server to dynamically allocate network parameters including IP addresses to Switch_1.

Procedure

  1. Configure Switch_1 as a DHCP client.

    # Create VLAN 10 and add GE0/0/1 to VLAN 10.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch_1
    [Switch_1] vlan 10
    [Switch_1-vlan10] quit
    [Switch_1] interface gigabitethernet 0/0/1
    [Switch_1-GigabitEthernet0/0/1] port link-type trunk
    [Switch_1-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
    [Switch_1-GigabitEthernet0/0/1] quit

    # Enable the DHCP client function on VLANIF 10.

    [Switch_1] interface vlanif 10
    [Switch_1-Vlanif10] ip address dhcp-alloc
    [Switch_1-Vlanif10] quit

  2. Create a global address pool on Switch_2 and set attributes for the pool.
    1. Enable the DHCP service.

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

    2. Create VLAN 10 and add GE0/0/1 to VLAN 10.

      [Switch_2] vlan 10
      [Switch_2-vlan10] quit
      [Switch_2] interface gigabitethernet 0/0/1
      [Switch_2-GigabitEthernet0/0/1] port link-type trunk
      [Switch_2-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
      [Switch_2-GigabitEthernet0/0/1] quit

    3. Configure VLANIF 10 to work in global address pool mode.

      [Switch_2] interface vlanif 10
      [Switch_2-Vlanif10] ip address 192.168.1.1 24
      [Switch_2-Vlanif10] dhcp select global
      [Switch_2-Vlanif10] quit

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

      [Switch_2] ip pool pool1
      [Switch_2-ip-pool-pool1] network 192.168.1.0 mask 24
      [Switch_2-ip-pool-pool1] gateway-list 192.168.1.126
      [Switch_2-ip-pool-pool1] dns-list 192.168.1.2
      [Switch_2-ip-pool-pool1] excluded-ip-address 192.168.1.2
      [Switch_2-ip-pool-pool1] quit

  3. Verify the configuration.

    # Run the display this command on VLANIF 10 of Switch_1 to view the DHCP client configuration.

    [Switch_1] interface vlanif 10
    [Switch_1-Vlanif10] display this
    #
    interface Vlanif10
     ip address dhcp-alloc
    #
    return      

    # After VLANIF 10 obtains an IP address, run the display dhcp client command on Switch_1 to view the status of the DHCP client on VLANIF 10.

    [Switch_1] display dhcp client
    DHCP client lease information on interface Vlanif10 :
     Current machine state         : Bound
     Internet address assigned via : DHCP
     Physical address              : 0025-9efb-be55
     IP address                    : 192.168.1.254
     Subnet mask                   : 255.255.255.0
     Gateway ip address            : 192.168.1.126
     DHCP server                   : 192.168.1.1
     Lease obtained at             : 2014-09-10 20:30:39
     Lease expires at              : 2014-09-11 20:30:39
     Lease renews at               : 2014-09-11 08:30:39
     Lease rebinds at              : 2014-09-11 17:30:39
     DNS                           : 192.168.1.2   

    # On Switch_2, 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.

    [Switch_2] display ip pool name pool1
      Pool-name        : pool1
      Pool-No          : 0
      Lease            : 1 Days 0 Hours 0 Minutes
      Domain-name      : -
      DNS-server0      : 192.168.1.2
      NBNS-server0     : -
      Netbios-type     : -
      Position         : Local
      Status           : Unlocked
      Gateway-0        : 192.168.1.126
      Network          : 192.168.1.0
      Mask             : 255.255.255.0
      VPN instance     : --
      Logging          : Disable
      Conflicted address recycle interval: -
      Address Statistic: Total       :253       Used        :1
                         Idle        :251       Expired     :0
                         Conflict    :0         Disabled     :1
    
     -------------------------------------------------------------------------------
      Network section
             Start           End     Total  Used  Idle(Expired)  Conflict  Disabled
     -------------------------------------------------------------------------------
         192.168.1.1   192.168.1.254     253       1        251(0)       0     1
     -------------------------------------------------------------------------------

Configuration Files

  • Switch_1 configuration file

    #
    sysname Switch_1
    #
    vlan batch 10
    #
    interface Vlanif10
     ip address dhcp-alloc
    #
    interface GigabitEthernet0/0/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    return
  • Switch_2 configuration file

    #
    sysname Switch_2
    #
    vlan batch 10
    #
    dhcp enable
    #
    ip pool pool1
     gateway-list 192.168.1.126
     network 192.168.1.0 mask 255.255.255.0
     excluded-ip-address 192.168.1.2
     dns-list 192.168.1.2
    #
    interface Vlanif10
     ip address 192.168.1.1 255.255.255.0
     dhcp select global
    #
    interface GigabitEthernet0/0/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    return
    
Translation
Download
Updated: 2018-12-24

Document ID: EDOC1100038342

Views: 90730

Downloads: 291

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