use netsh to reset the default gateway?
Posted on 2011-03-25
I am using the following command in an automated rerouting script.
netsh interface ip set address name="Local Area Connection" gateway=172.20.2.252 gwmetric=0
To restore the route, I want to return the interface to full DHCP, and I use:
netsh interface ip set address name="Local Area Connection" source= dhcp
The interface changes back to dhcp, but the default gateway does not change back to the dhcp value. If you open the network connections TCP/IP properties, the interface is set to DHCP, but there is a "ghost" value in the default gateway box. I want to clear all values and let DHCP restore them.