Link to home
Start Free TrialLog in
Avatar of jana
janaFlag for United States of America

asked on

Problem connecting to MS SQL server via VPN

We have a VPN that we connect to via Remote Desktop (address format xxx.xxx.xxx.xxx:xxxx).  When connected to the remote server we uses ms sql 2008 r2.  We wanted to know if we can use our local ms sql 2014 to connect to another sql instance via that same vpn.  What we have doen the following in our ms sql 2014:

Just the address,           xxx.xxx.xxx.xxx
Address\InstanceName,       xxx.xxx.xxx.xxx:xxxx\InstanceName
Address\(local),            xxx.xxx.xxx.xxx:xxxx\(local)
Address-port,               xxx.xxx.xxx.xxx:xxxx   - (THIS IS HOW WE CONNECT TO VPN)
Address-port\InstanceName,  xxx.xxx.xxx.xxx:xxxx\InstanceName
Address-port\(local),       xxx.xxx.xxx.xxx:xxxx\(local)

Open in new window

Avatar of arnold
arnold
Flag of United States of America image

You have to know what restrictions exist on the Vpn meaning the access might be limited to the remote server (RDP) and no other access permitted via the VPN.

See if you can after establishing the VPN, use ssms to see if you can connect to the ip\instance of the remote SQL.
Telnet remoteip port1433 or it can be anything else configured.....
Avatar of jana

ASKER

Yes, we'll check on those restriction tomorrow.

As to "connect to the ip\instance of the remote SQL", that's line 5 (already tried it)

Telnet remoteip port1433 failed, but the port is the correct one.  Ran a script at the remote, and returned 1433

2016-08-24 16:59:24.690	Server	Server is listening on [ 'any' <ipv6> 1433].
2016-08-24 16:59:24.690	Server	Server is listening on [ 'any' <ipv4> 1433].
2016-08-24 16:59:24.700	Server	Server is listening on [ ::1 <ipv6> 1434].
2016-08-24 16:59:24.700	Server	Server is listening on [ 127.0.0.1 <ipv4> 1434].

Open in new window

When the VPN is established run
netstat -rn to see the routing table.
See whether the ip of the SQL is part of the included ip ranges known on your system.
Let's say your local lan is 192.168.0.0/24
The SQL server is 172.16.0 2
VPN ip 10.0.0.3

Your routing table
0.0.0.0 0.0.0.0 192.168.0.2
10.0.0.3 255.255.255.255 ...
10.0.0.0 255.0.0.0  10.0.0.3
172.16.0.0 255.255.255.0 10.0.0.3

Etc,,.
You could try if the SQL segment is not in the routing table..
route 172.16.0,0 mask 255.255.255.0 10.0,0.3
This will add the routing entry, but would require that the remote site has a path from the SQL segment to the VPN segment for this to work.
Avatar of jana

ASKER

Thanx, just tried it; it's not in the routing table.

We'll check tomorrow.
Even if you get the VPN to route to MSSQL, only the VPN client machine (nothing else on the same LAN) is able to use that - assuming you connect with a VPN client.
Avatar of jana

ASKER

Assuming when you say VPN client machine you are referring to us (our pc connecting to that VPN address)?

Reading again your entry in 41774266, we didn't check if the SQL was part of it (instead we were looking for the VPN address, which wasn't there).

We will check again when we get to the PC.

Question, what exactly should we ask the admin of the PC we are trying to connect it's SQL instance? (So he/she can tell us with clarity the what-to-do)
The VPN Client machine is the one initiating the connection (and using RDP). If this is the same machine which has the MSSQL 2014 instance, fine. If not, you can't use the client's connection from a different machine, the MSSQL machine has to run its own VPN client connection. However, having more than one VPN connection from the same public IP (yours) causes failures or unstable connections.

To stop confusing us please use different symbolic addresses for public and private addresses, and for each side (making it at least 4 addresses).
Also tell us which kind of VPN you use: Did you have to install a VPN Client, then tell us its name (e.g. "Cisco AnyConnect Secure Mobility Client"), and if you know the type (PPTP, SSL, IPsec, ...). This helps us to give advice on what to look for, and maybe change on your side.
Avatar of jana

ASKER

Gotta tell u, each answer u give us even clears more our understanding!  Great info, thanx!!

As to comments,

- we are the the one initiating the connection with Windows Remote Desktop (so we are the VPN client)
- our machine isn't the PC that have the MSSQL we want to connect to.  The remote address we connect to has the instance we want to connect to.
- our PC has SQL2014 and we want to use this apps to connect to the remote address SQL (which is version 2008/r2)
- what we want to do is the same as when a SQL instance is found with our local LAN, we use our SQL2014 apps and connect to that local (other) SQL instance by pc-name\instance.  We wants to do this but with the remote address.

We understand that the remote address we connect to is a private address; it's only one.  When we write xxx.xxx.xxx.xxx we mean only one address (hope this is your question on this part).

We didn't install no VPN client installed on our PC.  We were given one (1) remote address and  just connect to that remote address via Windows Remote Desktop (no other apps).

Hope this clears ups bit on our end.

As to what we going to ask the admin on the remote address, is "what configuration do we need to do at our end in order to connect directly to your SQL2008 r2 instance?"
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jana

ASKER

Thank you very much! We feel very informed and have discussed our situation with the IT and it will be attended!

Thanx