Task 04: Disable DHCP on All Adapters
The automated OS configuration run covers this task in the Network step: DHCP, the address and the default gateway are removed from every port the file lists with ip_assignment: none, so only the management port has a gateway. Use the manual steps below when you can't use the run, or to understand or troubleshoot what it does. See how the run works.
DOCUMENT CATEGORY: Runbook
SCOPE: Network DHCP configuration
PURPOSE: Lock static IP configuration by disabling DHCP on all physical adapters while preserving DHCP on NDIS, Hyper-V virtual, and other excluded adapter types MASTER REFERENCE: Phase 03: OS Configuration
Status: Active
Overview
Disable DHCP on all network adapters on each Azure Local node, except adapters matching the exclusion pattern. This permanently locks in the static IP configured in Task 03 and prevents any adapter from requesting DHCP renewals.
Task 03 must be complete and the management static IP verified on every node before running this task. If DHCP is disabled before static IP is set, the node will lose connectivity.
What the script on the Direct tab does:
- Enumerate all
NetAdapterentries on the node - Skip adapters whose
InterfaceDescriptionmatches the exclusion pattern - Skip adapters with no IPv4 interface (nothing to configure)
- Check idempotency — already-disabled adapters are logged as OK, not re-processed
- Call
Set-NetIPInterface -Dhcp Disabledon each remaining adapter - Verify the change and log a final results table
Why exclude certain adapters?
| Excluded pattern | Adapter type | Why DHCP is preserved |
|---|---|---|
NDIS | Remote NDIS Compatible Device | USB/virtual management channel — may use DHCP for out-of-band access |
Hyper-V Virtual | Hyper-V Virtual Ethernet Adapter | Post-cluster vEthernet adapters require DHCP for vSwitch functionality |
WAN Miniport | VPN / routing tunnels | No meaningful physical IPv4 assignment |
Bluetooth | Bluetooth PAN adapter | Not used for cluster networking |
Wi-Fi Direct | Wi-Fi Direct virtual adapter | Not used for cluster networking |
Microsoft Kernel Debug | Kernel debug network adapter | Reserved for debug use |
Multiplexor | Microsoft Network Adapter Multiplexor | Used by NIC teaming — managed separately |
Dell requires the iDRAC pass-through NIC (Remote NDIS Compatible Device) to stay enabled with its 169.254.x address, and says its DHCP client must not be disabled. The SBE firmware plug-in uses it, and SBE health checks fail without it. That's why NDIS is excluded here. See Dell's SBE release notes.
At this phase, Hyper-V is not yet deployed — no vEthernet adapters exist yet. The
Hyper-V Virtual pattern is included defensively so the script remains safe to re-run
after cluster deployment.
Prerequisites
| Requirement | Description | Source |
|---|---|---|
| Task 03 complete | Static IP configured and verified on all nodes | Task 03: Configure Static IP |
| Node accessible | Reachable via static management IP | Network validation |
| Admin credentials | The nodes' local administrator | infrastructure.yml: identity.local_admin (the password is a secret reference) |
Configuration Reference
The OS configuration reads the ports of each node from nodes[].network_adapters[] of infrastructure.yml. On every port the file lists with ip_assignment: none, its Network step removes DHCP, the address and the default gateway, so only the management port (nodes[].management.ip_address, for example 192.0.2.11) has an address.
The script on the Direct tab reads nothing from infrastructure.yml. Its exclusion pattern is defined in its #region CONFIGURATION.
Execution Options
- Direct Script (On Node)
- Orchestrated Script
Run on each node individually — via RDP, console, or KVM.
Example script: run it on the node by hand. The toolkit no longer ships it (the earlier Disable-DHCPOnAllAdapters.ps1 is removed); the OS configuration does this task in its Network step.
Configuration block (edit before running):
| Variable | Description | Default |
|---|---|---|
$ExcludePattern | Regex pattern — adapters matching this are skipped | NDIS|Hyper-V Virtual|WAN Miniport|Bluetooth|Wi-Fi Direct|Microsoft Kernel Debug|Multiplexor |
#Requires -Version 5.1
<#
.SYNOPSIS
Disable-DHCPOnAllAdapters.ps1
Disables DHCP on all network adapters except virtual/management adapters.
.DESCRIPTION
Run directly on each Azure Local node (locally or via PSRemoting).
Disables DHCP on every physical NIC. Adapters whose InterfaceDescription
matches the $ExcludePattern are skipped — this preserves DHCP on Remote NDIS
and Hyper-V virtual adapters.
Why exclude NDIS / virtual adapters:
- Remote NDIS Compatible Device: USB or virtual management NIC — should keep DHCP
- Hyper-V Virtual Ethernet Adapter: post-cluster vEthernet — must keep DHCP
- WAN Miniport: VPN/routing tunnels — no meaningful IPv4 interface to set
Behaviour:
- Skips adapters matching $ExcludePattern in InterfaceDescription
- Skips adapters with no IPv4 interface (nothing to configure)
- Checks idempotency — already-disabled adapters are reported as OK, not re-set
- Logs a final table of every adapter: Name, Description, Status, DHCP result
.NOTES
Author: Azure Local Cloud Azure Local Cloud
Version: 1.0.0
Phase: 03-os-configuration
Task: task-04-disable-dhcp-on-management-adapter
Execution: Run directly on the node (console, KVM, RDP, or PSRemoting)
Prerequisites: PowerShell 5.1+, local admin rights
Run after: Task 03 — static IP must already be configured on management NIC
.EXAMPLE
.\Disable-DHCPOnAllAdapters.ps1
#>
# ============================================================================
#region CONFIGURATION
# Adapters whose InterfaceDescription matches ANY of these patterns will be SKIPPED.
# Add patterns here to protect additional virtual or management adapters.
# ============================================================================
$ExcludePattern = "NDIS|Hyper-V Virtual|WAN Miniport|Bluetooth|Wi-Fi Direct|Microsoft Kernel Debug|Multiplexor"
#endregion CONFIGURATION
# ============================================================================
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
function Write-Log {
param([string]$Message, [string]$Level = "INFO")
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$color = switch ($Level) {
"ERROR" { "Red" }
"WARN" { "Yellow" }
"SUCCESS" { "Green" }
"HEADER" { "Cyan" }
"SKIP" { "DarkGray" }
default { "White" }
}
Write-Host "[$timestamp] [$Level] $Message" -ForegroundColor $color
}
# ============================================================================
# MAIN
# ============================================================================
try {
Write-Log "=== Disable-DHCPOnAllAdapters.ps1 ===" "HEADER"
Write-Log "Node: $($env:COMPUTERNAME)"
Write-Log "Exclude pattern: $ExcludePattern"
$adapters = Get-NetAdapter | Sort-Object Name
if ($adapters.Count -eq 0) {
Write-Log "No network adapters found." "WARN"
exit 0
}
Write-Log "Adapters found: $($adapters.Count)"
$results = [System.Collections.Generic.List[PSCustomObject]]::new()
foreach ($adapter in $adapters) {
$desc = $adapter.InterfaceDescription
$name = $adapter.Name
$status = $adapter.Status
# Check exclude pattern
if ($desc -match $ExcludePattern) {
Write-Log " SKIP $name ($desc)" "SKIP"
$results.Add([PSCustomObject]@{
Name = $name
Description = $desc
Status = $status
DHCP = "Skipped (excluded)"
Result = "Skipped"
})
continue
}
# Get IPv4 interface — some adapters have no IPv4 interface
$ipIface = Get-NetIPInterface -InterfaceIndex $adapter.ifIndex -AddressFamily IPv4 -ErrorAction SilentlyContinue
if (-not $ipIface) {
Write-Log " SKIP $name (no IPv4 interface)" "SKIP"
$results.Add([PSCustomObject]@{
Name = $name
Description = $desc
Status = $status
DHCP = "N/A (no IPv4)"
Result = "Skipped"
})
continue
}
# Idempotency check
if ($ipIface.Dhcp -eq "Disabled") {
Write-Log " OK $name (already Disabled)" "SUCCESS"
$results.Add([PSCustomObject]@{
Name = $name
Description = $desc
Status = $status
DHCP = "Disabled"
Result = "AlreadyDisabled"
})
continue
}
# Disable DHCP
try {
Write-Log " SET $name ($status) $($ipIface.Dhcp) -> Disabled"
Set-NetIPInterface -InterfaceIndex $adapter.ifIndex -AddressFamily IPv4 -Dhcp Disabled -ErrorAction Stop
# Verify
$afterIface = Get-NetIPInterface -InterfaceIndex $adapter.ifIndex -AddressFamily IPv4 -ErrorAction SilentlyContinue
if ($afterIface.Dhcp -eq "Disabled") {
Write-Log " OK $name DHCP disabled" "SUCCESS"
$results.Add([PSCustomObject]@{
Name = $name
Description = $desc
Status = $status
DHCP = "Disabled"
Result = "Changed"
})
} else {
Write-Log " FAIL $name DHCP is still $($afterIface.Dhcp)" "WARN"
$results.Add([PSCustomObject]@{
Name = $name
Description = $desc
Status = $status
DHCP = $afterIface.Dhcp
Result = "Failed"
})
}
} catch {
Write-Log " ERROR $name $_" "ERROR"
$results.Add([PSCustomObject]@{
Name = $name
Description = $desc
Status = $status
DHCP = "Error"
Result = "Error: $_"
})
}
}
# Final summary table
Write-Log "=== RESULTS ===" "HEADER"
$results | Format-Table -AutoSize | Out-String | Write-Host
$failed = @($results | Where-Object { $_.Result -notin @("Changed","AlreadyDisabled","Skipped") })
if ($failed.Count -gt 0) {
Write-Log "$($failed.Count) adapter(s) failed. Review errors above." "WARN"
exit 1
}
$changed = @($results | Where-Object { $_.Result -eq "Changed" }).Count
$already = @($results | Where-Object { $_.Result -eq "AlreadyDisabled" }).Count
$skipped = @($results | Where-Object { $_.Result -eq "Skipped" }).Count
Write-Log "Changed: $changed Already disabled: $already Skipped: $skipped" "SUCCESS"
Write-Log "DHCP DISABLE COMPLETE" "SUCCESS"
exit 0
} catch {
Write-Log "CRITICAL ERROR: $_" "ERROR"
exit 1
}
Expected output (excerpt):
[2026-03-05 09:10:01] [HEADER] === Disable-DHCPOnAllAdapters.ps1 ===
[2026-03-05 09:10:01] [INFO] Node: AZL-NODE-01
[2026-03-05 09:10:01] [INFO] Exclude pattern: NDIS|Hyper-V Virtual|WAN Miniport|Bluetooth|Wi-Fi Direct|Microsoft Kernel Debug|Multiplexor
[2026-03-05 09:10:01] [INFO] Adapters found: 5
[2026-03-05 09:10:01] [SKIP] SKIP Ethernet (Remote NDIS Compatible Device)
[2026-03-05 09:10:01] [INFO] SET Embedded NIC 1 (Up) Enabled -> Disabled
[2026-03-05 09:10:02] [SUCCESS] OK Embedded NIC 1 DHCP disabled
[2026-03-05 09:10:02] [INFO] SET Embedded NIC 2 (Disconnected) Enabled -> Disabled
[2026-03-05 09:10:02] [SUCCESS] OK Embedded NIC 2 DHCP disabled
[2026-03-05 09:10:02] [INFO] SET Embedded NIC 3 (Up) Enabled -> Disabled
[2026-03-05 09:10:03] [SUCCESS] OK Embedded NIC 3 DHCP disabled
[2026-03-05 09:10:03] [INFO] SET Embedded NIC 4 (Up) Enabled -> Disabled
[2026-03-05 09:10:03] [SUCCESS] OK Embedded NIC 4 DHCP disabled
[2026-03-05 09:10:03] [HEADER] === RESULTS ===
Name Description Status DHCP Result
---- ----------- ------ ---- ------
Embedded NIC 1 Intel(R) Ethernet Connection 25G 4P E823-C LOM Up Disabled Changed
Embedded NIC 2 Intel(R) Ethernet Connection 25G 4P E823-C LOM Disconnected Disabled Changed
Embedded NIC 3 Intel(R) Ethernet Connection 25G 4P E823-C LOM Up Disabled Changed
Embedded NIC 4 Intel(R) Ethernet Connection 25G 4P E823-C LOM Up Disabled Changed
Ethernet Remote NDIS Compatible Device Up Skipped (excluded) Skipped
[2026-03-05 09:10:03] [SUCCESS] Changed: 4 Already disabled: 0 Skipped: 1
[2026-03-05 09:10:03] [SUCCESS] DHCP DISABLE COMPLETE
PowerShell
No script in this task folder. The folder
scripts/deploy/04-cluster-deployment/phase-03-os-configuration/task-04-disable-dhcp-on-management-adapterholds only a placeholder. A placeholder printsNOT IMPLEMENTED, changes nothing and exits with code 3. The earlierDisable-DHCPOnAllAdapters.ps1is removed. The OS configuration does this task in its Network step.
Script
| Script | What it does |
|---|---|
scripts/deploy/04-cluster-deployment/phase-03-os-configuration/Invoke-AzureLocalOsConfiguration.ps1 | The one entry point of the OS configuration. It runs Set-AzureLocalNodeConfiguration.ps1 for each node: it reads the node, changes only what differs from infrastructure.yml, and reports. -Step limits the run to one step. |
The nodes' local administrator comes from identity.local_admin of infrastructure.yml (the password is a secret reference), or from -Credential. The script never prompts. Run settings go in a JSON file given with -SettingsFile.
Run
# Plan (the default): read every node and list what would change
./Invoke-AzureLocalOsConfiguration.ps1 -InfrastructureFile ./infrastructure.yml -Step Network
# Apply
./Invoke-AzureLocalOsConfiguration.ps1 -InfrastructureFile ./infrastructure.yml -Step Network -Mode Apply
See how the run works.
Validation
Verify DHCP is disabled on all physical adapters across all nodes:
# Run on each node (or orchestrate with PSRemoting)
Get-NetAdapter | ForEach-Object {
$iface = Get-NetIPInterface -InterfaceIndex $_.ifIndex -AddressFamily IPv4 -ErrorAction SilentlyContinue
[PSCustomObject]@{
Name = $_.Name
Description = $_.InterfaceDescription
Status = $_.Status
DHCP = $iface.Dhcp
IsExcluded = $_.InterfaceDescription -match "NDIS|Hyper-V Virtual|WAN Miniport"
}
} | Format-Table -AutoSize
Validation checklist:
| Check | Expected | Status |
|---|---|---|
| Physical adapters — DHCP | Disabled | ☐ |
| NDIS / excluded adapters — DHCP | Enabled (or N/A) | ☐ |
| Management NIC reachable | All nodes respond to ping | ☐ |
| No connectivity loss | Continuous management access | ☐ |
Disconnected adapters may show blank or Enabled DHCP status. This is acceptable — they are not
active on the network and cannot obtain an address even with DHCP nominally enabled.
Values from infrastructure.yml
The values for this task come from infrastructure.yml (schema 5). Every key, with its type, default and example, is in the variables reference.
Troubleshooting
| Issue | Root Cause | Remediation |
|---|---|---|
| DHCP re-enabled after reboot | Group Policy override | Check GPO DHCP settings; apply exception or override in policy |
Adapter still showing Enabled after script | Script exited with non-zero | Review output log; rerun script and check for errors |
| Connectivity lost after running | Script disabled DHCP on management NIC before static IP was set | Re-run Task 03 first; boot node via console or iDRAC |
Set-NetIPInterface access denied | Script not run as local admin | Relaunch PowerShell as Administrator |
| OS configuration: exit code 2 | The file was not given or cannot be read | Pass -InfrastructureFile (mandatory) with the path of infrastructure.yml |
| OS configuration: the node is Blocked in the plan | The management address or a port is missing in the file | Check nodes[].management.ip_address and nodes[].network_adapters[] in infrastructure.yml |
| Node cannot be reached via PSRemoting | WinRM not configured | Run Enable-PSRemoting -Force on the node (Task 02 enables RDP — verify WinRM separately) |
Alternatives
The procedures in this task use the methods shown in the tabs above. The toolkit is PowerShell 7 only and has no Bash scripts. A few tasks that act on Azure also have an Azure CLI script written in PowerShell. The script status page of the toolkit lists which task has which script.
Navigation
| ← Task 03: Configure Static IP | ↑ Phase 03: OS Configuration | Task 05: Configure DNS Servers → |
Version Control
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0 | 2026-01-31 | Azure Local Cloud | Initial document |
| 2.0 | 2026-03-05 | Azure Local Cloud | Full rewrite to standards — complete frontmatter, 2-tab structure (Direct + Orchestrated), Standalone tab removed, full embedded scripts, NDIS defensive pattern, infrastructure.yml integration in orchestrated script |