• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 373
  • Last Modified:

Programmatically manage VPN / Tunnel

Is there a programmatic way in C# to detect the creation of a VPN tunnel?  Or the dropping of one?

Essentially, we have several VPN tunnels in place on our web server.  Sometimes they disconnect or go down and we have no idea why.  "Keep Alive" does not seem to be working reliably.

So I was thinking of some sort of "heartbeat" application to periodically check the VPN to see if it is up and running, and if not, programmatically restart it.
Tom Knowlton
Tom Knowlton
1 Solution
I not aware of a method to detect these kinds of connection, though it could probably be done via packet tracing.

A simpler way to do it, would be to create a "heartbeat" software as you suggested which would test the connection (either via writing a file or an echo from the same software on the other computer or whatever) and if the connection is down, the use nircmd software to close/start back the VPN connection.

Here is the link for the nircmd software :

This software is a really great helper against windows X manipulation.
Tom KnowltonWeb developerAuthor Commented:
Sounds good to me!


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now