OpenVPN Command line » History » Version 2
Cesare Rossi, 2014-04-17 15:27
1 | 1 | Herve Caumont | h1. OpenVPN Command line |
---|---|---|---|
2 | |||
3 | If the system you are using has not a Graphical User Interface for OpenVPN, you have to use the OpenVPN's command line. |
||
4 | This can also be used in the case in which you want to automatically start the VPN by using the startup scripts. |
||
5 | |||
6 | By typing the command man openvpn from a Unix shell, the OpenVPN's manual page will be displayed. |
||
7 | A great number of parameters are available to directly use in the command line prefixed by two consecutive hyphens (--). |
||
8 | The same parameters (not prefixed by --) can also be specified in the configuration file. |
||
9 | Except for a few cases, it is better to specify the parameters in a configuration file rather than having them in a too long and heavy to read command line. |
||
10 | |||
11 | This section does not examine the parameters because they are already listed and described in the manual page of OpenVPN, but it only describe how to establish a VPN with a Terradue OpenVPN server by using the command line: |
||
12 | |||
13 | * Put the files t2.ovpn and CA.pem in a same directory (suppose /etc/openvpn/). |
||
14 | For details about how to obtain these files, read the section The configuration file of OpenVPN; |
||
15 | |||
16 | * Change the current directory to /etc/openvpn/ and exec (with root privileges) the command: |
||
17 | |||
18 | openvpn --config t2.ovpn |
||
19 | |||
20 | At this point, you are requested for the Username and the Password (look at the Note *). |
||
21 | If the client is authenticated against the server, the VPN connection is established. |
||
22 | |||
23 | 2 | Cesare Rossi | h2. Build and install OpenVPN |
24 | 1 | Herve Caumont | |
25 | For the most operating system in which OpenVPN works, binary packages already compiled exist. Anyway, sometimes, above all for some Linux Distributions, you could need to build OpenVPN by starting with the source code. |
||
26 | |||
27 | Below, we describe how to build OpenVPN: |
||
28 | |||
29 | * Download the OpenVPN's source code from the site http://openvpn.net. Pick the latest stable release that is available (suppose the release 2.0.9 in the rest of this document); |
||
30 | * Extract the files which are stored in the zipped archive that you have downloaded by using the tar command in the following manner: |
||
31 | tar xvfz openvpn-2.0.9.tar.gz |
||
32 | * Change the current directory to openvpn-2.0.9 with the command: |
||
33 | cd openvpn-2.0.9 |
||
34 | * Check the system and produce the Makefiles by using the following command: |
||
35 | ./configure --prefix=/usr |
||
36 | |||
37 | If the ./configure procedure claims that the lzo libraries and headers are not found in the system, install the lzo compression software as follows below: |
||
38 | |||
39 | * Download the source package of LZO from the site http://www.oberhumer.com/ and extract its content with the command: |
||
40 | tar xvfz lzo-2.02.tar.gz |
||
41 | * Change the current directory to lzo-2.02 and install the LZO software with the commands: |
||
42 | ./configure |
||
43 | make |
||
44 | make install (This command needs to be executed with root privileges to write in /usr) |
||
45 | |||
46 | Once installed the lzo libraries and headers: |
||
47 | |||
48 | * Go back to the directory openvpn-2.0.9 and launch again the command: |
||
49 | ./configure --prefix=/usr |
||
50 | * Compile the source code with the Makefiles you have just created by using the command: |
||
51 | make |
||
52 | * Install the binary program openvpn and its manual pages with the command: |
||
53 | make install |
||
54 | |||
55 | Because the files will be written below the system directory /usr, the last command must be executed with root privileges. |