基于端口举例
要求:vlan10上自动获取192.168.10.101到192.168.10.200的IP
# 使能DHCP服务
dhcp enable
# 配置vlan
vlan10
quit
# 配置逻辑端口
interface vlanif 10
ip address 192.168.10.1 24
# 配置DHCP选项
dhcp select interface
dhcp server exclude 192.168.10.2 192.168.10.100
dhcp server exclude 192.168.10.201 192.168.10.254
dhcp server dns-list 192.168.10.3 192.168.10.4
基于全局配置
要求:vlan20上自动取192.168.20.101到192.168.20.200的IP
# 使能DHCP
dhcp enable
# 配置DHCP地址池
ip pool vlan20-pool
gateway-list 192.168.20.1
network 192.168.20.0 mask 255.255.255.0
dns-list 192.168.20.3 192.168.20.4
# 配置vlan
vlan 20
quit
# 配置逻辑端口
interface vlanif 20
ip address 192.168.20.1 24
dhcp select global
转载于:https://blog.51cto.com/huanghai/2315927