Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

IP address cannot be set using SConfig #112

@Rokory

Description

@Rokory

Due to a bug in Windows Server 2022, sometimes the IP address cannot be set using SConfig. Use the following commands at the command prompt as a workaround:

  1. Find the ifIndex (InterfaceIndex) of the net adapter.

    Get-NetAdapter

    or

    Get-NetIPConfiguration
  2. Remove all IP address.

    Get-NetIPAddress | Remove-NetIPAddress

    You might get some error message, which you can safely ignore. Some IP addresses, e.g., APIPA addresses cannot be removed.

  3. Set the IP address and default gateway.

    $ipAddress = '10.1.200.168' # Replace with the desired IP address
    $defaultGateway = '10.1.200.1' # Replace with the desired default gateway
    $prefixLength = 24 # Replace as appropriate
    $interfaceIndex = 4 # Replace with the ifIndex from step 1
    New-NetIPAddress `
        -InterfaceIndex $interfaceIndex `
        -IPAddress $ipAddress `
        -DefaultGateway $defaultGateway `
        -AddressFamiliy IPv4 `
        -PrefixLength $prefixLength
  4. Set the DNS server.

    Set-DnsClientServerAddress -InterfaceIndex $interfaceIndex -ServerAddresses 10.1.1.8 # Replace as appropriate

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions