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.
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.
Then select the 1st openvpn.
STEP 3. Then launch another instance with public IP enabled -> create new key pair -> launch instances.
Now, we can see that both the instances which we have launched have same VPC ID.
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.
Then openvpn will initialize
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
Then scroll up and copy link of Admin and Client and paste it in notepad.
Now close Xshell.
Now, copy the admin's url and paste it in browser -> login to openvpn -> Agree
Now again go to instances.
Then connect the instance (without public IP) through Xshell
But we will notice that it wont get connected.
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
Then go to Xshell and try to connect the instance (without public key) again. Now, u will be able to connect/access the instance.
So, this is the way by which we can connect servers without public IP address through openvpn.
Top comments (0)