A Step-by-Step Guide to Configuring DHCP on Windows Server 2016 Using GUI and PowerShell.
带图形用户界面
1. 跑步 这 DHCP console from the apps list. 导航 IPv4\Server Options. There we config Server options for all scopes;
2. 鼠标右键 click at Server Options 然后单击 Configure Options;
3. Select option 006 DNS Servers, 进入 an IP address, 然后单击 添加;
4. Select option 015 DNS Domain Name, enter the domain name, 然后单击 好的;
5. New options added;
6. 鼠标右键 click at IPv4 然后单击 New Scope;
7. 点击 下一个;
8. 进入 姓名 (and if you wish 描述), 然后单击 下一个;
9. 进入 the Start IP address, End IP address, 和 Subnet mask, 然后单击 下一个;
10. On this page, you may exclude the IP range from DHCP. 点击 下一个;
11. 放 Lease Duration 然后单击 下一个;
12. You may select 是的 and configure Scope Options for this scope. 我选择 不, 点击 下一个;
13. 点击 结束;
14. Scope created, but we must Activate it;
15. 鼠标右键 click at the scope and click Activate;
16. Scope activated and worked!
17. If you 鼠标右键 点击 Leased IP Address, you may Add to the reservation Add to the filter, or even 删除 it;
使用 PowerShell
1. 跑步 电源外壳 作为管理员. To get active scopes enter:
Get-DhcpServerv4Scope -cn <dhcp server name> | select scopeid, name, description
2. To add new scope, 进入:
Add-DhcpServerv4Scope -Name ‘<scope name>’ -StartRange <start IP Address> -EndRange <end IP Address> -SubnetMask <subnet mask> -Description ‘<description>’ –cn <dhcp server name>
3. Before scope delete 最佳实践 is run the command with WhatIf 范围:
Remove-DhcpServerv4Scope -ScopeId <scope id> -cn <dhcp server name> -WhatIf
4. Then run without the WhatIf 范围:
Remove-DhcpServerv4Scope -ScopeId <scope id> -cn <dhcp server name>
5. Scope removed.