Solved

Windows, clear routing table without killing default gateway

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In a hurry?.. scroll down to "HERE's HOW TO DO IT" Section. Greetings All, I was going to post this as question/solution, but its seems more appropriate as an article considering its length.  I felt it important to illucidate all the details c…
Many times while working on a computer regardless of any Operating System, lag and crashes seem to creep in, hindering your working speed. Sometimes, it can also cause your work to be lost unexpectedly and as a result, you are unable to meet your de…
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…
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…

856 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