Example for Assigning Addresses from a Remote Address Pool

This section provides an example for assigning IPv4 addresses from a remote IP address pool.

Networking Requirements

As shown in Figure 1, a remote address pool needs to be configured to assign IP addresses to access users. The requirements are as follows:

  • The remote address pool is used to assign IP addresses to users in the domain isp2.

  • The router functioning as a relay agent connects to the DHCPv4 server through GE 0/1/16 whose IP address is 10.1.1.2/24.

  • The IP address of the DHCPv4 server bound to the remote address pool is 10.1.1.1, and no backup DHCPv4 server is deployed.

  • Non-authentication and non-accounting are adopted by the user.

Figure 1 Networking diagram for assigning IPv4 addresses from a remote address pool

Interfaces 1 through 3 in this example represent GE 0/1/0.1, GE 0/1/8, and GE 0/1/16, respectively.



Configuration Roadmap

The configuration roadmap is as follows:

  1. Create a DHCPv4 server group and a remote address pool, and bind the address pool to the DHCPv4 server group.

  2. Configure the domain isp2 to which the user belongs, including the authentication mode and the accounting mode.

  3. Configure the BAS interface, including the user access mode.

Data Preparation

To complete the configuration, you need the following data:

  • Name of the address pool

  • IP address of the gateway

  • Name of the user domain

  • IP address of the interface that connects the router to the DHCPv4 server

  • User access mode

Procedure

  1. Configure the router.

    # Create a DHCPv4 server group.

    <HUAWEI> system-view
    [~HUAWEI] dhcp-server group group1
    [*HUAWEI-dhcp-server-group-group1] dhcp-server 10.1.1.1
    [*HUAWEI-dhcp-server-group-group1] commit
    [~HUAWEI-dhcp-server-group-group1] quit

    # Create a remote address pool, and bind the pool to the DHCPv4 server group.

    [~HUAWEI] ip pool pool2 bas remote
    [~HUAWEI-ip-pool-pool2] gateway 10.10.10.1 24
    [~HUAWEI-ip-pool-pool2] dhcp-server group group1
    [*HUAWEI-ip-pool-pool2] commit
    [~HUAWEI] quit

    # Configure a domain named isp2.

    [~HUAWEI] aaa
    [~HUAWEI-aaa] domain isp2
    [*HUAWEI-aaa-domain-isp2] authentication-scheme default0
    [*HUAWEI-aaa-domain-isp2] accounting-scheme default0
    [*HUAWEI-aaa-domain-isp2] commit
    [~HUAWEI-aaa-domain-isp2] ip-pool pool2
    [*HUAWEI-aaa-domain-isp2] commit
    [~HUAWEI-aaa-domain-isp2] quit
    [~HUAWEI-aaa] quit

    # Configure the router interface for user access.

    [~HUAWEI] interface GigabitEthernet 0/1/0.1
    [*HUAWEI-GigabitEthernet0/1/0.1] commit
    [~HUAWEI-GigabitEthernet0/1/0.1] user-vlan 1
    [~HUAWEI-GigabitEthernet0/1/0.1-vlan-1-1] bas
    [~HUAWEI-GigabitEthernet0/1/0.1-bas] access-type layer2-subscriber
    [~HUAWEI-GigabitEthernet0/1/0.1-bas] authentication-method bind
    [~HUAWEI-GigabitEthernet0/1/0.1-bas] default-domain authentication isp2
    [*HUAWEI-GigabitEthernet0/1/0.1-bas] commit
    [~HUAWEI-GigabitEthernet0/1/0.1-bas] quit
    [~HUAWEI-GigabitEthernet0/1/0.1] quit

    # Configure the router interface used to connect to the DHCPv4 server.

    [~HUAWEI] interface GigabitEthernet 0/1/16
    [~HUAWEI-GigabitEthernet0/1/16] ip address 10.1.1.2 255.255.255.0
    [*HUAWEI-GigabitEthernet0/1/16] commit
    [~HUAWEI-GigabitEthernet0/1/16] quit

  2. Verify the configuration.

    # Check the configurations of the DHCPv4 server group group1.

    [~HUAWEI] display dhcp-server group group1
      Group-Name          : group1
      Release-Agent       : Support
      Primary-Server      : 10.1.1.1
        Vpn instance      : --
      Weight              : 0
      Status              : up
      Secondary-Server    : --
        Vpn instance      : --
      Weight              : 0
      Status              : -
      Algorithm           : master-backup
      Source              : --
      Giaddr              : --

    # Check the configurations of the remote address pool pool2.

    [~HUAWEI] display ip pool name pool2
      Pool-Name      : pool2
      Pool-No        : 0 
      Pool-constant-index :- 
      DHCP-Group     : group1
      Position       : Remote          Status           : Unlocked
      Gateway        : 10.10.10.1      Mask             : 255.255.255.0
      Vpn instance   : --
      Profile-Name   : -               Server-Name      : -
      Codes: CFLCT (conflicted)
    
      ---------------------------------------------------------------------------------------
      ID           start             end total  used  idle CFLCT disable reserved static-bind
      ---------------------------------------------------------------------------------------
       0      10.10.10.0    10.10.10.255   256     0   256     0       0        0           0
      ---------------------------------------------------------------------------------------

    # Check the configurations of the domain isp2.

    [~HUAWEI] display domain isp2
     ------------------------------------------------------------------------------
      Domain-name                     : isp2
      Domain-state                    : Active
      Authentication-scheme-name      : default0
      Accounting-scheme-name          : default0
      Authorization-scheme-name       :
      Primary-DNS-IP-address          : -
      Second-DNS-IP-address           : -
      Primary-NBNS-IP-address         : -
      Second-NBNS-IP-address          : -
      User-group-name                 : -
      Idle-data-attribute (time,flow) : 0, 60
      Install-BOD-Count               : 0
      Report-VSM-User-Count           : 0
      Value-added-service             : default
      User-access-limit               : 279552
      Online-number                   : 0
      Web-IP-address                  : -
      Web-URL                         : -
      Portal-server-IP                : -
      Portal-URL                      : -
      Portal-force-times              : 2
      PPPoE-user-URL                  : Disable
      IPUser-ReAuth-Time(second)      : 300
      Ancp auto qos adapt             : Disable
      RADIUS-server-template          : -
      Two-acct-template               : -
      HWTACACS-server-template        : -
      Bill Flow                       : Disable
      Tunnel-acct-2867                : Disabled
    
      Flow Statistic:
      Flow-Statistic-Up               : Yes
      Flow-Statistic-Down             : Yes
      Source-IP-route                 : Disable
      IP-warning-threshold            : -
      Multicast Forwarding            : Yes
      Multicast Virtual               : No
      Max-multilist num               : 4
      Multicast-profile               : -
      IP-address-pool-name            : pool2
      Quota-out                     : Offline
      ------------------------------------------------------------------------------
    

Configuration Files

  • Configuration file
#
 sysname HUAWEI

#
ip pool pool2 bas remote
 gateway 10.10.10.1 255.255.255.0
 dhcp-server group group1
#
dhcp-server group group1
 dhcp-server 10.1.1.1
#
aaa
 authentication-scheme default0
 authorization-scheme default
 #
 accounting-scheme default0
 #
domain isp2
 authentication-scheme default0
 accounting-scheme default0
 ip-pool pool2
 #
interface GigabitEthernet0/1/0.1
 statistic enable
 user-vlan 1
 bas
 #
  access-type layer2-subscriber default-domain authentication isp2
  authentication-method bind
#
interface GigabitEthernet0/1/16
 undo shutdown
 ip address 10.1.1.2 255.255.255.0
#
return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic