Skip to content

Configure DHCP

Purpose

Configure DHCP for the Workstations VLAN.

Install DHCP role

Install-WindowsFeature DHCP -IncludeManagementTools

Authorize DHCP in AD

Add-DhcpServerInDC -DnsName "HQ-DC01.corp.gntech.lab" -IPAddress 172.20.20.10

Create Workstations scope

Add-DhcpServerv4Scope `
  -Name "HQ-Workstations" `
  -StartRange 172.20.30.100 `
  -EndRange 172.20.30.199 `
  -SubnetMask 255.255.255.0 `
  -Description "HQ Workstations VLAN"

Set-DhcpServerv4OptionValue `
  -ScopeId 172.20.30.0 `
  -Router 172.20.30.1 `
  -DnsServer 172.20.20.10 `
  -DnsDomain "corp.gntech.lab"

Important routing note

If DHCP is running on HQ-DC01 in VLAN 20 and clients are in VLAN 30, configure DHCP relay on OPNsense for the Workstations VLAN.

Relay target:

172.20.20.10

Validation

On the Windows 11 client:

ipconfig /all

Expected:

  • IP from 172.20.30.100-199
  • Gateway 172.20.30.1
  • DNS 172.20.20.10
  • Suffix corp.gntech.lab