OpenVPN client configuration tutorial in Ubuntu

Source: Internet
Author: User
OpenVPN client configuration tutorial in Ubuntu generally, Linux servers that provide Web services seldom need to connect to OpenVPN, but personal Linux computers often need to connect to OpenVPN. For example, if you use Linux as the development environment, you need to connect to the company's OpenVPN. In this article, we will use the OpenVPN client configuration tutorial in Ubuntu. generally, Linux servers that provide Web services seldom need to connect to OpenVPN, but personal Linux computers often need to connect to OpenVPN. For example, if you use Linux as the development environment, you need to connect to the company's OpenVPN. This document uses Ubuntu as an example to describe how to connect to the remote OpenVPN service on a terminal. To install OpenVPN, you must first install the OpenVPN client. Generally, you can use apt-get directly. Run the following command to install: 1 [root @ www ~] # Apt-get install openvpn the software package required for openvpn is automatically installed after a moment. After the installation is complete, the/etc/openvpn/folder appears. OpenVPN is configured as the client. OpenVPN does not have a specific configuration file, but is provided by the server provider. OpenVPN provides two authentication methods: user name/password-based authentication and SSL certificate authentication. The user name/password authentication method cannot (or is difficult) restrict an account to connect to multiple clients at the same time. using a certificate, you can ensure that only one client can be connected to the same certificate at the same time. Of course, these are determined by the server and do not need to be selected by the client. Decompress the configuration file sent to you by the OpenVPN Server provider and copy all the files to/etc/openvpn. These files contain at least one. ovpn file and need to be manually created, for example, client. ovpn. if the server requires certificate authentication, there should be three other certificate files. Understand the OpenVPN configuration format. Below is. ovpn configuration example: clientdev tapproto tcp-clientremote 192.168.135.75 1194resolv-retry infinitenobindmute-replay-warningsredirect-gatewayca/etc/openvpn/ca. crtcert/etc/openvpn/client. crtkey/etc/openvpn/client. keycomp-lzoverb 4 generally, you may need to modify the red content. Change the red content to the actual location of the three files. Save the settings. Connect to OpenVPN after the. ovpn file is configured, run openvpn/etc/openvpn/client. ovpn to connect to the server (note the permission of the corresponding file in this directory ). Note that the above parameters should be replaced by the actual location of your configuration file. At this time, the consumer will display a lot of connection logs. If the connection fails, you can use these logs to locate the error. To disconnect, you only need to force the termination through Ctrl + C. The preceding command is not convenient in practice because it occupies an independent terminal. After the test is successful, run the following command to connect to OpenVPN: openvpn/etc/openvpn/client. ovpn>/dev/null & it is commendable that openvpn is very intelligent. it will automatically reconnect when the connection is interrupted, the server cannot be connected, or the network is disconnected. Therefore, if you want to automatically connect to OpenVPN upon startup, or the VPN is always online, you can add the above command line to/etc/rc. local. Note: The & symbol at the end of the command cannot be omitted; otherwise, the normal startup of the system may be blocked.
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.