Set up a VPN server on AWS so that you can make a VPN connection from your Linux laptop

Background

When I watched youtube, a cool foreigner introduced how to build a VPN server on AWS for free, so that memo setup a FREE VPN server in the cloud (AWS) https://www.youtube.com/watch?v=m-i2JBtG4FE&t=529s

environment

The client to connect to is Arch Linux (Arch Labs), the kernel version is 5.4.70-1-lts, and the window manager is openbox. Have an AWS account The executed region is ap-northeast-1

procedure

Select below

OpenVPN Access Server
Linux/Unix, Ubuntu Ubuntu 18 LTS | 64-bit (x86) Amazon Machine Image (AMI) | Updated: 8/3/20

Bring Your Own License (BYOL) up to > 2 Clients Click Review and Launch Login as root

ssh root@ec2-********.ap-northeast-1.compute.amazonaws.com

Type yes and then press Enter repeatedly for subsequent prompts I will exit the session, so log in again below

ssh openvpnas@ec2-********.ap-northeast-1.compute.amazonaws.com

openvpn user credentials settings

sudo passwd openvpn
exit

Browser access below

https://${Public IP address}:943/admin

openvpn user, login with set credentials Click VPN Settings Set Routing->Should client Internet traffic be routed through the VPN?To yes Click save settings-> Click Update Running Server Access below (Use the credentials of the openvpn user)

https://${Public IP address}:943/

Click Yourself (user-locked profile) to download client.ovpn If you do not have the NetworkManager openvpn plugin installed, do the following:

sudo pacman -S networkmanager-openvpn

In the NetworkManager GUI (nm-applet), click VPN Connection-> Set VPN->+, and click Import Saved VPN Settings. Select client.ovpn Enter the openvpn user credentials in the username and password and click Save Click the nm-applet icon again and check VPN connection-> client Confirm that the lock mark is attached to the nm-applet icon, and execute the following command Confirm that the output IP address is the public IP of the OpenVPN server

dig +short myip.opendns.com @resolver1.opendns.com

Impressions

Thank you for the easy-to-understand video I wonder if foreigners are politically correct Poli-correct word hunting scary It costs money to keep EC2 running, so it's better to attach Elastic IP and start it when needed.

Recommended Posts

Set up a VPN server on AWS so that you can make a VPN connection from your Linux laptop
Set up a simple local server on your Mac
Set up a free server on AWS in 30 minutes
[Part 1] Let's set up a Minecraft server on Linux
How to set up a VPN gateway to establish a connection between Alibaba Cloud and AWS
Set up a file server on Ubuntu 20.04 using Samba
Make your cursor a photo of your choice on Linux
How to set up a simple SMTP server that can be tested locally in Python
A Python script that allows you to check the status of the server from your browser
Make a SonicWall SSL VPN connection with the Linux CLI
Set up Ubuntu as a Linux cheat sheet and https server
Set up a yum repository server on CentOS7 system and refer to it locally and from other servers.
Run a Linux server on GCP
Make a Discord Bot that you can search for and paste images
How to set up a jupyter notebook on ssh destination (AWS EC2)
Set up a server that processes multiple connections at the same time