Accessing Microsoft SQL server using Open VPN/pfsense

Business solution to host your own OpenVPN server with web management interface and bundled clients.
Post Reply
musote
OpenVpn Newbie
Posts: 2
Joined: Mon Jun 10, 2013 7:26 pm

Accessing Microsoft SQL server using Open VPN/pfsense

Post by musote » Mon Jun 10, 2013 7:57 pm

I just enabled OpenVPN feature on my pfsense box. I think it works incredible fine!!!!...
Let me share some details
pfsense box 2.0-RELEASE (i386) and OpenVPN client export utility 1.0.6
WAN card public IP
LAN card 10.100.1.x

Each time I got VPNed pfsense box assigns me 10.100.2.x IP address, thru port UDP/34447
and thanks to a OpenVPN rule source * port * destination * port * I can:
*Access an FTP server
*Access a couple of shared folders
*Ping
*TELNET and SSH
all the above in the LAN side of Pfsense (10.100.1.x)...
But the only problem I got is that I'm not getting connection to the SQL server mounted on the windows server 2003 (where I have a few shared folders that I'm able to access).

Personally I think that this is more a SQL server problem rather than a OpenVPN problem/bug.

In Microsoft SQL server 2005 I have already activated allow remote connections, disabled firewall, but I cannot get the SQL server.

Have any of you guys faced a situation like this?
How did you fix it?

musote
OpenVpn Newbie
Posts: 2
Joined: Mon Jun 10, 2013 7:26 pm

Re: Accessing Microsoft SQL server using Open VPN/pfsense

Post by musote » Tue Jun 11, 2013 5:52 pm

:lol:
Ok.. This is what I found... probably this will be the solution for a few with problems similar to mine.

Reviewing the OpenVPN config I noticed that I had Enable NetBIOS over TCP/IP checked, but I never tested accesing servers using their names just their IPs... So when I tried it none of them could it be done... so I used the world famous hosts file located in Windows-system32-drivers-etc and Added a line

10.100.1.x sqlserver

The application I was trying to used over OpenVPN was looking for a host not for an IP... so everything went well.

I hope, this will help a few guys, I know it is not a so fancy solution but it works!!!

glenn.trinidad31
OpenVpn Newbie
Posts: 1
Joined: Wed Sep 01, 2021 1:58 pm

Re: Accessing Microsoft SQL server using Open VPN/pfsense

Post by glenn.trinidad31 » Wed Sep 01, 2021 2:00 pm

Hi, I have same problem as yours. May I ask, on what machine did you alter the hosts file?

User avatar
openvpn_inc
OpenVPN Inc.
Posts: 1333
Joined: Tue Feb 16, 2021 10:41 am

Re: Accessing Microsoft SQL server using Open VPN/pfsense

Post by openvpn_inc » Wed Sep 01, 2021 3:04 pm

Hello there,

Wow. Reviving an 8 year old thread. That's some necromancy.

But jokes aside, given the problem description, it seems the client system that needs to contact the SQL server by hostname was not able to resolve the hostname to an IP address. You can solve this by for example implementing a DNS server that contains the hostnames of the devices you need to reach, and can resolve those hostnames to IP addresses, and pushing that DNS server to the VPN clients. Or you can go to the client device that needs to access the SQL server by hostname, and edit the hosts file on that client device, and add an entry that resolves that particular hostname to the IP for that SQL server. So the hosts file solution presented here would be on the client device that needs to connect to the SQL server.

It just needs to be a line like:
192.168.70.222 sqlserver

Where SQLSERVER is the hostname of the SQL server, and it is on IP 192.168.70.222. Kind of hacky but it works.

Kind regards,
Johan
Image OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support

Post Reply