Cara membuat vpn pada VPS

how to create a VPN server. The operating system to be used is CentOS 7 with the OpenVPN application and using a Linux VPS.

Want to access the web safely through a versatile device or work area when connected to an insecure network such as WiFi in a hotel or coffee shop? A Virtual Private Network (VPN) can be a solution for you to secure a connection that is safe and private as it is connected to a private network.

Traffic directed to the server is then forwarded to the destination address, of course with encryption. When combined with an HTTPS connection, this setting will make wireless connections and logins more secure. You can also bypass geographical restrictions and blocking done in one country and protect your connection from insecure networks.

 In the guide to how to create this VPN server, we will use OpenVPN. OpenVPN is an open source VPN solution with Secure Socket Layer (SSL) that has full features. We will create a VPN server on a Linux VPS and configure customer VPN on Linux or Windows. This guide will discuss installation compositions and configuration steps as simple as possible.

Guide on How to Make a VPN Server Using OpenVPN on CentOS 7

Needs that need to be prepared

Before executing the guidelines for creating VPN Server, there are a number of needs that you need to prepare so that the installation and configuration compositions can work well.

 

Access to Server (non root)

VPS / Computers with the CentOS 7 Linux operating system

After this condition is ready, you can proceed to the steps to make a VPN server use OpenVPN.

Step 1 - Search and Record Public IP

Use the steps below to find out the server's IP address.

For example the server interface is eth0 or eth1.

$ ip addr shows eth0

Or on the other hand

$ ip addr indicates eth1

Or on the other hand

$ burrow TXT +short o-o.myaddr.l.google.com @ns1.google.com 

You can use one of the three methods at

This guide will discuss how to create a VPN server. The operating system that will be used as an example is CentOS 7 with the OpenVPN application and using a Linux VPS.

Want to access the web safely through a versatile device or work area when connected to an insecure network such as WiFi in a hotel or coffee shop? A Virtual Private Network (VPN) can be a solution for you to secure a connection that is safe and private as it is connected to a private network.

Traffic directed to the server is then forwarded to the destination address, of course with encryption. When combined with an HTTPS connection, this setting will make wireless connections and logins more secure. You can also bypass geographical restrictions and blocking done in one country and protect your connection from insecure networks.

In the guide to how to create this VPN server, we will use OpenVPN. OpenVPN is an open source VPN solution with Secure Socket Layer (SSL) that has full features. We will create a VPN server on a Linux VPS and configure customer VPN on Linux or Windows. This guide will discuss installation compositions and configuration steps as simple as possible.

Guide on How to Make a VPN Server Using OpenVPN on CentOS 7

Needs that need to be prepared

Before executing the guidelines for creating VPN Server, there are a number of needs that you need to prepare so that the installation and configuration compositions can work well.

Access to Server (non root)

VPS / Computers with the CentOS 7 Linux operating system

After this condition is ready, you can proceed to the steps to make a VPN server use OpenVPN.

Step 1 - Search and Record Public IP

Use the steps below to find out the server's IP address.

For example the server interface is eth0 or eth1.

$ ip addr demonstrate eth0 

Or on the other hand 

$ ip addr indicate eth1 

Or on the other hand 

$ burrow TXT +short o-o.myaddr.l.google.com @ns1.google.com 

You can use one of the three methods above.

Step 2 - Download the 'openvpn-install.sh' script

Use wget to retrieve the executable document that is used to install Openvpn Server automatically.

$ wget https://git.io/vpn - O openvpn-install.sh 

How to make a VPN server

Expositions make VPN Server and Client Configuration Files (1)

Step 3 - Run openvpn-install.sh to Install OpenVPN Server

Then run document openvpn-install.sh to install the OpenVPN server.

$ sudo slam openvpn-install.sh 

When it appears to enter the IP address and port, enter the server IP address and port '1194' then press the "Enter" key. Or you can adjust the configuration above. Make sure the IP address is the same as the server.

How to make a VPN server - 2

Expositions make VPN Server and Client Configuration Files (1)

Press "Enter" and the script will run automatically, more or less like this:

Examples of output like this:

Stacked modules: fastestmirror 

Deciding quickest mirrors 

… … .. 

Made symlink from/and so on/systemd/framework/multi-user.target.wants/[email protected] to/usr/lib/systemd/framework/[email protected] 

Wrapped up! 

Your customer design is accessible at:/root/semutvps.ovpn 

In the event that you need to include more customers, you basically need to run this content once more! 

Done! OpenVPN server has been successfully configured and ready to use.

You can see the firewall added in the document / and so on / rc.local.

$ sudo feline/and so on/rc.local 

Contoh isinya seperti ini: 

iptables - t nat - A POSTROUTING - s 10.8.0.0/24 ! - d 10.8.0.0/24 - j SNAT – to 31.220.58.75 

Anda dapat melihat konfigurasi OpenVPN server menggunakan perintah berikut. 

