address client-id
To reserve an IP address for a DHCP client identified by client identifier, use the address client-id command in DHCP pool configuration mode. To remove the reserved address, use the no form of this command.
address ip-address client-id string [ascii]
no address ip-address client-id string [ascii]
Syntax Description
ip-address | IP address reserved for the client. |
string | A unique ASCII string or hexadecimal string. |
ascii | (Optional) Client ID is in ASCII string form. |
Command Default
IP addresses are not reserved.
Command Modes
DHCP pool configuration (dhcp-config)
Command History
Usage Guidelines
The address client-id command can be used to create reserved addresses in pools for any DHCP client identified by the client identifier option in the DHCP packet. You can also reserve an IP address for a DHCP client that is configured to use the port-based address allocation feature. For port-based address allocation, the string argument must be the short name of the interface (port) and the ascii keyword must be specified.
Examples
In the following example, a subscriber ID will be automatically generated based on the short name of the interface (port) specified by the address client-id command. The DHCP server will ignore any client identifier fields in the DHCP messages and use this subscriber ID as the client identifier. The DHCP client is preassigned IP address 10.1.1.7.
ip dhcp use subscriber-id client-id
ip dhcp subscriber-id interface-name
ip dhcp excluded-address 10.1.1.1 10.1.1.3
ip dhcp pool dhcppool
network 10.1.1.0 255.255.255.0
address 10.1.1.7 client-id ethernet 1/0 ascii
Related Commands
Command
|
Description
|
---|---|
address hardware-address | Reserves an IP address for a client identified by hardware address. |
address hardware-address
To reserve an IP address for a client identified by hardware address, use the address hardware-address command in DHCP pool configuration mode. To remove the reserved address, use the no form of this command.
address ip-address hardware-address mac-address [hardware-number]
no address ip-address hardware-address mac-address
Syntax Description
Command Default
IP addresses are not reserved.
Command Modes
DHCP pool configuration (dhcp-config)
Command History
Usage Guidelines
This command is used to reserve an IP address for clients identified by the hardware address included in the fixed-size header of the DHCP message.
Examples
In the following example, an IP address is reserved for a client that is identified by its hardware address:
address 10.10.10.3 hardware-address b708.1388.f166
Related Commands
Command
|
Description
|
---|---|
address client-id | Reserves an IP address for a DHCP client identified by the client identifier. |
address range
To set an address range for a Dynamic Host Configuration Protocol (DHCP) class in a DHCP server address pool, use the address range command in DHCP pool class configuration mode. To remove the address range, use the no form of this command.
address range start-ip end-ip
no address range start-ip end-ip
Syntax Description
start-ip | Starting IP address that defines the range of addresses in the address pool. |
end-ip | Ending IP address that defines the range of addresses in the address pool. |
Defaults
No default behavior or values
Command Modes
DHCP pool class configuration
Command History
Usage Guidelines
If this command is not configured for a DHCP class in a DHCP server address pool, the default value is the entire subnet of the address pool.
Examples
The following example sets the available address range for class 1 from 10.0.20.1 through 10.0.20.100:
ip dhcp pool ABC
network 10.0.20.0 255.255.255.0
class CLASS1
address range 10.0.20.1 10.0.20.100
Related Commands
DHCP 根据MAC分配IP地址
在CISCO设备的DHCP中的MAC表达方式有点令人奇怪!
这么一长段才表示一个MAC: 0063.6973.636f.2d63.6330.332e.3135.3634.2e30.3030.302d.4661.302f.30
现有两设备:
—-DHCP服务器(CIsco 2610) ————客户端(CISCO2610)——-
客户端的MAC为:
Hardware is AmdFE, address is cc03.1564.0000 (bia cc03.1564.0000)
DHCP服务器配置:
!
结果示例:(自动获取IP)
P1R1#show ip dhcp binding
IP address Client-ID/ Lease expiration Type
Hardware address
192.168.99.2 aabb.ccdd.eeff Infinite Manual
192.168.99.3 0063.6973.636f.2d63. Mar 25 1993 12:30 AM Automatic
6330.332e.3135.3634.
2e30.3030.302d.4661.
302f.30
192.168.99.5 aabb.ccdd.ee00 Infinite Manual
结果示例:(手工分配IP)
ip dhcp pool statictest
host 192.168.99.100 255.255.255.0
client-identifier 0063.6973.636f.2d63.6330.332e.3135.3634.2e30.3030.302d.4661.302f.30
P1R1#show ip dhcp binding
IP address Client-ID/ Lease expiration Type
Hardware address
192.168.99.2 aabb.ccdd.eeff Infinite Manual
192.168.99.5 aabb.ccdd.ee00 Infinite Manual
192.168.99.100 0063.6973.636f.2d63. Infinite Manual
6330.332e.3135.3634.
2e30.3030.302d.4661.
302f.30
P1R1#
配置示例:(使用设备端MAC)
ip dhcp pool cc03.1564.0000
host 192.168.99.77 255.255.255.0
client-identifier cc03.1564.0000
!
结果:
P1R1#show ip dhcp b
IP address Client-ID/Hardware address Lease expiration Type
192.168.99.6 0063.6973.636f.2d63. Mar 25 1993 12:46 AM Automatic
6330.332e.3135.3634.
2e30.3030.302d.4661.
302f.30
192.168.99.77 cc03.1564.0000 Infinite Manual