预期效果描述:
VLAN100中的PC终端DHCP获得IP为192.168.100.X 操作如下:
1、[HuaWei]dhcp enable ##开启dhcp功能
2、[HuaWei]ip pool VLAN100_DHCP ##创建一个名字为VLAN100_DHCP的地址池
[HuaWei-ip pool VLAN100_DHCP]
3、进入新创建的VLAN100_DHCP地址池,配置地址池的网段192.168.100.0,网关192.168.100.254,dns114.114.114.114,如下:
[HuaWei-ip pool VLAN100_DHCP]network 192.168.100.0 mask 255.255.255.0
[HuaWei-ip pool VLAN100_DHCP]gateway-list 192.168.100.254
[HuaWei-ip pool VLAN100_DHCP]dns-list 114.114.114.114
4、自定义DHCP的IP租期为0天1小时
[HuaWei-ip pool VLAN100_DHCP]lease day 0 hour 1 minute 0
5、在vlanif接口下,设置dhcp获取方式为global
[HuaWei-ip pool VLAN100_DHCP]dhcp select global
6、备注:自定义某此IP地址不对外分配,方法如下
[HuaWei-ip pool VLAN100_DHCP]excluded-ip-address 192.168.100.126 192.168.100.127
查看DHCP分配情况:
<Huawei>dis ip pool name vlan100_dhcp ?
X.X.X.X Start IP address to be display
all Detail information
conflict Information of conflict IP address
expired Information of expired IP address
used Information of used IP address
| Matching output
<cr> <Huawei>dis ip pool name vlan100_dhcp used
Pool-name : vlan10_dhcp
Pool-No : 0
Lease : 0 Days 1 Hours 0 Minutes
Domain-name : -
DNS-server0 : 114.114.114.114
NBNS-server0 : -
Netbios-type : -
Position : Local Status : Unlocked
Gateway-0 : 192.168.100.254
Mask : 255.255.255.0
VPN instance : --
-----------------------------------------------------------------------------
Start End Total Used Idle(Expired) Conflict Disable
-----------------------------------------------------------------------------
192.168.100.1 192.168.100.254 253 3 247(0) 0 3
-----------------------------------------------------------------------------
Network section :
--------------------------------------------------------------------------
Index IP MAC Lease Status
--------------------------------------------------------------------------
250 192.168.100.251 5489-984b-0c9d 998 Used
251 192.168.100.252 5489-9842-62ae 998 Used
252 192.168.100.253 5489-9896-5ca9 998 Used
--------------------------------------------------------------------------