Jump to content
Sign in to follow this  
speedi

need a method to change IP gateway only by script

Recommended Posts

speedi

I need to change the IP gateway on a number of systems and thought it would be faster if I developed a script. Research I have done indicates use of NETSH, but I have not found command line to change the GATEWAY only... All systems have a static IP address... Thanks for any help provided....!

Share this post


Link to post
Share on other sites
weaponx

You can use netsh:

netsh interface ip add address "local area connection" gateway=100.1.1.5 gwmetric=2

Share this post


Link to post
Share on other sites
speedi

You can use netsh:

netsh interface ip add address "local area connection" gateway=100.1.1.5 gwmetric=2

RunWait("netsh interface ip add address ""local area connection"" gateway=100.1.1.5 gwmetric=2")

that worked great! Thanks!

Share this post


Link to post
Share on other sites
speedi

You can use netsh:

netsh interface ip add address "local area connection" gateway=100.1.1.5 gwmetric=2

Question: What does the gwmetric=2 accomplish???? Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×