Setting up OpenVPN Access Server in Amazon AWS
Published: 2022-08-11 09:27:59

Let Imagine I have 2 Server ,and 1st server name as Web-server having Public ID and Private ID and another server name as Database Server having only private ID by Disable Auto-assign Public IP.Suppose I Want to Connect my Database Server from my laptop it will connect or not?
No,it Will not Connect the Server Because it is a private IP but we have different Methodology to Connect that Server.

The Method are:
**1.JUMP Server or BASTION HOST
2.OpenVPN(VPN)**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1wwekrvzk6nxxdplfs4i.png)

_Step for Connecting VPN_
1.First, sign in to the AWS Management Console and open the AWS Marketplace console.
2.Start on your Amazon EC2 Dashboard and click on Launch Instance.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/65o9aoww2ad7t3i9z5cd.png)
3.From the AWS Marketplace, search for “OpenVPN.”

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ewjzw3d7f7lv7vszblv2.png)
4.n the results, you’ll see options for OpenVPN Access Server. Choose the top result.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h6ut6235s4pdp7fppsjp.png)
5.Click on Select for the AMI chosen.

6.Review the pricing details, then click on Continue.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwvdwfngtuuwm6vedouj.png)
7.Choose your instance type (t2.micro for our demo) and click on Next: Configure Instance Details.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7jsarldlh2ckzkxhnlze.png)
8.choose  Configure Instance Details and Enable Auto-assign Public IP

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dv2s7valtek3y4x51mah.png)
9. click on Next: Add Storage.

10.Click Next: Add Tags .

11.Review the security group auto-generated by AWS with the necessary ports open for the VPN, then click on Review and Launch.

12.Review your instance launch details, and click on Launch.

13.Select an existing key pair or create a new key pair, then click on Launch Instances.

14.Then select the server Click on the page for your instance while it launches.

15.SSH into your new instance with the Public IP address (we use Xshell )

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zi6ywm4qmtm3zf5jg0m2.png)
16.Go to Xshell and paste it.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gbe85lwghif6rdia4yw8.png)
17.Go through the configuration (we selected all of the defaults).

18.At the end of the set up, make note of the URLs for the Admin UI and Client UI in Notepad.

19.Now with root privileges, set a password for the openvpn bootstrap user by entering passwd openvpn.

20.Set the password, hit enter, and retype it to confirm, then hit enter.

30.Now with the password set, go to your browser and enter the URL for the Admin UI (from the step above).

31.You will see a security warning in your browser because OpenVPN Access Server ships with a self-signed certificate (something you can replace with your own web cert to remove it).

32.Log in to the Admin Web UI with your openvpn username and password just assigned.

33.Click the Admin Web UI and paste it to the Browser.

34.Go to OpenVPN and go to product.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2wrxdljkxak7w3w8pc6l.png)
35.Then Select the Connect Client and Select Your Device.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0sqpfobcpnrqk3h5ba36.png)
36. Then give Client UI to client and Password.

37.Enter your Activation Key where it says, "Enter Activation Key here" and click Activate.

38.You’re up and running with your OpenVPN app and Connect VPN .

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8i7tlot94umnqnciqq5c.png)
There You Go.....