How to use netsh scripting to change IP address

Posted: October 6, 2013 in Other networking

I am sure everyone used netsh by now but instead of typing netsh /? to get help i created a small batch file to change ip address for some of my testing. For my company I am demoing few firewall/url filtering solutions so instead manually changing the ip address i created simple batch file to do it for me.

Isn’t that whole purpose of using netch? So, here we go:

netsh interface ip set address name=”Local Area Connection” source=static addr=10.3.206.210 mask=255.255.255.0 gateway=10.3.206.33 gwmetric=1
netsh interface ip set dns name=”Local Area Connection” source=static addr=4.2.2.2
netsh interface ip add dns name=”Local Area Connection” addr=8.8.8.8 index=2

Name it like PA.bat and run it. Works like a charm.

###############################################################

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s