接口下开启DHCP dhcp enable //全局开启DHCP服务,如果没开,下面的操作无法进行 # interface vlan 10 # dhcp select interface //开启接口DHCP # dhcp server dns-list 223.5.5.5 114.114.114.114 //分配DNS # interface vlan 20 # dhcp select interface # dhcp server dns-list 223.5.5.5 114.114.114.114 # interface vlan 10 dhcp server excluded-ip-address 192.168.255.6 排除指定ip |
全局开启DHCP dhcp enable # ip pool vlan20 //提示创建成功 # network 192.168.254.0 mask 24 //分配网段以及掩码 # gateway-list 192.168.254.254//分配网关地址 # dns-list 223.5.5.5 114.114.114.114 //分配DNS信息 # excluded-ip-address # interface vlan 20 # dhcp select global//接口下调用,调用方式为全局 # DHCP-中继 全局方式 dhcp server group 1 # dhcp-server 1.1.1.1 //真实DHCP服务器ip # interface vlan 1 # dhcp select relay # dhcp relay server-select 1 # 接口方式 interface vlan 2 # dhcp select relay # dhcp relay server-ip 1.1.1.1 |