Solved

Windows, clear routing table without killing default gateway

Posted on 2012-04-03
4
8,167 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

My purpose is to describe the basic concepts of virtual memory as implemented in a modern Windows-based operating system. I will also describe the problems inherent in older systems and how virtual memory solves them. The dark ages - before virtu…
The password reset disk is often mentioned as the best solution to deal with the lost Windows password problem. In Windows 2008, 7, Vista and XP, a password reset disk can be easily created. But besides Windows 7/Vista/XP, Windows Server 2008 and ot…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

777 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