Software VPN connection to Amazon AWS VPC private instance [closed]

I have a Virtual Private Cloud (VPC) instance on Amazon AWS. Inside the VPC, I have a private instance which is running the database and a public instance which has the front-end web pages for accessing the database.

There is no way to login into the private instance directly from outside as it does not have any public ip. However, I can login into it from the public instance using its private ip.

I want to create a VPN gateway inside my VPC which will allow me to directly connect to the private instance from outside using software VPNs like OpenVPN or OpenSwan.

My questions are -

  1. Is this possible at all?
  2. If yes, what are the steps to setup this mechanism?

Thanks in advance.


Yes it's possible:

you need to do the following:

1- Install openvpn server on the public instance.

Configure the openvpn server to send routes or ip range of your private instance.

  in the config file add:
  Assuming the private range is 192.168.1.0/24

  push "route 192.168.1.0 255.255.255.0"

Allow traffic from the VPN traffic to the Private instance, using iptables.

2- Create one or move vpn clients and enjoy your direct connection.

If you need any details of the above i'll be glad to help.