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

Fat AP and Cloud AP V200R008C00 CLI-based Configuration Guide

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).
Configuration Examples for DHCP

Configuration Examples for DHCP

Example for Configuring a DHCP Server Based on the Global Address Pool in the Same Network Segment

Networking Requirements

As shown in Figure 7-77, an enterprise provides WLAN services for employees and external users, and expects that the employees and external users can obtain IP addresses dynamically. The employees access the Internet through the network named huawei-1 and belong to service VLAN 100. The employees are located on the network segment 10.1.1.0/25 and the lease of the IP addresses is 10 days. The external users access the Internet through the network named huawei-2 and belong to service VLAN 200. The external users are located on the network segment 10.1.1.128/25 and the lease of the IP addresses is 2 days.

Figure 7-77  Networking diagram for configuring the DHCP server based on the global address pool

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure two global address pools on the AP and set corresponding attributes to dynamically assign IP addresses for employees and external users as required.

Procedure

  1. Enable the DHCP service.

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

  2. Create address pools and set corresponding attributes.

    # Set attributes for IP address pool 1, including the address pool range, egress gateway, and address lease.

    [AP] ip pool 1
    [AP-ip-pool-1] network 10.1.1.0 mask 255.255.255.128
    [AP-ip-pool-1] gateway-list 10.1.1.1
    [AP-ip-pool-1] lease day 10
    [AP-ip-pool-1] quit

    # Set attributes for IP address pool 2, including the address pool range, egress gateway, and address lease.

    [AP] ip pool 2
    [AP-ip-pool-2] network 10.1.1.128 mask 255.255.255.128
    [AP-ip-pool-2] gateway-list 10.1.1.129
    [AP-ip-pool-2] lease day 2
    [AP-ip-pool-2] quit

  3. # Configure clients connected to the VLANIF interface to obtain IP addresses from the global address pools.

    [AP] vlan batch 100 200
    [AP] interface vlanif 100
    [AP-Vlanif100] ip address 10.1.1.1 255.255.255.128
    [AP-Vlanif100] dhcp select global
    [AP-Vlanif100] quit
    [AP] interface vlanif 200
    [AP-Vlanif200] ip address 10.1.1.129 255.255.255.128
    [AP-Vlanif200] dhcp select global
    [AP-Vlanif200] quit

  4. Verify the configuration.

    Run the display ip pool command on the AP to check configurations of the IP address pools.

    [AP] display ip pool
       -----------------------------------------------------------------------
      Pool-name      : 1
      Pool-No        : 0
      Position       : Local           Status           : Unlocked
      Gateway-0      : 10.1.1.1
      Mask           : 255.255.255.128
      VPN instance   : --
    
      -----------------------------------------------------------------------
      Pool-name      : 2
      Pool-No        : 1
      Position       : Local           Status           : Unlocked
      Gateway-0      : 10.1.1.129
      Mask           : 255.255.255.128
      VPN instance   : --
    
    
       IP address Statistic
        Total       :250
        Used        :4          Idle        :246
        Expired     :0          Conflict    :0          Disable   :0
    

Configuration File
Configuration file of the AP
#
 sysname AP
#
 vlan batch 100 200
#
dhcp enable
#
ip pool 1
 gateway-list 10.1.1.1
 network 10.1.1.0 mask 255.255.255.128
 lease day 10 hour 0 minute 0
#
ip pool 2
 gateway-list 10.1.1.129
 network 10.1.1.128 mask 255.255.255.128
 lease day 2 hour 0 minute 0
#
interface Vlanif100
 ip address 10.1.1.1 255.255.255.128
 dhcp select global  
#
interface Vlanif200
 ip address 10.1.1.129 255.255.255.128
 dhcp select global 
#
return

Example for Configuring the DHCP Server to Allocate Different Network Parameters to Dynamic Clients and Static Clients in the Global Address Pool

Networking Requirements

As shown in Figure 7-78, the iPhone and STAs connect to the Internet through a WLAN. To uniformly manage devices and reduce manual configuration costs, the administrator needs to configure iPhone and STAs to dynamically obtain IP addresses through DHCP. The STAs are the terminal in the duty room. It should always be online and use domain names to access network devices. Besides obtaining an IP address dynamically, the STAs requires an unlimited IP address lease and obtains information about the DNS server. The iPhone uses a fixed IP address 10.1.1.4/24 and its MAC address is dcd2-fc96-e4c0. Besides obtaining an IP address, the iPhone needs to dynamically obtain the startup configuration file. The startup configuration file named configuration.ini is saved on the FTP file server. There are reachable routes between the iPhone and the FTP file server. The gateway address of the iPhone and STAs is 10.1.1.1/24.

Figure 7-78  Networking diagram of configuring the DHCP server to allocate different network parameters to dynamic clients and static clients

