Solved

Windows, clear routing table without killing default gateway

Posted on 2012-04-03
4
9,430 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
ID: 37801887
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
ID: 37801905
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 20

Assisted Solution

by:n2fc
n2fc earned 125 total points
ID: 37801921
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
ID: 37801992
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Have you ever had a hard drive that you can't boot into, but need to change the registry? Here is the solution! This article guides you through accessing and editing a registry of a non-primary drive. To read registry information on a non-prim…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
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…

685 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