Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 1 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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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