Solved

Windows, clear routing table without killing default gateway

Posted on 2012-04-03
4
6,343 Views
Last Modified: 2012-04-06
I am remote desktopping to a Windows Server

I needed to flush the routing table to connect to a linux server, so I issued a route -f

I lost the gateway, and the remote machine had to be rebooted, which is a problem

The route table flush did do its job after the reboot, and I was able to get to the Linux server from the Windows machine

My question is:  Is there any way to flush the routing table without clearing out the default gateway value

(I can not set the default gateway after the flush, because I lose connectivity immediately after the route -f)

Thanks
0
Comment
Question by:Los Angeles1
  • 3
4 Comments
 
LVL 17

Assisted Solution

by:Anuroopsundd
Anuroopsundd earned 375 total points
Comment Utility
when you give the route -f it clears all the routing information even the default gateway routing. so only solution after that is to disable/Enable network card or reboot the server.

If you know which route is the issue you can specifically remove that route instead of removing all the routing information.

1. route print  --- this will print all the route information and you can check what route you want to remove.

2. then use route delete or route update command to delete or update the existing route
 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.
route DELETE 157.0.0.0


Hope this helps.
0
 
LVL 17

Assisted Solution

by:Anuroopsundd
Anuroopsundd earned 375 total points
Comment Utility
also you can use the netroute view utility which is graphical and works same as route.

http://www.nirsoft.net/utils/network_route_view.html
0
 
LVL 19

Assisted Solution

by:n2fc
n2fc earned 125 total points
Comment Utility
Another possibility is to write a .bat or .cmd script that does the flush and adds the gateway back in instead of only running the flush and thereby breaking your connection!
0
 
LVL 17

Accepted Solution

by:
Anuroopsundd earned 375 total points
Comment Utility
one more option....
In you incase loose network like what you did.. you can RDP some other machine/server on the same network/subnet and then you will be able to connect to the server.
as you loose the default gateway it does not matter for local network (same subnet).
so you can RDP from that server and do what ever you require to do in case of emergency.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

This article covers how to install the Microsoft Windows Operating System (OS). What is covered in this article:  > Different Versions and Editions of the Windows OS  > Upgrading versus Fresh Installation of the OS           - Steps to take pr…
Log files are useful in diagnosing and repairing problems.  This is a list of common log files and their standard locations that I've compiled.   While this is not exhaustive, it is a pretty good list that I've found to be useful.  I may update it f…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now