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 Relay (Relay and Server Are Located on the Same Network)

Example for Configuring the Device as a DHCP Relay (Relay and Server Are Located on the Same Network)

Networking Requirements

As shown in Figure 3-16, the DHCP server is deployed on the core device of an enterprise, and is not located on the same network segment with the enterprise's terminals. The enterprise requires that this DHCP server should dynamically allocate IP addresses for the terminals.

Figure 3-16  Networking diagram of configuring the device as a DHCP relay

Configuration Roadmap

The configuration roadmap is as follows:
  1. Configure the DHCP relay function on the aggregation device RouterA (user gateway) so that the device functions as the DHCP relay to forward the DHCP messages between the terminals and DHCP server.
  2. On the core device RouterB, configure the DHCP server based on the global address pool so that the DHCP server allocates the IP addresses from the global address pool to the terminals.
NOTE:

A industrial switch router is used as an example of the DHCP server (RouterB).

Configure the interface link type and VLANs on the LSW to implement Layer 2 communication.

Procedure

  1. Configure the DHCP relay function on RouterA.

    # Add interfaces to VLANs.

    <Huawei> system-view
    [Huawei] sysname RouterA
    [RouterA] vlan batch 100 200
    [RouterA] interface ethernet 2/0/1
    [RouterA-Ethernet2/0/1] port link-type access 
    [RouterA-Ethernet2/0/1] port default vlan 100
    [RouterA-Ethernet2/0/1] quit
    [RouterA] interface ethernet 2/0/0
    [RouterA-Ethernet2/0/0] port link-type trunk
    [RouterA-Ethernet2/0/0] port trunk allow-pass vlan 200
    [RouterA-Ethernet2/0/0] quit
    [RouterA] interface vlanif 200 
    [RouterA-Vlanif200] ip address 10.10.20.1 24
    [RouterA-Vlanif200] quit
    

    # Enable the DHCP relay function on the interface.

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

  2. Configure the default route on RouterA.

    [RouterA] ip route-static 0.0.0.0 0.0.0.0 10.10.20.2
    

  3. Configure the DHCP server function based on the global IP address pool on RouterB.

    # Enable DHCP.

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

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

    [RouterB] vlan 200 
    [RouterB-vlan200] quit
    [RouterB] interface ethernet 2/0/0
    [RouterB-Ethernet2/0/0] port link-type trunk
    [RouterB-Ethernet2/0/0] port trunk allow-pass vlan 200
    [RouterB-Ethernet2/0/0] quit
    [RouterB] interface vlanif 200 
    [RouterB-Vlanif200] ip address 10.10.20.2 24
    [RouterB-Vlanif200] dhcp select global
    [RouterB-Vlanif200] quit

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

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

  4. Configure the default route on RouterB.

    [RouterB] ip route-static 0.0.0.0 0.0.0.0 10.10.20.1
    

  5. Verify the configuration.

    # Run the display dhcp relay interface vlanif 100 command on RouterA to view the DHCP relay configuration.

    [RouterA] 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
    

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

    [RouterB] 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   : 180A0A140A141401                                           
      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        :1                      
                         Idle        :252       Expired     :0                      
                         Conflict    :0         Disable     :0                      
                                                                                    
     -------------------------------------------------------------------------------
      Network section                                                               
             Start           End              Total    Used Idle(Expired) Conflict Disabled
     -------------------------------------------------------------------------------
             10.20.20.1      10.20.20.254     253       1        252(0)       0     0    
     -------------------------------------------------------------------------------

Configuration Files

  • RouterA configuration file

    #
     sysname RouterA
    #
    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 Ethernet2/0/0
     port link-type trunk
     port trunk allow-pass vlan 200
    #
    interface Ethernet2/0/1
     port link-type access
     port default vlan 100
    #
    ip route-static 0.0.0.0 0.0.0.0 10.10.20.2
    #
    return
  • RouterB configuration file

    #
     sysname RouterB
    #
    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 Ethernet2/0/0
     port link-type trunk
     port trunk allow-pass vlan 200
    #
    ip route-static 0.0.0.0 0.0.0.0 10.10.20.1
    #
    return
Translation
Download
Updated: 2019-05-20

Document ID: EDOC1100034231

Views: 83497

Downloads: 55

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