华为交换机dhcp设置_第1张图片

system-view
[HUAWEI] sysname Switch
[Switch] dhcp enable

配置接口加入VLAN

vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
interface GigabitEthernet0/0/1
port link-type access
port default vlan 20

interface GigabitEthernet0/0/2
port link-type access
port default vlan 10

配置VLANIF接口IP地址

interface Vlanif20
ip address 10.10.20.254 255.255.255.0
quit

interface Vlanif10
ip address 10.10.10.254 255.255.255.0
quit

配置接口地址池

interface vlanif 10
dhcp select interface //使能接口采用接口地址池的DHCP服务器功能,缺省未使能
dhcp server lease day 30 //租期的缺省值为1天,修改租期为30天
dhcp server static-bind ip-address 10.10.10.100 mac-address 286e-d488-b684 //为Client_1分配固定的IP地址
dhcp server dns-list 8.8.8.8 //DNS
quit

interface vlanif 20
dhcp select interface //使能接口采用接口地址池的DHCP服务器功能,缺省未使能
dhcp server lease day 30 //租期的缺省值为1天,修改租期为30天
dhcp server static-bind ip-address 10.10.20.100 mac-address 286e-d488-b684 //为Client_1分配固定的IP地址
dhcp server dns-list 8.8.8.8 //DNS
quit

(基于全局地址池)

ip pool vlan10
gateway-list 10.10.10.254
network 10.10.10.0 mask 255.255.255.0
lease day 10 hour 0 minute 0
dns-list 10.1.2.3
static-bind ip-address 10.1.1.4 mac-address dcd2-fc96-e4c0 option-template template1 固定IP

vlanif10下配置

interface Vlanif10
ip address 10.10.10.254 255.255.255.0
dhcp select global

接口使用hybrid

interface GigabitEthernet0/0/1
port link-type hybrid 默认端口 display不显示
port hybrid pvid vlan 10
port hybrid untagged vlan 10