Skip to content

DHCP Configuration

SettingValue
Serversrv-dc-zrh-01
IP10.30.30.10
Terminal window
# Install DHCP role
Install-WindowsFeature DHCP -IncludeManagementTools
# Authorize in AD
Add-DhcpServerInDC -DnsName "srv-dc-zrh-01.microsoftlab.ch" -IPAddress 10.30.30.10
# Flag as configured
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\ServerManager\Roles\12" -Name "ConfigurationState" -Value 2
Terminal window
# Create scope
Add-DhcpServerv4Scope -Name "zrh-srv-v30" `
-StartRange 10.30.30.100 `
-EndRange 10.30.30.200 `
-SubnetMask 255.255.255.0 `
-LeaseDuration 8.00:00:00 `
-State Active
# Set options
Set-DhcpServerv4OptionValue -ScopeId 10.30.30.0 -Router 10.30.30.1
Set-DhcpServerv4OptionValue -ScopeId 10.30.30.0 -DnsServer 10.30.30.15, 10.30.30.10
Set-DhcpServerv4OptionValue -ScopeId 10.30.30.0 -DnsDomain "corp.microsoftlab.ch"
Terminal window
# Create scope (/22 subnet)
Add-DhcpServerv4Scope -Name "zrh-clt-v40" `
-StartRange 10.40.40.100 `
-EndRange 10.40.43.254 `
-SubnetMask 255.255.252.0 `
-LeaseDuration 8.00:00:00 `
-State Active
# Set options
Set-DhcpServerv4OptionValue -ScopeId 10.40.40.0 -Router 10.40.40.1
Set-DhcpServerv4OptionValue -ScopeId 10.40.40.0 -DnsServer 10.30.30.15, 10.30.30.10
Set-DhcpServerv4OptionValue -ScopeId 10.40.40.0 -DnsDomain "corp.microsoftlab.ch"

DHCP relay is configured on UniFi Gateway to forward DHCP requests from VLANs 30 and 40 to srv-dc-zrh-01.