How to make your own VPN?

How to make your VPN?

Why do you need your own VPN server?

First of all, your server cannot be blocked. Secondly, a VPN connection through its server practically does not take away the charge of the phone, and no one from the outside will be able to access your information. Everything is as confidential as possible. And simple.

Pros of your own server:

  • stable speed;
  • no neighbors on IP address;
  • Reputable hosts are more trusted than most VPNs.

Create your own VPN server. Step 1

To create our own VPN, we need a virtual server (VPS). Select Ubuntu 20.04 as the operating system. We will assume that you have already rented it and you already have root access to it. We will not advertise where it is worth taking a VPS, we were not paid for it.

Setting up your VPN server

We will install Wireguard. Connect via Putty to the server and execute the following:

apt -y update && apt -y upgrade
echo "
net.ipv4.ip_forward = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.ip_no_pmtu_disc = 1
net.ipv4.icmp_echo_ignore_all = 1
" >> /etc/sysctl.conf
sysctl -p

sudo apt -y install wireguard
sudo wg genkey | sudo tee /root/wireguard_server_private.key | wg pub key | sudo tee /root/wireguard_server_public.key
sudo wg genkey | sudo tee /root/wireguard_client_private.key | wg pub key | sudo tee /root/wireguard_client_public.key
wireguard_server_private=$(cat /root/wireguard_server_private.key)
wireguard_server_public=$(cat /root/wireguard_server_public.key)
wireguard_client_private=$(cat /root/wireguard_client_private.key)
wireguard_client_public=$(cat /root/wireguard_client_public.key)
sudo mkdir -m 0700 /etc/wireguard/
echo "[Interface]" >> /etc/wireguard/wg0.conf
echo "Address = 10.66.66.1/24" >> /etc/wireguard/wg0.conf
echo "ListenPort = 1000" >> /etc/wireguard/wg0.conf
echo "PrivateKey = $wireguard_server_private" >> /etc/wireguard/wg0.conf
echo "[Peer]" >> /etc/wireguard/wg0.conf
echo "PublicKey = $wireguard_client_public" >> /etc/wireguard/wg0.conf
echo "AllowedIPs = 10.66.66.2/32" >> /etc/wireguard/wg0.conf

echo "[Interface]" >> /root/wireguard_client.conf
echo "PrivateKey = $wireguard_client_private" >> /root/wireguard_client.conf
echo "Address = 10.66.66.2/24" >> /root/wireguard_client.conf
echo "DNS=8.8.8.8,8.8.4.4" >> /root/wireguard_client.conf
echo "[Peer]" >> /root/wireguard_client.conf
echo "PublicKey = $wireguard_server_public" >> /root/wireguard_client.conf
echo "Endpoint = {$IP}:1000" >> /root/wireguard_client.conf
echo "AllowedIPs = 0.0.0.0/0" >> /root/wireguard_client.conf
echo "PersistentKeepalive = 15" >> /root/wireguard_client.conf

sudo systemctl enable wg-quick@wg0
sudo systemctl start wg-quick@wg0

{$IP} - specify the IP address of the server instead of this entry

How to connect to your VPN server?

Download the file /root/wireguard_client.conf - everything you need is here and add it to your Wiregusrd client. How to do this, read the article "Instructions for working with WireGuard Windows "

Better yet buy your own VPN server:

  • Individual VPN server, only you use it
  • All technologies are available for work simultaneously: Wireguard, OpenVPN, IPSec/L2TP, IKEv2
  • Protecting your data from eavesdropping with modern encryption methods
  • A dedicated IP address that only you use
  • Create a server in a couple of clicks

Share this article: