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

CLI-based Configuration Guide - IP Service

AR500, AR510, AR531, AR550, AR1500, and AR2500 V200R010

This document describes the concepts and configuration procedures of IP Service features on the device, and provides the configuration examples.
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 Server (Based on the Interface Address Pool)

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

Networking Requirements

As shown in Figure 3-12, an enterprise plans two network segments for office terminals. The PCs on the network segment 10.1.1.0/24 are fixed office terminals for employees; the network segment 10.1.2.0/24 is used for employees on business trips to temporarily access the network. To facilitate management, the administrator requires that the enterprise terminals automatically obtain IP addresses and the DNS server IP address. (When users want to use domain names for access, the DNS server for domain name resolution needs to be configured.) The PC (Client_1) of the enterprise manager needs to use the fixed IP address 10.1.1.100/24 based on service requirements.

Figure 3-12  Networking diagram of configuring the device as a DHCP server

Configuration Roadmap

The configuration roadmap is as follows:

Configure the DHCP server function on the router to dynamically assign IP addresses and the DNS server address to the terminals on the two network segments of the enterprise. The PCs on 10.1.1.0/24 are fixed office terminals for employees with the IP address lease of 30 days, and DHCP Client_1 is assigned with the fixed IP address (10.1.1.100/24) in DHCP static mode. The network segment 10.1.2.0/24 is used for employees on business trips to temporarily access the network, with the IP address lease of 2 days.

NOTE:

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

Procedure

  1. Enable DHCP.

    <Huawei> system-view
    [Huawei] sysname Router
    [Router] dhcp enable

  2. Add interfaces to VLANs.

    # Add Eth2/0/0 to VLAN 10.

    [Router] vlan batch 10 to 11
    [Router] interface ethernet 2/0/0
    [Router-Ethernet2/0/0] port link-type access
    [Router-Ethernet2/0/0] port default vlan 10
    [Router-Ethernet2/0/0] quit

    # Add Eth2/0/1 to VLAN 11.

    [Router] interface ethernet 2/0/1
    [Router-Ethernet2/0/1] port link-type access
    [Router-Ethernet2/0/1] port default vlan 11
    [Router-Ethernet2/0/1] quit

  3. Allocate IP addresses to VLANIF interfaces.

    # Set an IP address for VLANIF 10.

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

    # Set an IP address for VLANIF 11.

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

  4. Configure the interface address pool.

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

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

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

    [Router] interface vlanif 11
    [Router-Vlanif11] dhcp select interface
    [Router-Vlanif11] dhcp server lease day 2
    [Router-Vlanif11] dhcp server domain-name huawei.com
    [Router-Vlanif11] dhcp server dns-list 10.1.1.2
    [Router-Vlanif11] quit

  5. Verify the configuration.

    # Run the display ip pool command on the router to view the allocation of the interface address pool. The Used field indicates the number of allocated IP addresses.

    [Router] 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.1.2
      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: 1 Days 0 Hours 0 Minutes                 
      Address Statistic: Total       :253       Used        :1                      
                         Idle        :251       Expired     :0                      
                         Conflict    :0         Disable     :1                      
                                                                                    
     -------------------------------------------------------------------------------
      Network section                                                               
             Start           End       Total    Used Idle(Expired) Conflict Disabled
     -------------------------------------------------------------------------------
            10.1.1.1      10.1.1.254     253       1        251(0)       0     1    
     -------------------------------------------------------------------------------
    [Router] 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.1.2
      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: 1 Days 0 Hours 0 Minutes                 
      Address Statistic: Total       :253       Used        :1                      
                         Idle        :251       Expired     :0                      
                         Conflict    :0         Disable     :1                      
                                                                                    
     -------------------------------------------------------------------------------
      Network section                                                               
             Start           End       Total    Used Idle(Expired) Conflict Disabled
     -------------------------------------------------------------------------------
            10.1.2.1      10.1.2.254     253       1        252(0)       0     0    
     -------------------------------------------------------------------------------

Configuration Files

Router configuration file

#
 sysname Router
#
vlan batch 10 to 11
#
dhcp enable
#
interface Vlanif10
 ip address 10.1.1.1 255.255.255.0
 dhcp select interface
 dhcp server excluded-ip-address 10.1.1.2
 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.1.2
 dhcp server domain-name huawei.com
#
interface Vlanif11
 ip address 10.1.2.1 255.255.255.0
 dhcp select interface
 dhcp server lease day 2 hour 0 minute 0
 dhcp server dns-list 10.1.1.2
 dhcp server domain-name huawei.com
#
interface Ethernet2/0/0
 port link-type access
 port default vlan 10
#
interface Ethernet2/0/1
 port link-type access
 port default vlan 11
#
return
Translation
Download
Updated: 2019-05-20

Document ID: EDOC1100034231

Views: 78575

Downloads: 51

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