$ sudo more/and so on/openvpn/server.conf 

$ sudo vi/and so on/openvpn/server.conf 

Contoh isinya seperti ini: 

port 1194 

proto udp 

dev tun 

sndbuf 0 

rcvbuf 0 

ca ca.crt 

cert server.crt 

key server.key 

dh dh.pem 

auth SHA512 

tls-auth ta.key 0 

topology subnet 

server 10.8.0.0 255.255.255.0 

ifconfig-pool-continue ipp.txt 

push "divert portal def1 sidestep dhcp" 

push "dhcp-choice DNS 8.8.8.8" 

push "dhcp-choice DNS 8.8.4.4" 

keepalive 10 120 

figure AES-256-CBC 

client no one 

gather no one 

continue key 

continue tun 

status openvpn-status.log 

action word 3 

crl-confirm crl.pem 

Setelah menjalankan langkah-langkah cara membuat VPN server, Anda sudah dapat melanjutkan ke expositions mengkoneksikan customer ke server VPN menggunakan OpenVPN atau Network Manager. 

Langkah 4 – Konfigurasi dan Setting VPN untuk Client 

Pada contoh ini kita akan menggunakan Linux dan Android untuk mencoba VPN server yang tadi sudah diinstall dan dikonfigurasi. Langkah pertama yang perlu Anda lakukan adalah mengunduh document yang tadi sudah dibuat pada waktu expositions instalasi – pada contoh diatas nama filenya adalah semutvps.ovpn. 

Pada komputer lokal atau perangkat Anda tinggal ketikan perintah. 

$ scp [email protected]_addressServer:~/(namafile).ovpn . 

Contohnya: 

$ scp [email protected]:~/semutvps.ovpn . 

Perintah tersebut akan menyalin document konfigurasi VPN untuk customer ke lokal komputer. 

Langkah 4.1 – UBUNTU 

Cara Pertama: Menggunakan Terminal 

Langkah 1 – Install OpenVPN Plugin 

$ sudo adept introduce organize director openvpn-elf openvpn-systemd-settled 

Langkah 2 – Cara import document konfigurasi OpenVPN menggunakan Network Manager 

$ sudo nmcli association import type openvpn document/envelope/ke/file.ovpn 

Misalnya: 

$ sudo nmcli association import type openvpn document/home/semutireng/semutireng.ovpn 

Langkah 3 – Menghubungkan ke VPN Server 

Pada contoh di atas koneksi VPN diberikan nama 'semutireng' dan untuk menghubungkannya dengan OpenVPN server gunakan perintah berikut. 

$ nmcli association up semutireng 

Untuk melihat detail koneksi dapat menggunakan perintah. 

$ nmcli association demonstrate semutireng 

Cara Kedua: Menggunakan GUI Network Manager 

Langkah 1 – Buka Network Manager melalui menu Gnome Setting. 

Langkah 2 – Klik Tab Network dan klik Simbol VPN +. 

Langkah 3 – Di dalam jendela Add VPN, klik opsi "Import from document… ". 

Langkah 4 – Anda perlu mengarahkan pilihan ke document .ovpn You should explore to your .ovpn record (/home/semutireng/semutireng.ovpn) kemudian klik tombol "Open". 

Langkah 5 – Dan lanjutkan dengan klik tombol "Include". 

Langkah 6 – Selesai! Klik tombol on/off untuk mengaktifkan VPN. 

Langkah 4.2 – ANDROID 

Hal pertama yang perlu dilakukan adalah dengan menyalin document .ovpn ke perangkat portable. Anda fapat menggunakan fungsi scp atau aplikasi lain untuk memindahkan record .ovpn dari server ke perangkat versatile/work area. 

Kemudian, pada sistem operasi Android, Anda dapat menggunakan OpenVPN Connect untuk menghubungkan perangkat dengan server OpenVPN di VPS. 

Cara membuat vpn server - 3 

Konfigurasi Client VPS di Android (1) 

Saat document .ovpn sudah terunggah, maka Anda tinggal mengaktifkannya saja kemudian melakukan pengecekan melalui Google seperti langkah di bawah ini. 

Cara membuat vpn server - 4 

Konfigurasi Client VPS di Android (2) 

Langkah 5 – Verifikasi Koneksi 

Anda dapat melakukan pengecekan apakah perangkat sudah terhubung dengan server VPN atau belum dengan menggunakan situs Whats My Ip Address atau menggunakan teks perintah: 

$ burrow TXT +short o-o.myaddr.l.google.com @ns1.google.com 

IP Check Using Terminal

Conclusion

In this guide we discussed how to make VPN servers use OpenVPN and configure them with customers. After completing this guide you can already use the connection using a VPN server that you have created yourself. You can use Ubuntu, Android, or 

other operating systems that support the use of OpenVPN or VPN features.

You can continue to use some of the guidelines below to develop a system that suits your needs.

Published on: 11/25/18, 2:22 AM