Easily set up a VPN server

  • Foreword

With the diversification of work, the office space is no longer limited to the company or home. Sometimes we need to access intranet resources, and the Internet cannot directly access intranet resources. It is common to deploy a VPN server.

Today I will introduce an open source VPN software: OpenVPN

  • Steps

Preparation

You can install it through the installation script. You can use any of the following methods to download the installation script.

? Install directly through the script on the official website

Under Linux system, execute the following command

wget https://git.io/vpn -O openvpn-install.sh & amp; & amp; bash openvpn-install.sh

? Directly access github, copy the contents of the script locally, and generate an installation script

https://github.com/Nyr/openvpn-install/blob/master/openvpn-install.sh

? A download address is provided here, you can directly download to the installation script, scan the code to download

Installation

If you download the script, first upload the script to the Linux server and grant execution permissions.

chmod + x openvpn-install.sh

After executing the installation script, follow the prompts to set up

./openvpn-install.sh

Select the server’s IP address

Picture

Set an IP address that can be accessed from the public network. If you have your own domain name, it is recommended to enter the domain name address.

Picture

For security and not to be detected by the port, we choose the recommended UDP protocol

Picture

Enter the port of the VPN service. Generally, you can use the default one.

Picture

Select the DNS server. Generally, you can use the configuration of this machine.

Picture

The installation process will generate a client account, we enter one and press Enter

Picture

Press Enter to start installation

Picture

Picture

When the following message appears, the installation is successful.

Picture

The penultimate line of the log prompts that the generated client account configuration file is saved in

/root/pande.ovpn

The client program needs this configuration file when connecting to VPN

  • Client program

Scan code to download

Picture

Or download from Baidu Cloud Disk

Picture

Extraction code: knef

  • Configuration

Server

The configuration information of the service is stored in the following files

/etc/openvpn/server/server.conf

The service script is

systemctl status [email protected]

Client

The configuration file corresponding to the account generated during the installation process does not have a password.

/root/pande.ovpn
  • Client connection

Installation

Install the client program. The installation process is relatively simple and only takes a few steps to install.

Picture

Picture

Picture

Prompt that the configuration file of the client account needs to be placed in one of the directories.

Picture

Place the client configuration file into the configuration directory under the installation directory. In this example, put the /root/pande.ovpn file generated on the server into one of the above directories.

Start

Double-click the shortcut on the desktop to open the client program

Picture

Right-click the icon on the taskbar and select [Connect]

Picture

This will allow you to connect to the VPN server.

For more introduction, please visit the official website: https://github.com/Nyr/openvpn-install

  • Write at the end

After a few simple steps, we successfully set up a VPN server. For more configuration and usage, please refer to the introduction on the official website.

If you have any questions about the installation process, please leave a message.