dhcp

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

Release
Modification

12.2(46)SE

This command was introduced.

 

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

ip-address

IP address reserved for the client.

mac-address

Hardware address of the client.

hardware-number

(Optional) ARP hardware specified in an online database at http://www.iana.org/assignments/arp-parameters. The valid range is from 0 to 255.

 

Command Default

IP addresses are not reserved.

Command Modes

DHCP pool configuration (dhcp-config)

Command History

Release
Modification

12.2(46)SE

This command was introduced.

 

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

Release
Modification

12.2(13)ZH

This command was introduced.

12.3(4)T

This command was integrated into Cisco IOS Release 12.3(4)T.

12.2(28)SB

This command was integrated into Cisco IOS Release 12.2(28)SB.

12.2(33)SRB

This command was integrated into Cisco IOS Release 12.2(33)SRB.

 

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

Command
Description

ip dhcp class

Defines a DHCP class and enters DHCP class configuration mode.

 

 

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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值