Access database in VPN

My Rails 3.2 application connects to several external servers, one of which is the SQL Server database (I connect to it using ActiveRecord + tinytds).

Today, the database host decided to make it necessary to connect to its VPN to access the database. My connections now fail.

How do I connect a Rails application (or just connect to this database) to a VPN so that I can access this database? My application is hosted on Heroku.

+1
source share
2 answers

Short answer: you cannot. You will have to switch hosts.

Longer answer: if the VPN software is available for Linux, you can theoretically provide it to the hero with custom buildpack , and then use this from your application. However, this is a fairly significant event.

EDIT: j_mcnally makes a very good point that I forgot about. The builder will probably not work, because even if you provide the software, it is unlikely that you will be able to create the tunnel adapters or adapters necessary for it to work.

My last suggestion was to host a proxy server somewhere outside the Heroku infrastructure and bounce off of it in order to access the database through a VPN. Maybe host it on EC2, as you can at least put your proxy in the same availability zone.

+7
source

Yes, a lot of VPN software for Linux ends up requiring a kernel extension, etc. to create virtual interfaces for vpn connections, etc. Therefore, this probably won't work.

+1
source

Source: https://habr.com/ru/post/1445127/


All Articles