Example for Assigning IPv4 Addresses from a Local Address Pool

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

Networking Requirements

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

  • The local address pool is used to assign IP addresses to users in the domain isp1.

  • The IP addresses in the address pool range from 10.10.10.3 to 10.10.10.100, and the gateway address is 10.10.10.2.

  • The IP address of the DNS server is 10.20.20.1.

  • The IP address of the interface GE0/1/16 which is connected to the DNS server is 10.20.20.2.

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

Figure 1 Networking diagram for assigning IPv4 addresses from a local 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

Access users include IPoE users and PPPoE users. The address assignment for the two types of users differs in the access mode. This section describes only the IPv4 address pool configurations. For details about the IPoE access configuration, see Example for Configuring the Common IPoE Access Service.

The configuration roadmap is as follows:

  1. Configure a local address pool, including its gateway address, address range, and the IP address of the DNS server.

  2. Configure a domain named isp1 to which the users belong, including the authentication mode and the accounting mode.

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

Data Preparation

To complete the configuration, you need the following data:

  • Name of the address pool, range of the addresses in the pool, and IP addresses of the gateway and DNS server

  • Name of the user domain

  • Authentication mode and accounting mode

Procedure

  1. Configure the DHCPv4 server.

    # Configure an address pool.

    <HUAWEI> system-view
    [~HUAWEI] ip pool pool1 bas local
    [*HUAWEI-ip-pool-pool1] gateway 10.10.10.2 255.255.255.0
    [*HUAWEI-ip-pool-pool1] section 0 10.10.10.3 10.10.10.100
    [*HUAWEI-ip-pool-pool1] dns-server 10.20.20.1
    [*HUAWEI-ip-pool-pool1] commit
    [~HUAWEI-ip-pool-pool1] quit

    # Configure an authentication mode in the authentication template view.

    [~HUAWEI] aaa
    [~HUAWEI-aaa] authentication-scheme clcl
    [*HUAWEI-aaa-authen-clcl] authentication-mode none
    [*HUAWEI-aaa-authen-clcl] commit
    [~HUAWEI-aaa-authen-clcl] quit

    # Configure an accounting mode in the accounting template view.

    [~HUAWEI-aaa] accounting-scheme ccll
    [*HUAWEI-aaa-accounting-ccll] accounting-mode none
    [*HUAWEI-aaa-accounting-ccll] commit
    [~HUAWEI-aaa-accounting-ccll] quit

    # Configure a domain named isp1.

    [~HUAWEI-aaa] domain isp1
    [*HUAWEI-aaa-domain-isp1] authentication-scheme clcl
    [*HUAWEI-aaa-domain-isp1] accounting-scheme ccll
    [*HUAWEI-aaa-domain-isp1] commit
    [~HUAWEI-aaa-domain-isp1] ip-pool pool1
    [~HUAWEI-aaa-domain-isp1] quit
    [~HUAWEI-aaa] quit

    # Configure a BAS interface.

    [~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 isp1
    [*HUAWEI-GigabitEthernet0/1/0.1-bas] commit
    [~HUAWEI-GigabitEthernet0/1/0.1-bas] quit
    [~HUAWEI-GigabitEthernet0/1/0.1] quit
    # Configure the IP address of GE 0/1/16, which is connected to the DNS server.
    [~HUAWEI] interface GigabitEthernet 0/1/16
    [~HUAWEI-GigabitEthernet0/1/16] ip address 10.20.20.2 255.255.255.0
    [*HUAWEI-GigabitEthernet0/1/16] commit
    [~HUAWEI-GigabitEthernet0/1/16] quit

  2. Verify the configuration.

    # Check the configurations of the local address pool pool1.

    [~HUAWEI] display ip pool name pool1
      Pool-Name      : pool1
      Pool-No        : 19 
      Pool-constant-index :- 
      Lease          : 3 Days 0 Hours 0 Minutes
      NetBois Type   : N-Node
      DNS-Suffix     : -,
      DNS1         :10.20.20.1
      Position       : Local           Status           : Unlocked
      Gateway        : 10.10.10.2      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.3    10.10.10.100    98     0    98     0       0        0           0
      ---------------------------------------------------------------------------------------

    # Check the configurations of the domain isp1.

    [~HUAWEI] display domain isp1
     ------------------------------------------------------------------------------
      Domain-name                     : isp1
      Domain-state                    : Active
      Authentication-scheme-name      : default0
      Accounting-scheme-name          : default0
      Authorization-scheme-name       :
      Primary-DNS-IP-address          : -
      Second-DNS-IP-address           : -
      Web-server-URL-parameter        : No
      Portal-server-URL-parameter     : No
      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
      mscg-name-portal-key            : -
      Portal-user-first-url-key       : -
      Ancp auto qos adapt             : Disable
      Service-type                    : STB
      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            : pool1
      Quota-out                     : Offline
      ------------------------------------------------------------------------------

Configuration Files

  • Configuration file
#
 sysname HUAWEI

#
ip pool pool1 bas local
 gateway 10.10.10.2 255.255.255.0
 section 0 10.10.10.3 10.10.10.100
 dns-server 10.20.20.1
#
aaa
 authentication-scheme clcl
  authentication-mode none
 authorization-scheme default
 #
 accounting-scheme ccll
  accounting-mode none
 #
 domain isp1
  authentication-scheme clcl
  accounting-scheme ccll
  ip-pool pool1
 #
interface GigabitEthernet0/1/0.1
 statistic enable
 user-vlan 1
 bas
 #
  access-type layer2-subscriber default-domain authentication isp1
  authentication-method bind
#
interface GigabitEthernet0/1/16
 undo shutdown
 ip address 10.20.20.2 255.255.255.0
#
return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >