Jump to content

[HELP] staticIP through .bat


Recommended Posts

Posted

Guys,

I have created two bat files, one is for quick change to DHCP configuration and the other one is for static IP..

DHCP:

netsh interface ip set address "Local Area Connection" dhcp

Static IP:

netsh interface ip set address "Local Area Connection" static 192.168.1.115 255.255.255.0 10.156.1.100 1

StaticIP.bat changes IP address, subnet mask and default gateway..Can I somehow put DNS servers in it also?


Posted
netsh interface ip set address "Local Area Connection" static 192.168.1.115 255.255.255.0 10.156.1.100 1

StaticIP.bat changes IP address, subnet mask and default gateway..Can I somehow put DNS servers in it also?

To set the primary DNS to a static value:

netsh interface ip set dns "Local Area Connection" static 192.168.1.53

To revert it to use DHCP:

netsh interface ip set dns "Local Area Connection" dhcp

Enter "netsh interface ip set dns" to see the usage options.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...