Question

I need to get the routing table for disconnected interfaces on Windows.

To give you a little background why:

Im using OpenVPN. OpenVPN will setup several routes after the TAP adapter is online. If the OpenVPN crashes or the User just kills OpenVPN, these routes won't be deleted by OpenVPN. And because the TAP adapter will be disconnected after this, route print wont show any route for the adapter. But the next time the TAP adapter comes up the old routes are active again. For several reasons like multiple tap adapters, IP ranges and so on its hard to build heuristics to detect old routes, so it would be great i there was some way to see and delete routes for a disconnected Interface.

Was it helpful?

Solution

You may try this command:

netsh interface ipv4 show route

There might be some information that you needed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top