Problem with netsh command to configure IP


Haorutia

Active member
Local time
1:38 AM
Posts
13
OS
Windows 11
After setting a static IP address with the netsh command, when I try to change it back to DHCP, also with netsh, I get a message that it is already set to DHCP.

When I check the NIC configuration in the GUI, it is set to static, but when I check with netsh int ip show conf, it says DHCP is enabled.

Is this a known issue?
I am hesitant to use netsh to configure static because I can't revert to DHCP with the command.
 
Windows Build/Version
24H2 & 23H2

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
Works correctly for me.
 

My Computer My Computer

At a glance

Linux Mint
OS
Linux Mint
Computer type
Laptop
Manufacturer/Model
System76 Lemur Pro
Works correctly for me.
Oh my...
I have confirmed the same problem with two different environments I have on hand.
The only thing they have in common is that they are cloning from an image using sysprep.
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
What command are you calling to return an interface to DHCP?
 

My Computer My Computer

At a glance

Linux Mint
OS
Linux Mint
Computer type
Laptop
Manufacturer/Model
System76 Lemur Pro
What command are you calling to return an interface to DHCP?
Commands for static configuration
netsh interface ip set address name=ethernet source=static ....

Command to revert to DHCP
netsh interface ip set address name=ethernet source=dhcp

If the nic setting is changed by gui even a little after static setting by command, it can be set to dhcp by command, but if only command is used, the value of dns will disappear, but the setting of ip will remain.
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11

Latest Support Threads

Back
Top Bottom