[How-To] Fix Windows Server Internet Access When the Default Route Points to Itself

Back to Blog

[How-To] Fix Windows Server Internet Access When the Default Route Points to Itself

Fix Windows Server Internet Access When the Default Route Points to Itself

A Windows Server can lose internet access even though the network settings look correct. The IP address is set, the subnet mask is correct, DNS servers are configured, and the default gateway appears to point to the router. Local devices in the same network still respond to ping, but the server cannot reach the internet.

In this situation, the problem is often not DNS. It is routing.

 

Solution

Windows needs a default route for all traffic outside the local subnet. To check this, open Command Prompt or PowerShell and run:

route print

In the output, look for the IPv4 Route Table and then for the Active Routes section. The default route is the line where both Network Destination and Netmask are 0.0.0.0.

A correct default route usually looks like this:

0.0.0.0 0.0.0.0 10.177.192.1

Here, 10.177.192.1 is the router or firewall. That is where internet traffic needs to go.

The problem appears when the routing table contains a route like this:

0.0.0.0 0.0.0.0 On-link 10.177.192.5

or when the server uses its own IP address as the gateway:

0.0.0.0 0.0.0.0 10.177.192.5

In this example, 10.177.192.5 is the server itself. That means Windows tries to send internet traffic to itself instead of sending it to the router. Local network communication still works, because local devices are directly reachable. Internet access fails because the traffic never reaches the real gateway.

Then test the connection step by step:

ping 10.177.192.1
ping 8.8.8.8
nslookup google.com

If the gateway responds but 8.8.8.8 does not, the issue is most likely routing. If 8.8.8.8 works but google.com does not, the issue is most likely DNS.

To remove the broken default route, use this template:

route delete 0.0.0.0 mask 0.0.0.0

For example:

route delete 0.0.0.0 mask 0.0.0.0 10.177.192.5

This removes the wrong route where the server points internet traffic to itself.

After that, reset the adapter configuration cleanly. The following command is only a template. Replace the adapter name, IP address, subnet mask, gateway, and metric with the values from your own network:

netsh interface ipv4 set address name="" static

For example:

netsh interface ipv4 set address name="Ethernet0" static 10.177.192.5 255.255.255.0 10.177.192.1 1

In this example, Ethernet0 is the network adapter, 10.177.192.5 is the server IP, 255.255.255.0 is the subnet mask, 10.177.192.1 is the real gateway, and 1 is the route metric.

After running the command, check the routing table again:

route print

The default route should now point to the real gateway:

0.0.0.0 0.0.0.0 10.177.192.1

The reason this works better than changing the same values in the Windows network settings is that the graphical interface can show correct values while the routing table still contains an old or broken route. Software, virtual adapters, VPN clients, network drivers, or management tools can influence the routing table. The command line resets the adapter configuration more directly and forces Windows to recreate the route properly.

The key lesson is simple: when a Windows Server can reach the local network but not the internet, do not only check IP, DNS, and gateway fields. Always check route print. If the default route points to the server itself, Windows sends the traffic in the wrong direction.

 

Next Steps

If you’ve read this far then chances are you are still having issues. Feel free to reach out to us. We’re happy to help out!

Share this post

Leave a Reply

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

Back to Blog