netsh set ip address errors
-
18-02-2021 - |
Question
I want to set the IP address, subnet and gateway using netsh. I have Windows XP on my computer. When I type the command:
set address "Local Area Connection" static ipAdd sub gateway
I get this error:
Environment variable address "Local Area Connection" static ipAdd sub gateway not defined
When I type:
netsh interface ip set address "Local Area Connection" static ipAdd sub gateway
I get a different error:
the following command was not found.
The DNS and WINS details were successfully set, and I can set the IP settings by typing them by in the Internet Protocol Panel.
Solution
The right syntax for the setting ip address command via netsh is :
netsh interface ip set address name="Local Area Connection" static 192.168.0.20 255.255.255.0 192.168.0.1 1
and setting the dns with the next line :
netsh interface ip set dns "Local Area Connection" static 192.168.0.200 primary
add secondary dns :
netsh interface ip add dns "Local Area Connection" 192.168.0.201 index=2
here's a link!
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow