Home
Operating System
Windows
Linux
Tutorial
Windows Server
About
☰
DHCP SERVER ON WINDOWS SERVER
# Install DHCP Server Role and Management Tools
Install-WindowsFeature -Name DHCP -IncludeManagementTools
✏️ Edit
📋 Copy
Copied!
# Authorize DHCP Server in Active Directory
Add-DhcpServerInDC -DnsName $env:COMPUTERNAME -IPAddress 172.31.255.14
✏️ Edit
📋 Copy
Copied!
# Create the DHCP Scope
# Define variables $ScopeID = "172.31.255.0" $StartIP = "172.31.255.4" $EndIP = "172.31.255.13" $Subnet = "255.255.255.240" $Gateway = "172.31.255.1" $DNS1 = "172.31.255.14" $DNS2 = "8.8.8.8" $Domain = "server.kh" $LeaseTime = New-TimeSpan -Days 2 -Hours 12 -Minutes 30 # 1. Create the New Scope Add-DhcpServerv4Scope -Name "DCHP_IP" -StartRange $StartIP -EndRange $EndIP -SubnetMask $Subnet -State Active -Description "DCHP TEST" # 2. Set Default Gateway (Router) Set-DhcpServerv4OptionValue -ScopeId $ScopeID -Router $Gateway # 3. Set DNS Servers and Parent Domain Name Set-DhcpServerv4OptionValue -ScopeId $ScopeID -DnsServer $DNS1, $DNS2 -DnsDomain $Domain # 4. Set Lease Duration Set-DhcpServerv4Scope -ScopeId $ScopeID -LeaseDuration $LeaseTime
✏️ Edit
📋 Copy
Copied!
Labels
all
(21 )
autocad
(3 )
css
(2 )
linux
(5 )
op_system
(18 )
website
(4 )
windows
(14 )
windowsServer
(17 )