Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I am a C#.Net developer. I have googled enough before posting this here. I hope, i will find some help here.

We have a ASP.NET Web Application that accesses database which is in different network from where our web app is hosted. And in order to access this database we need connect via VPN to the server. But if the someone reason VPN disconnects, then our web app will not be able to access the database. So my question is:

1. Is there any mechanism/built-in classes in c#.Net that can be used to connect VPN?
2. Is there any mechanism/built-in classes in c#.Net that can be used watch VPN connection and notify if the VPN disconnects?
3. Is there any way to access database without even using VPN?

NOTE: We have to use VPN because the database resides in our Clients Private Network, which we access via VPN (Nortel) using our Username, Password and RSA secure ID Token.

Any help would be greatly appreciated.

Thanks.
Posted
Updated 28-May-14 3:56am
v2

Question 1

It depends on the VPN provider. I'd suggest getting in touch with the VPN provider to see if they have a API you can use in .Net.

Question 2

Simplest way to test, without an API for the VPN would be to try and connect to the database. If you can't, then assume the VPN is down. I appreciate there could be other factors such as the database has stopped e.t.c. but it will still highlight a problem.

Question 3

No, you must have network access. Databases receive and response to requests on network sockets. Therefore you must have a network route to the database. This doesn't have to be via a VPN. But alas you said you have to use the VPN so you're out of luck.

There are lots of VPN solutions. We use hardware based IP/SEC. They're very stable and report SNMP messages so you can use monitoring software to manage their state.
 
Share this answer
 
Comments
Member 9763329 29-May-14 7:52am    
Thanks for the reply. You pointed me towards the solution, though i am too far from it.
I'm going to assume that you can't physically move the web server into a DMZ on your clients network and set a firewall rule to allow database traffic from the web server to the database server in the private network. That would be ideal IMO.

1. It depends on the VPN software your client has. I know that Cisco Anyconnect has an API, although I've never used it. I'm not familiar with Nortel.
2. Again, AFAIK that depends on the VPN.
3. It seems to me that you could create a client application/service that resides inside the clients network which could listen on a given port which could be opened in the firewall to receive traffic from the ip address of your web server. You could communicate from your web server to this client which could in turn poll the database for you. But honestly, if I were going to open up this kind of potential risk I would just open up ports to the database from my web server.

Best of luck!
 
Share this answer
 
Comments
Member 9763329 29-May-14 7:51am    
Thanks for the reply. Anyway, can not host web app in clients network, as we have some other challenges.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900