Configuration Roadmap
  1. Create a DHCP Option template on the AP. In the DHCP Option template view, configure the startup configuration file for the static client iPhone, and configure an IP address for the network server that provides the startup configuration file.
  2. Create a global address pool on the AP. In the global address pool view, configure the IP address lease and information about the DNS server for the dynamic client PCs. Bind an IP address to the MAC address of the static client iPhone and bind a DHCP Option template. In this way, the DHCP server can allocate different network parameters to dynamic and static clients.

Procedure

  1. Configure an IP address for the interface.

    <Huawei> system-view
    [Huawei] sysname AP
    [AP] vlan batch 10
    [AP] interface vlanif 10
    [AP-Vlanif10] ip address 10.1.1.1 255.255.255.0
    [AP-Vlanif10] quit

  2. Enable DHCP.

    [AP] dhcp enable

  3. Create a DHCP Option template. In the DHCP Option template view, configure the startup configuration file for the static client iPhone, and configure an IP address for the network server that provides the startup configuration file.

    [AP] dhcp option template template1
    [AP-dhcp-option-template-template1] gateway-list 10.1.1.1
    [AP-dhcp-option-template-template1] bootfile configuration.ini 
    [AP-dhcp-option-template-template1] next-server 11.1.1.3
    [AP-dhcp-option-template-template1] quit

  4. Create an IP address pool. In the IP address pool view, configure the gateway address, IP address lease, and IP address of the DNS server for the PCs. Allocate a fixed IP address to the iPhone and configure the startup configuration file.

    [AP] ip pool pool1
    [AP-ip-pool-pool1] network 10.1.1.0 mask 255.255.255.0
    [AP-ip-pool-pool1] dns-list 11.1.1.2
    [AP-ip-pool-pool1] gateway-list 10.1.1.1
    [AP-ip-pool-pool1] lease unlimited
    [AP-ip-pool-pool1] static-bind ip-address 10.1.1.4 mac-address dcd2-fc96-e4c0 option-template template1 
    [AP-ip-pool-pool1] quit

  5. Enable the DHCP server function on the interface.

    [AP] interface vlanif 10
    [AP-Vlanif10] dhcp select global
    [AP-Vlanif10] quit

  6. Verify the configuration.

    # Run the display ip pool name pool1 command on the AP to check the IP address pool configuration.

    [AP] display ip pool name pool1
      Pool-name      : pool1                                                        
      Pool-No        : 0                                                            
      Lease          : unlimited                                                    
      Domain-name    : -                                                            
      DNS-server0    : 11.1.1.2                                                     
      NBNS-server0   : -                                                            
      Netbios-type   : -                                                            
      Position       : Local           Status           : Unlocked                  
      Gateway-0      : 10.1.1.1                                                     
      Mask           : 255.255.255.0                                                
      VPN instance   : --                                                           
     -----------------------------------------------------------------------------  
             Start           End     Total  Used  Idle(Expired)  Conflict  Disable  
     -----------------------------------------------------------------------------  
            10.1.1.1      10.1.1.254   253     3        250(0)         0        0   
     -----------------------------------------------------------------------------   

    # Run the display dhcp option template name template1 command on the AP to check the DHCP Option template configuration.

    [AP] display dhcp option template name template1
      Template-Name  : template1                                                    
      Template-No    : 0                                                            
      Next-server    : 11.1.1.3                                                     
      Domain-name    : -                                                            
      DNS-server0    : -                                                            
      NBNS-server0   : -                                                            
      Netbios-type   : -                                                            
      Gateway-0      : 10.1.1.1                                                     
      Bootfile       : configuration.ini                                            
                            

Configuration File

Configuration file of the AP

#
 sysname AP
#
 vlan batch 10
#
dhcp enable
#                                                                               
dhcp option template template1                                                  
 gateway-list 10.1.1.1                                                          
 next-server 11.1.1.3                                                           
 bootfile configuration.ini  
#
ip pool pool1
 gateway-list 10.1.1.1                                                          
 network 10.1.1.0 mask 255.255.255.0                                            
 static-bind ip-address 10.1.1.4 mac-address dcd2-fc96-e4c0 option-template template1                                                                          
 lease unlimited                                                                
 dns-list 11.1.1.2        
#
interface Vlanif10
 ip address 10.1.1.1 255.255.255.0
 dhcp select global  
#
return

Example for Configuring a DHCP Server Based on the Interface Address Pool in the Same Network Segment

Networking Requirements

As shown in Figure 7-79, an enterprise provides the WLAN service for employees, and expects that the employees can dynamically obtain IP addresses. The employees access the Internet through the network named huawei and belong to service VLAN 100. They are located on the network segment 10.1.1.0/24 and the lease of the IP addresses is 5 days.

Figure 7-79  Networking diagram for configuring a DHCP server based on a VLANIF interface address pool

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure a DHCP server based on a VLANIF interface address pool on the AP to dynamically assign IP addresses to employees.

