Blank default gateway may occur after configuring Static IP address


Error: Blank default gateway may occur after configuring Static IP address or if you configure IP address in your NIC by next restart of VM or the guest OS the gateway will disappear.

Cause:  When removing a network driver using a vendor-provided uninstallation program or through Device Manager, previously entered static IP address information may not be removed correctly from the registry. After reinstalling the network driver and reentering the same static IP address, the presence of previous registry information prevents the newly entered address information from being saved correctly.

For VM if you upgrade VMtools or any hardware version this error will occur to some of the VM.

Solution:

Open a command prompt under the administrator context and run the following command TWICE, using the desired static address information. For example:

netsh interface ipv4 set address “Local Area Connection” static 10.0.0.55 255.0.0.0 10.0.0.1

Note: This first command may return an error “Object already exists”
netsh interface ipv4 set address “Local Area Connection” static 10.0.0.55 255.0.0.0 10.0.0.1

 

Note: This command should succeed with no errors