Quickly Change Network Interface IP’s

October 8, 2016

I change my network card IP’s all the time to connect directly to hardware for initial configuration. I’ve been manually doing this for 15 years now. I finally sat down and learned netsh, put it into stupidly simple batch files and now have a folder on my desktop with all the common IP ranges.

Here’s an exerpt of the script to change the interface from it’s current state to 192.168.10.22.

@echo off
netsh interface ip set address "Ethernet" static 192.168.10.22 255.255.255.0 192.168.10.1 1
goto end
:end
end of script

To set the interface back to DHCP use this one.

@echo off
netsh interface ip set address "Ethernet" dhcp
netsh interface ip set dns "Ethernet" dhcp
goto end
:end
end of script

Note “Ethernet” in this case is the name of my network card. Your’s might be Local Area Connection or something similar. Modify accordingly.

Copy that into notepad, save as a .bat and run as administrator.  Away you go.

Leave a Reply

Your email address will not be published. Required fields are marked *


*