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 Device as a DHCP Server (Based on an Interface Address Pool)

Example for Configuring a Device as a DHCP Server (Based on an Interface Address Pool)

Networking Requirements

In Figure 3-14, an enterprise plans two network segments for office terminals: 10.1.1.0/24 for fixed terminals and 10.1.2.0/24 for terminals used by staff on business trips. To facilitate unified management, the enterprise requires terminals to automatically obtain IP addresses and the DNS server IP address from the Switch (if users access the Internet using domain names, a DNS server must be specified). A PC (DHCP Client_1) requires fixed IP address 10.1.1.100/24 to meet service requirements.

Figure 3-14  Networking diagram for configuring a device as a DHCP server

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure the switch as a DHCP server to dynamically allocate IP addresses on the two network segments and the DNS server IP address to enterprise terminals.
  2. Allocate IP addresses on 10.1.1.0/24 to fixed terminals and set the lease time of these IP addresses to 30 days.
  3. Statically allocate the fixed IP address 10.1.1.100/24 to DHCP Client_1.
  4. Allocate IP addresses on 10.1.2.0/24 to terminals used by staff on business trips and set the lease time of these IP addresses to two days.

Procedure

  1. Enable the DHCP service.

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

  2. Add interfaces to VLANs.

    # Add GE0/0/1 to VLAN 10.

    [Switch] vlan batch 10 to 11
    [Switch] interface gigabitethernet 0/0/1
    [Switch-GigabitEthernet0/0/1] port link-type hybrid
    [Switch-GigabitEthernet0/0/1] port hybrid pvid vlan 10
    [Switch-GigabitEthernet0/0/1] port hybrid untagged vlan 10
    [Switch-GigabitEthernet0/0/1] quit

    # Add GE0/0/2 to VLAN 11.

    [Switch] interface gigabitethernet 0/0/2
    [Switch-GigabitEthernet0/0/2] port link-type hybrid
    [Switch-GigabitEthernet0/0/2] port hybrid pvid vlan 11
    [Switch-GigabitEthernet0/0/2] port hybrid untagged vlan 11
    [Switch-GigabitEthernet0/0/2] quit

  3. Configure IP addresses for VLANIF interfaces.

    # Configure an IP address for VLANIF 10.

    [Switch] interface vlanif 10
    [Switch-Vlanif10] ip address 10.1.1.1 24
    [Switch-Vlanif10] quit

    # Configure an IP address for VLANIF 11.

    [Switch] interface vlanif 11
    [Switch-Vlanif11] ip address 10.1.2.1 24
    [Switch-Vlanif11] quit

  4. Configure interface address pools.

    # Configure the clients connected to VLANIF 10 to obtain IP addresses and other network parameters from the address pool on VLANIF 10.

    [Switch] interface vlanif 10
    [Switch-Vlanif10] dhcp select interface
    [Switch-Vlanif10] dhcp server gateway-list 10.1.1.1
    [Switch-Vlanif10] dhcp server lease day 30
    [Switch-Vlanif10] dhcp server domain-name huawei.com
    [Switch-Vlanif10] dhcp server dns-list 10.1.3.1
    [Switch-Vlanif10] dhcp server static-bind ip-address 10.1.1.100 mac-address 286e-d488-b684
    [Switch-Vlanif10] quit

    # Configure the clients connected to VLANIF 11 to obtain IP addresses and other network parameters from the address pool on VLANIF 11.

    [Switch] interface vlanif 11
    [Switch-Vlanif11] dhcp select interface
    [Switch-Vlanif11] dhcp server gateway-list 10.1.2.1
    [Switch-Vlanif11] dhcp server lease day 2
    [Switch-Vlanif11] dhcp server domain-name huawei.com
    [Switch-Vlanif11] dhcp server dns-list 10.1.3.1
    [Switch-Vlanif11] quit

  5. Enable the device to save DHCP data to the storage device. If a fault occurs on the device, you can run the dhcp server database recover command after the system restarts to restore DHCP data from files on the storage device.

    [Switch] dhcp server database enable

  6. Verify the configuration.

    # On the switch, run the display ip pool command to view IP address allocation in address pools. The Used field displays the number of used IP addresses in the address pool. For example, the enterprise has 100 employees with fixed office terminals and 3 employees on business trips.

    [Switch] display ip pool interface vlanif10
      Pool-name        : Vlanif10
      Pool-No          : 0
      Lease            : 30 Days 0 Hours 0 Minutes
      Domain-name      : huawei.com
      DNS-server0      : 10.1.3.1
      NBNS-server0     : -
      Netbios-type     : -
      Position         : Interface
      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        :100
                         Idle        :153       Expired     :0
                         Conflict    :0         Disabled     :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
     -------------------------------------------------------------------------------
    [Switch] display ip pool interface vlanif11
      Pool-name        : Vlanif11
      Pool-No          : 1
      Lease            : 2 Days 0 Hours 0 Minutes
      Domain-name      : huawei.com
      DNS-server0      : 10.1.3.1
      NBNS-server0     : -
      Netbios-type     : -
      Position         : Interface
      Status           : Unlocked
      Gateway-0        : 10.1.2.1
      Network          : 10.1.2.0
      Mask             : 255.255.255.0
      VPN instance     : --
      Logging          : Disable
      Conflicted address recycle interval: -
      Address Statistic: Total       :253       Used        :3
                         Idle        :250       Expired     :0
                         Conflict    :0         Disabled     :0
    
     -------------------------------------------------------------------------------
      Network section
             Start           End       Total    Used Idle(Expired) Conflict Disabled
     -------------------------------------------------------------------------------
            10.1.1.1      10.1.1.254    253       3        250(0)       0     0
     -------------------------------------------------------------------------------

    Check IP address information on Client_1 (using Windows 7 operating system). The IP address 10.1.1.100/24 has been assigned to Client_1.

    C:\Documents and Settings\Administrator>ipconfig
    
    Windows IP Configuration
    
    
    Ethernet adapter Local Area Connection 2:
    
       Connection-specific DNS Suffix  . :
       IPv4 Address. . . . . . . . . . . : 10.1.1.100
       Subnet Mask . . . . . . . . . . . : 255.255.254.0
       Default Gateway . . . . . . . . . : 10.1.1.1

    Check IP address information another DHCP client (for example, a terminal belonging to the network segment 10.1.1.0/24 and using Windows 7 operating system). An IP address has been assigned.

    C:\Documents and Settings\Administrator>ipconfig
    
    Windows IP Configuration
    
    
    Ethernet adapter Local Area Connection 2:
    
       Connection-specific DNS Suffix  . :
       IPv4 Address. . . . . . . . . . . : 10.1.1.51
       Subnet Mask . . . . . . . . . . . : 255.255.254.0
       Default Gateway . . . . . . . . . : 10.1.1.1

Configuration Files

Switch configuration file

#
sysname Switch
#
vlan batch 10 to 11
#
dhcp enable
#
dhcp server database enable
#
interface Vlanif10
 ip address 10.1.1.1 255.255.255.0
 dhcp select interface
 dhcp server gateway-list 10.1.1.1
 dhcp server static-bind ip-address 10.1.1.100 mac-address 286e-d488-b684
 dhcp server lease day 30 hour 0 minute 0
 dhcp server dns-list 10.1.3.1
 dhcp server domain-name huawei.com
#
interface Vlanif11
 ip address 10.1.2.1 255.255.255.0
 dhcp select interface
 dhcp server gateway-list 10.1.2.1
 dhcp server lease day 2 hour 0 minute 0
 dhcp server dns-list 10.1.3.1
 dhcp server domain-name huawei.com
#
interface GigabitEthernet0/0/1
 port link-type hybrid
 port hybrid pvid vlan 10
 port hybrid untagged vlan 10
#
interface GigabitEthernet0/0/2
 port link-type hybrid
 port hybrid pvid vlan 11
 port hybrid untagged vlan 11
#
return
Translation
Download
Updated: 2018-12-24

Document ID: EDOC1100038342

Views: 85151

Downloads: 281

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