Procedure

  1. Enable the DHCP service.

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

  2. Configure the clients connected to VLANIF 100 to obtain IP addresses from the interface address pool.

    [AP] vlan 100
    [AP] interface vlanif 100
    [AP-Vlanif100] ip address 10.1.1.1 24
    [AP-Vlanif100] dhcp select interface
    [AP-Vlanif100] dhcp server lease day 5
    [AP-Vlanif100] quit

  3. Verify the configuration.

    Run the display ip pool interface command on the AP to check the configuration of the interface address pool.

    [AP] display ip pool interface vlanif 100
      Pool-name      : Vlanif100
      Pool-No        : 0
      Lease          : 5 Days 0 Hours 0 Minutes
      Domain-name    : huawei.com
      DNS-server0    : -
      NBNS-server0   : -
      Netbios-type   : -
      Position       : Interface       Status           : Unlocked
      Gateway-0      : 10.1.1.1
      Mask           : 255.255.255.0
      VPN instance   : --
     -----------------------------------------------------------------------------
             Start           End     Total  Used  Idle(Expired)  Conflict  Disable
     -----------------------------------------------------------------------------
           10.1.1.1       10.1.1.254  253    2       251(0)         0        0
     -----------------------------------------------------------------------------
    

Configuration File
Configuration file of the AP
#
 sysname AP
#
 vlan batch 100
#
dhcp enable
#
interface Vlanif100
 ip address 10.1.1.1 255.255.255.0
 dhcp select interface
 dhcp server lease day 5 hour 0 minute 0
#
return

Example for Configuring a DHCP Relay Agent

Networking Requirements

As shown in Figure 7-80, an enterprise provides the WLAN service for employees. The enterprise has multiple offices, which are distributed in different office buildings. Wireless users in different buildings belong to different VLANs. The enterprise expects to use the same DHCP server to allocate IP addresses to all users. Office A is located on the network segment 20.20.20.0/24 but the DHCP server is on the network segment 100.10.10.0/24.

Figure 7-80  Networking diagram for configuring a DHCP relay agent

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure the DHCP relay function on the AP so that the AP can forward DHCP packets from a different network segment and DHCP clients can obtain IP addresses from the DHCP server.
  2. Configure a global address pool 20.20.20.0/24 on the DHCP server so that the DHCP server can assign IP addresses to clients from a different network segment.

Procedure

  1. Configure the DHCP relay function on the AP.
    1. Create a DHCP server group and add a DHCP server to the group.

      # Create a DHCP server group.

      <Huawei> system-view
      [Huawei] sysname AP
      [AP] dhcp server group dhcpgroup1

      # Add a DHCP server to the DHCP server group.

      [AP-dhcp-server-group-dhcpgroup1] dhcp-server 100.10.10.1
      [AP-dhcp-server-group-dhcpgroup1] quit

    2. Enable the global DHCP function and the DHCP relay function on the interface.

      [AP] dhcp enable
      [AP] vlan batch 100
      [AP] interface vlanif 100
      [AP-Vlanif100] ip address 20.20.20.1 24
      [AP-Vlanif100] dhcp select relay 
      [AP-Vlanif100] dhcp relay server-select dhcpgroup1
      [AP-Vlanif100] quit

  2. Configure a default route on the AP.

    [AP] interface vlanif 200 
    [AP-Vlanif200] ip address 100.10.20.1 24
    [AP-Vlanif200] quit
    [AP] ip route-static 0.0.0.0 0.0.0.0 100.10.20.2
    

  3. Configure a DHCP server.

    Configure the global address pool 20.20.20.0/24 on the DHCP server and configure the egress gateway address as 20.20.20.1. Then, configure a default route with the next hop address 100.10.10.2/24. The configuration procedure varies according to devices. For details, see corresponding manuals.

  4. Verify the configuration.

    # Run the display dhcp relay interface vlanif 100 command on the AP to check the DHCP relay configuration on the interface.

    [AP] display dhcp relay interface vlanif 100
     DHCP relay agent running information of interface Vlanif100 : 
     Server group name : dhcpgroup1
     Gateway address in use : 20.20.20.1
    

Configuration File
Configuration file of the AP
#
 sysname AP
#
 vlan batch 100
#
 dhcp enable
#
 dhcp server group dhcpgroup1
  dhcp-server 100.10.10.1 0
#
 interface Vlanif100
 ip address 20.20.20.1 255.255.255.0
 dhcp select relay
 dhcp relay server-select dhcpgroup1
#
 interface Vlanif200
 ip address 100.10.20.1 255.255.255.0
#
 ip route-static 0.0.0.0 0.0.0.0 100.10.20.2                                    
#                                                                               
return
Translation
Download
Updated: 2019-01-11

Document ID: EDOC1000176006

Views: 118602

Downloads: 309

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