I would like to change the default gateway for the wired ethernet port on my laptop- the DHCP server is giving the wrong one. I would like it to revert to the existing config on a reboot.

I would prefer a command line way of doing it - so I can easily repeat the command as needed. Do I need ipconfig or route - both of which confuse me.

link|improve this question

65% accept rate
feedback

2 Answers

up vote 0 down vote accepted

running route -? shows this example:

route CHANGE 157.0.0.0 MASK 255.0.0.0 157.55.80.5 METRIC 2 IF 2
CHANGE is used to modify gateway and/or metric only.

The route is not persisted, so it should revert after reboot. You can check these links for help using route.

link|improve this answer
feedback

I don't think you can change the gateway without also setting the IP to static. The most likely command line tool to be able to do this if it is possible would be "netsh". You'll need to be a local admin or a member of local "network administrators" group for this to work.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.