Configuring address allocation mode for a common address pool
IMPORTANT: | You can configure either a static binding or dynamic address allocation for a common address pool, but not both. |
You need to specify a subnet for dynamic address allocation. A static binding is a special address pool containing only one IP address.
Configuring static address allocation
Some DHCP clients, such as a WWW server, need fixed IP addresses. To provide a fixed IP address, you can create a static binding of a client's MAC address or client ID to an IP address in the DHCP address pool. A static binding is a special address pool containing only one IP address.
When the client with that MAC address or client ID requests an IP address, the DHCP server will assign the IP address from the binding to the client.
Follow these guidelines when you configure a static binding in a common address pool:
Use the static-bind ip-address command together with static-bind mac-address or static-bind client-identifier to accomplish a static binding configuration.
In a DHCP address pool, if you execute the static-bind mac-address command before the static-bind client-identifier command, the latter will overwrite the former and vice versa.
If you use the static-bind ip-address, static-bind mac-address, or static-bind client-identifier command repeatedly in the DHCP address pool, the new configuration will overwrite the previous one.
The IP address of the static binding cannot be an interface address of the DHCP server. Otherwise, an IP address conflict may occur and the bound client cannot obtain an IP address correctly.
The ID of the static binding must be identical to the ID displayed by using the display dhcp client verbose command on the client. Otherwise, the client cannot obtain an IP address.
The lease duration can be specified and takes effect for a static binding, but the lease duration from the display dhcp server ip-in-use all command output is still Unlimited.
When the device serves as a DHCP client or BOOTP client, you must bind the DHCP client's ID to an IP address, or bind the BOOTP client's MAC address to an IP address on the DHCP server. Otherwise, the DHCP or BOOTP client cannot obtain a static IP address.
If the interfaces on a DHCP client share the same MAC address, you must specify the client ID, rather than MAC address, in a static binding to identify the requesting interface. Otherwise, the client may fail to obtain an IP address.
To configure a static binding in a common address pool:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter common address pool view. | dhcp server ip-pool pool-name | N/A |
3. Specify the IP address. | static-bind ip-address ip-address [ mask-length | mask mask ] | No IP addresses are statically bound by default. |
4. Specify the MAC address or client ID. |
| Use at least one command. Neither is bound statically by default. |
5. Specify the lease duration for the IP address. | expired { day day [ hour hour [ minute minute [ second second ] ] ] | unlimited } | Optional. By default, the lease duration of the IP address is unlimited. |
Configuring dynamic address allocation
For dynamic address allocation, you must configure a DHCP address pool. For each address pool, you must specify one and only one address range, and the lease duration. A DHCP address pool can have only one lease duration.
To avoid address conflicts, configure the DHCP server to exclude IP addresses used by the gateway or FTP server from dynamic allocation.
Follow these guidelines when you configure dynamic address allocation for a common address pool:
In common address pool view, using the network or network ip range command repeatedly overwrites the previous configuration.
After you exclude IP addresses from automatic allocation by using the dhcp server forbidden-ip command, neither a common address pool nor an extended address pool can assign these IP addresses through dynamic address allocation.
Using the dhcp server forbidden-ip command repeatedly can exclude multiple IP address ranges from allocation.
To configure dynamic address allocation for a common address pool:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter common address pool view. | dhcp server ip-pool pool-name | N/A |
3. Specify a subnet. | network network-address [ mask-length | mask mask ] | Not specified by default. |
4. Specify the IP address range on the subnet for dynamic allocation. | network ip range min-address max-address | Optional. Not specified by default. |
5. Specify the address lease duration. | expired { day day [ hour hour [ minute minute ] [ second second ] ] | unlimited } | Optional. One day by default. |
6. Return to system view. | quit | N/A |
7. Exclude IP addresses from automatic allocation. | dhcp server forbidden-ip low-ip-address [ high-ip-address ] | Optional. Except IP addresses of the DHCP server interfaces, all addresses in the DHCP address pool are assignable by default. |