dsccommunity / dsccommunity/NetworkingDsc
xDefaultGateWayAddress: GateWay address not set in certain DHCP scenarios
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 235
- Forks
- 93
- PR merge metrics
- No merged PRs in 30d
Description
Details of the scenario:
The default gateway address may not be set if DHCP is currently assigning the same address you are trying to set statically. For example, if DHCP is handing you "10.10.10.1" for your default gateway address and you configure xDefaultGateWayAddress to configure "10.10.10.1" as the statically defined gateway, DSC detects that the gateway is already set to the desired state and makes no changes. This results in a successfully applied configuration, but a network interface that will not respond.
VERBOSE: [server]: [[xDefaultGatewayAddress]SetGatewayData] Test-TargetResource: Checking the Default Gateway Address.
VERBOSE: [server]: [[xDefaultGatewayAddress]SetGatewayData] Test-TargetResource: Default gateway is correct.
VERBOSE: [server]: LCM: [ End Test ] [[xDefaultGatewayAddress]SetGatewayData] in 2.4660 seconds.
The DSC configuration that is using the resource:
`
xNetAdapterName DeviceNameData
{
NewName = 'Data'
Interfacedescription = 'vmxnet3 Ethernet Adapter'
}
xDefaultGateWayAddress SetGatewayData
{
Address = $node.gatewaydata
InterfaceAlias = 'Data'
AddressFamily = 'IPv4'
DependsOn = '[xIPAddress]NewIPv4AddressData'
}
xDnsServerAddress DnsServerAddressData
{
Address = $node.DNSServers
InterfaceAlias = 'Data'
AddressFamily = 'IPv4'
Validate = $true
DependsOn = '[xNetAdapterName]DeviceNameData'
}
xDhcpClient DisabledDhcpClientData
{
State = 'Disabled'
InterfaceAlias = 'Data'
AddressFamily = 'IPv4'
DependsOn = '[xNetAdapterName]DeviceNameData'
}
xIPAddress NewIPv4AddressData
{
IPAddress = $node.IPAddressData
InterfaceAlias = 'Data'
AddressFamily = 'IPV4'
DependsOn = '[xDhcpClient]DisabledDhcpClientData'
}
`
Version of the Operating System and PowerShell the DSC Target Node is running:
Windows Server 2016, Windows PowerShell 5.1.14393.1532
Version of the DSC module you're using, or 'dev' if you're using current dev branch:
xNetworking 5.7.0.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the xDefaultGateWayAddress resource's Test-TargetResource and SetGatewayData paths, using the reported Windows Server 2016 and PowerShell 5.1 scenario as the reproduction case. Verify behavior when DHCP already assigns the configured gateway address, then confirm the resource applies the intended static gateway and the interface responds afterward.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100