Windows 10: Change IP et al at CMD prompt

amigan_99
amigan_99 used Ask the Experts™
on
Is there a way to set IP address, mask, gateway and DNS at a CMD prompt? Going through the GUI
is a pain. Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Yes, but you need an elevated command prompt:

netsh interface ip set address "connection name" static 192.168.0.101 255.255.255.0 192.168.0.1
Technical Consultant
Commented:
Command prompt? what is this 1993? :)

PoweShell

New-NetIPAddress –InterfaceAlias “Wired Ethernet Connection” –IPv4Address “192.168.0.1” –PrefixLength 24 -DefaultGateway 192.168.0.254
Set-DnsClientServerAddress -InterfaceAlias “Wired Ethernet Connection” -ServerAddresses 192.168.0.1, 192.168.0.2

Open in new window


Note this changes the DNS as well :)

</P>
amigan_99Network Engineer

Author

Commented:
Thank you! I was in a data closet having to test connectivity from 10 different VLANs using my laptop as the test.
The GUI business was driving me nuts. This is a huge help.
Pete LongTechnical Consultant

Commented:
:)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial