Default gateway on Windows system disappears on reboot

This appears to be an old problem that keeps popping up, but I just experienced it for the first time. I was tasked with deploying 20 Windows VMs (more on this in a later post) for a project. I did so via templates and once the systems came up, I set the appropriate IP addresses as well as other configuration information. The last step was to reboot the VMs. After reboot about half of the VMs were responsive to ICMP and RDP while the other half were not.
To my surprise, upon checking the network configuration on the hosts that were unresponsive from the console, I found the default gateway was not set. It was a long day at work (>12 hours) and I thought I just missed something (more on why I did not automate this task in the later post as well). I set the default gateway, rebooted, and the same problem occurred.
Why was the default gateway configuration being lost on reboot and how can it be fixed?

Turns out to be a Microsoft bug that has been seen in multiple versions of Windows and seems to come back even after being patched from time to time. Here are a variety of ways to resolve the issue:

  • Open a command prompt as administrator and run: netsh int ip reset. Then reboot your computer.
  • Download hotfix to netsh from Microsoft site:;EN-US;973243
  • Run: regedit
    • Go to HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/Tcpip/Parameters/Interfaces/
    • There will be either one or more GUID’s – click on the one with the interface information we are looking for (the others should be loopback or other interfaces on the system if applicable)
    • Edit (by double clicking) “DefaultGateway”
    • Once in there, remove the space between the default gateway value and the top of the box (whitespace)
    • Reboot

In my particular case, I was running Windows 2008 x64 SP2 and the last option was the one that worked for me. I am not sure why I have never experienced this problem before and why it was only seen on some of the VMs deployed from the same template, but I fully plan to add this fix to all my automation scripts in the future just in case.

© 2011, Steve Flanders. All rights reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top