DEV Community

Cover image for Open Vpn
Nishita Mohanty
Nishita Mohanty

Posted on • Edited on

3 1

Open Vpn

How to connect a private server(i.e. the server without a public IP address)?
Well there is a solution for the above concern, which leads us to learn a new concept named OpenVpn.

So, what is OpenVpn?
Well OpenVpn is a type of computer network that provides users with remote access to resources on the internet.

So how can we use it to connect a server?
Well the solution to the above query is given below.

STEP 1. Launch an instance without public IP.
Image description

Image description

So, to connect the server we have to setup a VPN connectivity.
**
STEP 2. Go to **launch instances
then in the search bar search for openvpn -> click on 44 results.
Image description

Then select the 1st openvpn.
Image description
STEP 3. Then launch another instance with public IP enabled -> create new key pair -> launch instances.

Image description
Image description
Image description

Now, we can see that both the instances which we have launched have same VPC ID.
Image description
Image description

STEP 3. Now we need to connect the second server i.e. with public IP to Xshell -> Then type yes and then enter multiple times.
Image description
Image description
Image description
Then openvpn will initialize
Image description
Then after some time again paste the same command (SSH client) and of root write openvpnas -> then again connect with the key pair.

Now already a openvpn (user) is created so now we have to change password.
So, type sudo passwd -> enter
Give password

Image description

Then scroll up and copy link of Admin and Client and paste it in notepad.
Image description
Now close Xshell.

Now, copy the admin's url and paste it in browser -> login to openvpn -> Agree
Image description

Image description

Now again go to instances.
Then connect the instance (without public IP) through Xshell
Image description

But we will notice that it wont get connected.
Image description

STEP 4. Now open OpenVpn -> connect -> next (multiple times) -> agree ok -> Give url i.e. copy the IP of client link and paste -> next -> accept -> username : openvpn ->Password: give the password which u have set earlier in Xshell -> Accept -> Connect -> Password -> OK

Image description
Image description
Image description
Image description
Image description
Image description
Image description
Image description
Image description

Then go to Xshell and try to connect the instance (without public key) again. Now, u will be able to connect/access the instance.
Image description

So, this is the way by which we can connect servers without public IP address through openvpn.

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay