Wiki source code of VPN Access

Version 7.1 by Thomas Coelho (local) on 2025/10/28 12:08

Hide last authors
Thomas Coelho 1.1 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
Thomas Coelho (local) 3.1 5 {{warning}}
Thomas Coelho (local) 6.2 6 Work in progress.
Thomas Coelho (local) 3.1 7 {{/warning}}
Thomas Coelho 1.1 8
9 To get full access to our network from external locations we provide a VPN access based on openVPN. This is free software and part of every Linux distribution. The following guide has been tested with Ubuntu.
10
11 For Linux we recommend the graphical configuration with ~[~[VPN with Networkmanager]].
12
13 It is available for Windows and MacOS too.
14
15
16 This article shows you how to log into our VPN network without using the terminal. This method is by far more convenient and you also may find this helpful if you are not very familiar with command lines.
17 We will use a VPN Plugin called network-manager.
18
19 === Installation ===
20
21 Open up a terminal of your choice (Ctrl + T) and install OpenVPN Network Manager by typing the following line:
22
Thomas Coelho (local) 6.1 23 {{code}}
24 sudo apt-get install network-manager-openvpn-gnome
25 {{/code}}
Thomas Coelho 1.1 26
27 Please enter your password to confirm the installation.
28
29 After the successful installation NetworkManager must be restartet:
30
Thomas Coelho (local) 6.1 31 {{code}}
32 sudo service network-manager restart
33 {{/code}}
Thomas Coelho 1.1 34
Thomas Coelho (local) 4.2 35 Again, confirm with your password if necessary.
Thomas Coelho 1.1 36
Thomas Coelho (local) 4.2 37 == Getting Started ==
38
Thomas Coelho 1.1 39 To get VPN access you must set up a new VPN connection first. Click on the two arrow symbol (or the WiFi symbol - depending on which connection you are currently using) in the top right corner.
Thomas Coelho (local) 4.2 40
41 * Now choose Connections ->  Configure VPN....
42 A new window will open up.
Thomas Coelho 1.1 43 ~: Click on <code>Add</code> to add a new connection. <br>
44 You will be asked for the connection type.
45 ~: Choose <code>OpenVPN</code> and click on <code>Create...</code>.
46 If in the top right corner the option <code>VPN Connections</code> does not exist, the open the normal settings and add a new openvpn connection in <code>Network</code>.
47
48 Next you need to edit and configure your connection. Choose any connection name (e.g. itp_openvpn). <br>
49
50 For the '''Gateway''' type:
51 vgw.itp.uni-frankfurt.de
52
53 Under '''Authentication''' select <code>Password</code> as authentication type. Enter your user name and password and choose the CA Certificate 'private-ca-itp.crt'. It can be downloaded [http:~/~/th.physik.uni-frankfurt.de/~~thw/vpn/private-ca-itp.crt here].
54
55 Your new VPN connection will be listet in '''Network Connections'''.
56
Thomas Coelho (local) 6.1 57 [[image:Bildschirmfoto vom 2025-10-28 11-50-07.png||alt="VPN Configuration Dialog" height="384" width="600"]]
Thomas Coelho (local) 4.2 58
Thomas Coelho (local) 6.1 59 === Using a VPN Connection ===
60
61
Thomas Coelho 1.1 62 To access a VPN network just click on the arrow or WiFi symbol on the top right corner. Your configured connection should be found under '''VPN Connections'''.
63
64
65 == OpenVPN from the command line ==
66
67 ~=== Install OpenVPN ===
68
69 It is not part of the default installation, but can easily installed using apt. Enter the following commands:
70
71 sudo apt install openvpn
72
73 This requires to enter your password to get super user privileges.
74
75 ~=== Command line configuration ===
76
77 We have setup a new VPN gateway. Please use this configuration and report problems.
78
79 This configuration routes all traffic trough ITP. This is useful if you want to download papers, which are restricted to the university network.
80 The second examples only routes the traffic going directly to the ITP trough the VPN and leaves your default gateway untouched. The only difference is the missing 'redirect-gateway' statement [http:~/~/th.physik.uni-frankfurt.de/~~thw/vpn/all-via-itp.ovpn]
81
82 <pre>
83 client
84 dev tun
85 proto udp
86 nobind
87 remote vgw.itp.uni-frankfurt.de
88 verify-x509-name vgw.itp.uni-frankfurt.de name
89 remote-cert-tls server
90 resolv-retry infinite
91 auth-user-pass
92 ca private-ca-itp.crt
93 # Comment this, if you don't want to redirect the default gateway
94 redirect-gateway def1             
95 </pre>
96
97 Download our CA (Certificate of Authority) [http:~/~/th.physik.uni-frankfurt.de/~~thw/vpn/private-ca-itp.crt] and store it in the same place. This file is needed for the verification of the authenticity of the server.
98
99 For only accessing internal services and routing your the normal traffic to your normal uplink use the following configuration: [http:~/~/th.physik.uni-frankfurt.de/~~thw/vpn/itp.ovpn]
100
101 <pre>
102 client
103 dev tun
104 proto udp
105 nobind
106 remote vgw.itp.uni-frankfurt.de
107 verify-x509-name vgw.itp.uni-frankfurt.de name
108 remote-cert-tls server
109 resolv-retry infinite
110 auth-user-pass
111 ca private-ca-itp.crt
112 </pre>
113
114
115 ~=== Start the VPN connection ===
116
117 Open a terminal and change to the path where the vpn config file is stored. Start the connection with
valad 2.2 118 \\ sudo openvpn itp.ovpn
Thomas Coelho 1.1 119
120 where itp.ovpn is the name of the config file. openvpn needs root access, therefore you must enter your local password for sudo. After this you have to enter your ITP credentials (Username and Password).
121
122 If everything went fine the output will look like:
123
124 <pre>
125 Fri Dec  7 15:03:00 2012 WARNING: Make sure you understand the semantics of ~-~-tls-remote before using it (see the man page).
126 Fri Dec  7 15:03:00 2012 NOTE: OpenVPN 2.1 requires '~-~-script-security 2' or higher to call user-defined scripts or executables
127 Fri Dec  7 15:03:00 2012 UDPv4 link local: [undef]
128 Fri Dec  7 15:03:00 2012 UDPv4 link remote: [AF_INET]141.2.246.2:1194
129 Fri Dec  7 15:03:00 2012 WARNING: this configuration may cache passwords in memory ~-~- use the auth-nocache option to prevent this
130 Fri Dec  7 15:03:00 2012 [FIAS-ITP_Generic_VPN_Service] Peer Connection Initiated with [AF_INET]141.2.246.2:1194
131 Fri Dec  7 15:03:02 2012 TUN/TAP device tap0 opened
132 Fri Dec  7 15:03:02 2012 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
133 Fri Dec  7 15:03:02 2012 /sbin/ifconfig tap0 10.63.131.1 netmask 255.255.0.0 mtu 1500 broadcast 10.63.255.255
134 Fri Dec  7 15:03:02 2012 Initialization Sequence Completed
135 </pre>
136
137 Termiate the session by pressing Ctrl-C in this terminal.
138
valad 2.2 139 == OpenVPN for Windows 10 ==
Thomas Coelho 1.1 140
valad 2.2 141 At the time of writing, you can download OpenVPN on '[[https:~~/~~/openvpn.net/community-downloads/>>https://openvpn.net/community-downloads/]]'.
Thomas Coelho 1.1 142 Download the exe-file for Windows 10 and install OpenVPN.
143 Start 'OpenVPN GUI'. You will get a message that no config file was found. But starting 'OpenVPN GUI' creates a directory to put the config files into.
144
valad 2.3 145 Next you need to download our [[CA (Certificate of Authority)>>http://th.physik.uni-frankfurt.de/~~thw/vpn/private-ca-itp.crt]] [http:~/~/th.physik.uni-frankfurt.de/~~thw/vpn/private-ca-itp.crt] and the [[config file>>http://th.physik.uni-frankfurt.de/~~thw/vpn/all-via-itp.ovpn]] [http:~/~/th.physik.uni-frankfurt.de/~~thw/vpn/all-via-itp.ovpn].
Thomas Coelho 1.1 146
147 Some Browsers, depending on the download method, save some of these files as standard text files '.txt'. If this happens, you need to rename them to 'private-ca-itp.crt' and 'all-via-itp.ovpn'. With standard configuration Windows 10 does not show the endings of the file names. The endings are correct if for 'all-via-itp.ovpn' the file type is shown as 'OpenVPN Config' and  for 'private-ca-itp.crt' as 'Sicherheitszertifikat' or 'security certificate'.
148
149 You need to copy/save both files to C:/Users/'yourusername'/OpenVPN/config/, where 'yourusername' is your local username. In the picture below, the directory with the two needed files in it for a german Windows 10 is shown (for the username 'user'). (For both is assumed that 'C' is, as for most Windows systems, your main hard drive.)
150
151 ~[~[File:Openvpn-win10-1.png|center]]
152
153 If 'OpenVPN GUI' is started, you can find it in the lower right corner where the minisymbols are. Most likely you need to click on the small arrow first. It is the symbol with the computer screen and the lock symbol. Right click on the symbol and you get a menu where the first option is to connect. Click this option. This menu has less entries if the settings are not found. Then control the previous step.
154
155 ~[~[File:Openvpn-win10-2.png|center]]
156
157 After a few seconds you should get a login screen where you use the credentials of your itp account.
158
159 ~[~[File:Openvpn-win10-3.png|center]]
160
161 The login takes a few seconds. Your connection was successful if no error window occurs and now the symbol in the lower right is green.
162
163 ~[~[File:Openvpn-win10-4.png|center]]
164
165 ~==MacOS (tunnelblick)==
166
167 First download the itp certificate [http:~/~/th.physik.uni-frankfurt.de/~~thw/vpn/private-ca-itp.crt] and configuration file [http:~/~/th.physik.uni-frankfurt.de/~~thw/vpn/all-via-itp.ovpn]. If a '.txt' was added to the configuration file name, remove the ending '.txt'. At the end the two files should normally be namend 'private-ca-itp.crt' and 'all-via-itp.ovpn'.
168
169 Download the last stable release of the software tunnelblick [https:~/~/tunnelblick.net/downloads.html] and execute the dowloaded file.
170
171 ~[~[File:Tunnelblick1.png|center|750px]]
172
173 After completion of the installation, a new icon appears in the top bar. Drag and drop the downloaded configuration file to this new icon to add the configuration to tunnelblick. Most likely you do not need to add the certificate manually (it was enough to download it and is handled automatically). Alternatively double-clicking the .ovpn file will also start the import. Both files are copied to system. The original files are no longer referred.
174
175 ~[~[File:Tunnelblick2.png|center|750px]]
176
177 Open the settings page, like shown in the screenshot below and make sure the Default Route Option is selected. This option is ignored from the ovpn configuration.
178
179 ~[~[File:Ovpn_settings_default_route.jpg|center|750px]]
180
181 Now you can connect to the itp vpn via the new tunnelblick icon.
182
183 If something fails look into the log of the connection. It also includes multiple times the path to place where the configuration file (tunnelblick automatically renames it into 'config.ovpn') and the certificate are stored. The exact path varies depending on your previous choice to use the configuration just for the  current user or for all users.
184
185 ~[~[File:Tunnelblick3.png|center|750px]]
186
187 In this case the configuration file and the certificate are located in '/Library/Application Support/Tunnelblick/Shared/all-via-itp.tblk/Contents/Resources'. If you need to edit or replace the configuration file or the certificate, this can be done in this directory. If there is just the configuration file in the directory, then copy the certificate to the in the log mentioned directory.
188
189 ~==Problems changing the vpn settings in tunnelblick (macOS)==
190
191 There were problems reported when switching in tunnelblick from the old vpn (vpn.th.physik.uni-frankfurt.de with tap) to the new one (vgw.itp.uni-frankfurt.de with tun). You also have this problem if, after applying the new configuration file itp.ovpn, the vpn does not work and the output contains a line containing 'vpn.th.physik.uni-frankfurt.de'. Search the output for a line beginning with '~-~-config' and ending on '.ovpn'. This line specifies which configuration file (.ovpn) is used to establish the vpn connection and where it is located. Edit this file to have the same content as the itp.ovpn [http:~/~/th.physik.uni-frankfurt.de/~~thw/vpn/itp.ovpn] (most likely the lines 2, 5 and 6 need to be edited).
192
193 ~==Warning in tunnelblick (macOS)==
194 If you get the following warning, you can check the box and click OK.
195 ~[~[File:Tb-warn.png|center|500px]]
196
197 ~== Replacing the CA Certificate in macOS ==
198
199 When importing the configuration, the crt file is copied to somewhere in the system (see above). If you replace the crt file in your download or whatever folder it will not be used. The simpliest way to fix this is to delete the configuration from Tunnelblick and reimport it. Make sure the option "Route all traffic through the VPN" is checked (see instrcutions above).
200
201 This is needed after the replacment of the CA certificate in Nov 2020. This lives for 5 years. Next replacment will be in 2025, if we are still using openVPN then.
202
203