What is Command line command to set gateway?

  • Thread starter Thread starter Ken
  • Start date Start date
K

Ken

I need to manually set the gateway address using the
command line. I want to be able to write a script to
enable/disable a computers internet access. I don't know
the command to do this.
 
I need to manually set the gateway address using the
command line. I want to be able to write a script to
enable/disable a computers internet access. I don't know
the command to do this.

Keri,

Try "netsh int ip set /?" for instructions how to use netsh.

Cheers,
Chuck
Paranoia comes from experience - and is not necessarily a bad thing.
 
"Ken" said:
I need to manually set the gateway address using the
command line. I want to be able to write a script to
enable/disable a computers internet access. I don't know
the command to do this.

To add a default gateway address:

route add 0.0.0.0 mask 0.0.0.0 w.x.y.z

To remove all default gateway addresses:

route delete 0.0.0.0

If that isn't what you want to know, please reply with details.
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top