<Huawei>system-view -- 进去配置模式
[Huawei]dhcp enable 开启dhcp服务
配置防止IP地址重复分配功能
dhcp snooping enable 在全局模式开启dhcp监听功能 (在可以接口配置)
[Huawei] dhcp server ping packet 3 ping 3次包
[Huawei] dhcp server ping timeout 100 超时100毫秒
Info: The operation may take a few seconds. Please wait for a moment.done. --操作可能需要几秒钟
配置地址池
ip pool vlan10 创建地址池名字是vlan10
gateway-list 192.168.1.254 地址池网关
network 192.168.1.0 mask 255.255.255.0 地址池下发网段
static-bind ip-address 192.168.1.1 mac-address 5489-9825-19cd dhcp全局下发IP地址和Mac绑定
excluded-ip-address 192.168.1.9 192.168.1.253 地址不下发范围
dns-list 192.168.1.254 dns服务
lease day 3 租期为3天
ip pool vlan20 创建地址池名字是vlan20
gateway-list 192.168.2.254 地址池网关
network 192.168.2.0 mask 255.255.255.0 地址池下发网段
static-bind ip-address 192.168.2.1 mac-address 5489-9848-51B1 dhcp下发IP地址和Mac绑定
excluded-ip-address 192.168.2.9 192.168.2.253 地址不下发范围
dns-list 192.168.2.254 配置dns服务
lease day 3 租期为3天
配置接口接入vlan
interface GigabitEthernet0/0/1 进入接口
port link-type access 配置acces模式
port default vlan 10 加入vlan10
interface GigabitEthernet0/0/2 进入接口
port link-type access 配置acces模式
port default vlan 20 加入vlan20
查看地址池ip使用情况
dis ip pool name vlan10 used
回收地址
<Huawei> reset ip pool name pool1 192.168.2.1 回收IP地址192.168.2.1
<Huawei> reset ip pool name pool1 192.168.1.1 回收IP地址192.168.1.1
<Huawei> reset ip pool name pool1 all //回收所有的IP地址
关闭DHCP服务
[Huawei] undo dhcp enable