1. 安装DHCP
2. 配置DHCP
Add-DHCPServerv4Scope -Name “dhcpscope” -StartRange 100.100.100.20 -EndRange 100.100.100.30 -SubnetMask 255.255.255.0 -State Active
补充
1. 设置租约时间,为1天
Set-DhcpServerv4Scope -ScopeId 192.168.64.0 -LeaseDuration 1.00:00:00
2. 查看配置
Get-DhcpServerv4Scope
3. 重启
Restart-service dhcpserver
4. 设置DNS
Set-DhcpServerv4OptionValue -OptionId 6 -Value 209.45.20.1 -Force
5. 设置网关
Set-DhcpServerv4OptionValue -Router 100.100.100.254
6. MAC绑定IP
Add-DhcpServerv4Reservation -Scopeid 100.100.100.0 -IPAddress 100.100.100.25 -ClientId 000c29f3f06e -Description "qwe" -Name "winser A" -Type Dhcp
7. 删除区域
Remove-DhcpServerv4Scope -Scopeid 209.45.20.0