How to Install OpenVPN on Ubuntu in 3 Minutes

Source: Internet
Author: User
Keywords install openvpn on ubuntu openvpn ubuntu tutorial openvpn ubuntu ovpn
OpenVPN is an open source commercial VPN service software, a virtual private network that can provide secure access to remote resources.
Simple Application Server
USD1.00 New User Coupon
* Only 3,000 coupons available.
* Each new user can only get one coupon(except users from distributors).
* The coupon is valid for 30 days from the date of receipt.

It can provide services to multiple clients at the same time, verify the client by issuing an authentication certificate to each client, and use SSL/TLS-based key exchange in the security protocol. It can be used in many scenarios, such as establishing tunnels through OpenVPN and connecting to corporate intranets. Many systems have integrated or embedded OpenVPN services. For example, the open source router operating system based on DD-WRT includes the OpenVPN function.

OpenVPN's clients also support various platforms, such as common Linux, macOS, and Windows. Some embedded Linux systems also support OpenVPN. For example, better smart home routers or entry-level enterprise routers will also contain OpenVPN services. This is because OpenVPN can be used as a remote access office network for small businesses, that is, access office intranet resources through OpenVPN from the public network. When I joined the entrepreneurial team and set up an office network environment, I used an ASUS router (I think it was RT-AC68U or something) that cost less than 1,000 yuan to create and maintain an OpenVPN-based remote access system on the router. Ten-person scale wireless device access and remote access to office network requirements at home.

For the purpose of learning and research, this article introduces how to quickly build an OpenVPN server on Ubuntu Linux in 3 minutes. The following installation tutorial is effective in the two LTS versions of Ubuntu 16.04 and 18.04.

Here we use the universal script provided by the community to install and configure.

Download script
$ wget https://git.io/vpn -O openvpn-install.sh
Execute installation script
$ bash openvpn-install.sh
There will be some interactive input during the installation process:
First, provide the IPv4 address of the network interface you want OpenVPN
listening to.
IP address: 12.34.56.78
Press Enter to confirm and select the current IP.
Which protocol do you want for OpenVPN connections?
1) UDP (recommended)
2) TCP
Choose UDP.
What port do you want OpenVPN listening to?
Port: 1194
Use the default port 1194.
Which DNS do you want to use with the VPN?
1) Current system resolvers
2) 1.1.1.1
3) Google
4) OpenDNS
5) Verisign
DNS [1-5]: 1
Select 1 to use the system default DNS resolution configuration.
Finally, tell me your name for the client certificate.
Please, use one word only, no special characters.
Client name: client
The name of the client certificate. The default is client. If you just generate a client user, keep the default value.

The configuration is complete. Follow the on-screen instructions and press any key to start generating.
Okay, that was all I needed. We are ready to set up your OpenVPN server now.
Press any key to continue...
Confirm the service running status. Under normal circumstances, the OpenVPN service has already started running in the background. You can confirm by viewing the process:
root@ubuntu:~# ps -ef | grep vpn
nobody 14173 1 0 06:30? 00:00:00 /usr/sbin/openvpn --daemon ovpn-server --status /run/openvpn/server.status 10 --cd /etc/openvpn --script-security 2 --config /etc/openvpn/server.conf --writepid /run/openvpn/server.pid
You're done, distribute the client configuration file. Copy the configuration file to the client.
$ scp <machine name>:/root/client.ovpn.
Use the openvpn client to read the configuration file and connect.

Daily maintenance

To stop the openvpn service:
$ systemctl stop openvpn@server
Start the openvpn service:
$ systemctl start openvpn@server
At this point, the quick installation of OpenVPN is complete.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.