这里我们以vlan31进行描述
ip dhcp pool vlan31
network 172.31.255.0 255.255.255.0
default-router 172.31.255.254
dns-server 202.96.209.133 8.8.8.8
1、先将特殊IP地址从dhcp中剔除掉,以免后面造成ip地址冲突
ip dhcp excluded-address 172.31.255.1
ip dhcp excluded-address 172.31.255.100
2、编写一个静态IP地址的pool
ip dhcp pool static_vlan31_1
host 172.31.255.100 255.255.255.0
client-identifier 015c.f9dd.48c0.da //mac前面要补“01”
dns-server 202.96.209.133 8.8.8.8
default-router 172.31.255.254
lease infinite //永久
3、验证IP地址
备注
dmz_cisco3750#clear ip dhcp binding * //如果要立即生效,需要清空自动分配ip的缓存
dmz_cisco3750#show ip dhcp binding
IP address Client-ID/ Lease expiration Type
Hardware address
172.31.255.100 015c.f9dd.48c0.da Infinite Manual
dmz_cisco3750#