< Home

Configuring an IP Address Pool Using the CLI

This section describes how to use the CLI to configure an IP address pool.

  1. Access the system view.

    system-view

  2. Create a global address pool and enter the global address pool view.

    ip pool ip-pool-name

    By default, no global address pool is created on the device.

    The parameter ip-pool-name uniquely specifies the name of an address pool. For example, create a global address pool named global_f1 for employees on the first floor.
    [sysname] ip pool global_f1

  3. Optional: Specify the range of IP addresses that can be dynamically allocated from the global address pool.

    You can run either of the following commands:

    • section section-id start-address [ end-address ]

      An IP address pool consists of one or more IP address segments and IP address segments cannot overlap with each other.

    • network ip-address [ mask { mask | mask-length } ]

      An address pool can be configured with only one IP address segment. The IP address range is determined by the mask length.

    When you configure the IP address segments in the global address pool for the DHCP function, you must specify network, but section is optional. When you configure the IP address segments in the global address pool for other functions, you can specify network or section or specify both of them at the same time.

    Note the following points when running both the network and section commands:

    • If you run the network first, ensure that the address segment specified in the section command is included in the address range specified in the network command.
    • If you run the section first, ensure that the address segment specified in the network command includes the address range specified in the section command.

  4. Optional: Specify the range of IP addresses that cannot be automatically assigned to clients from the address pool.

    excluded-ip-address start-ip-address [ end-ip-address ]

    In an address pool, some IP addresses need to be reserved for other services, and some are statically assigned to certain hosts (such as the DNS server and WWW server), which cannot be automatically assigned to clients.

  5. Optional: Lock an IP address pool.

    lock

    After the lock command is run, the specified IP address pool is locked and IP addresses in this address pool cannot be assigned to clients.

  6. Optional: Set the lease for IP addresses in a global IP address pool.

    lease { day day [ hour hour [ minute minute ] ] | unlimited }

    This command applies to DHCP servers. To meet different client requirements, DHCP supports dynamic, automatic, and static address assignment.

    Different hosts require different IP address leases. For example, if some hosts such as a DNS server need to use certain IP addresses for a long time, run the lease command to set the IP address lease of the current global address pool to unlimited. If some hosts such as a portable computer just need to use temporary IP addresses, run the lease command to set the IP address lease of the current global address pool to the required time so that the expired IP addresses can be released and assigned to other clients.

    When a DHCP client starts or half of its IP address lease has passed, the DHCP client sends a DHCP Request message to the DHCP server to renew the lease.

    • If the IP address can be assigned to the client, the DHCP server informs the client that the IP address lease can be renewed.
    • If the IP address can no longer be assigned to the client, the DHCP server informs the client that the IP address lease cannot be renewed. The client needs to request for another IP address.

  7. Optional: Configure the DNS server address for the DHCP client.

    dns-list

    This command applies to DHCP servers. If user hosts access hosts on the network by domain names, user hosts need to send DNS requests to the DNS server and resolve the domain name to access for communication. To connect a DHCP client to the network, configure a DHCP server address so that the DHCP server can assign both the specified DNS server address and an IP address to the client.

  8. Optional: Configure the domain name suffix for the DHCP client.

    domain-name domain-name

    This command applies to DHCP servers. When allocating IP addresses to the client, the DHCP server also specifies domain names for clients. Run the domain-name command on the DHCP server to specify a domain name. When allocating IP addresses to clients, the DHCP server also sends the domain names to the clients.

  9. Optional: Configure the egress gateway address for the DHCP client.

    gateway-list

    This command applies to DHCP servers. If a DHCP server and its client are on different network segments, you can run the gateway-list command to specify an egress gateway address. In this way, the DHCP server and client can communicate with each other. Then the DHCP server can assign both an IP address and the specified egress gateway address to the client. You can configure multiple gateways in a global address pool to load balance traffic and improve network reliability.

  10. Optional: Configures the NetBIOS server address for the DHCP client.

    nbns-list

    This command applies to DHCP servers. Before hosts communicate with each other, a NetBIOS server needs to resolve the accessedNetBIOS hostname to an IP address. To enable hosts to communicate with each other, run the nbns-list command to configure NetBIOS server addresses. When assigning IP addresses to clients, a DHCP server also assigns the configured NetBIOS server addresses to clients.

  11. Optional: Configure the NetBIOS node type for the DHCP client.

    netbios-type { b-node | h-node | m-node | p-node }

    This command applies to DHCP servers. When a DHCP client uses NetBIOS for communication, its host name needs to be mapped to an IP address, and the NetBIOS node type needs to be specified for it using the netbios-type command. When a DHCP server assigns an IP address to clients, it also sends the specified NetBIOS node type to clients.

  12. Optional: Configure the IP address of a server for the DHCP client after the client automatically obtains the IP address.

    next-server ip-address

    The next-server command is used on DHCP servers. When assigning a client an IP address, a DHCP server can also assign the client an IP address of the server that provides network services for the client. For example, after obtaining IP addresses, clients such as IP phones need parameters such as the startup configuration file to work normally. You can run the next-server command to specify the server address used after a client obtains an IP address. The client then requests the configuration parameters from the specified server after obtaining an IP address.

  13. Optional: Configures the user-defined option that a DHCP server assigns to a DHCP client.

    option code [ sub-option sub-code ] { ascii ascii-string | hex hex-string | cipher cipher-string | ip-address ip-address &<1-8> }

    This command applies to DHCP servers. The option field in a DHCP packet carries control information and parameters. If a DHCP server is configured with options, when a DHCP client applies for an IP address, the client can obtain the configurations in the option field of the DHCP response packet from the DHCP server.

  14. Optional: Configure the classless static route for the DHCP client.

    option121 ip-address { ip-address mask-length gateway-address } &<1-8>

    The option121 command applies to only the DHCP server. The option121 command configures Option 121 that defines a classless static route allocated to a client.

    mask-length and gateway-address specify a classless static route. The option121 command configures a maximum of eight classless static routes.

  15. Optional: Configures the Option 184 field for the DHCP client.

    option184 { as-ip ip-address | fail-over ip-address dialer-string | ncp-ip ip-address | voice-vlan vlan-id }

  16. Optional: Configures the name of the server from which the DHCP client obtains the startup configuration file.

    sname sname

    Besides assigning IP addresses, a DHCP server can also provide the required network configuration parameters, such as the startup configuration file name for the DHCP client. After the name of the server from which the DHCP client obtains the startup configuration file is configured using the sname command, the DHCP client obtains the startup configuration file from this server.

  17. Optional: Bind an IP address in a global address pool to a MAC address of a client.

    static-bind ip-address ip-address mac-address mac-address

    This command applies to DHCP servers. To meet different client requirements, DHCP supports dynamic, automatic, and static address assignment. If some special clients such as the Web server need to be statically assigned a fixed IP address, run the static-bind command to bind a fixed IP address to the MAC address of the client. When the DHCP server receives a Request message for applying for an IP address from a special client, the server assigns the fixed IP address bound to the MAC address of the client to this client.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic