Difference between revisions of "VPN Access"

From IT Service Wiki
Jump to: navigation, search
Line 1: Line 1:
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 12.04 to 18.04. It is available for Windows and MacOS too.
+
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 12.04 to 19.10.  
 +
 
 +
If you prefer a graphical configuration, we recommend the Networkmanager based setup:
 +
 
 +
It is available for Windows and MacOS too.
  
 
=== Install OpenVPN ===  
 
=== Install OpenVPN ===  
Line 13: Line 17:
 
We have setup a new VPN gateway. Please use this configuration and report problems.
 
We have setup a new VPN gateway. Please use this configuration and report problems.
  
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.
+
This configuration routes all traffic trough ITP. This is useful if you want to download papers, which are restricted to the university network.
 +
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/itp.vpn]
  
 
<pre>
 
<pre>
Line 30: Line 35:
 
</pre>
 
</pre>
  
This configuration routes all traffic trough ITP. This is useful if you want to download papers, which are restricted to the university network.
+
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.
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' statment [http://th.physik.uni-frankfurt.de/~thw/vpn/itp.vpn
 
  
 +
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.vpn]
  
 
<pre>
 
<pre>
Line 71: Line 76:
  
 
This configuration routes all traffic trough ITP. This is useful if you want to download papers, which are restricted to the university network.
 
This configuration routes all traffic trough ITP. This is useful if you want to download papers, which are restricted to the university network.
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' statment [http://th.physik.uni-frankfurt.de/~thw/vpn/itp.vpn].
+
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' staetment.
  
 
<pre>
 
<pre>
Line 111: Line 116:
  
 
Termiate the session by pressing Ctrl-C in this terminal.
 
Termiate the session by pressing Ctrl-C in this terminal.
 
=== Hacking around firewalls ===
 
 
If you have problems with firewalls, we provide some other ports and protocols to circumvent these firewalls
 
 
{|border="1"
 
|-
 
!Proto
 
!Port
 
|-
 
| tcp
 
| 1194
 
|-
 
|tcp
 
| 80
 
|-
 
|udp
 
|53
 
|}
 

Revision as of 10:08, 17 February 2020

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 12.04 to 19.10.

If you prefer a graphical configuration, we recommend the Networkmanager based setup:

It is available for Windows and MacOS too.

Install OpenVPN

It is not part of the default installation, but can easily installed using apt. Enter the following commands:

 sudo apt-get install openvpn

This requires to enter your password to get super user privileges.

Command line configuration

We have setup a new VPN gateway. Please use this configuration and report problems.

This configuration routes all traffic trough ITP. This is useful if you want to download papers, which are restricted to the university network. 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 [1]

client
dev tun
proto udp
nobind
remote vgw.itp.uni-frankfurt.de
verify-x509-name vgw.itp.uni-frankfurt.de name
remote-cert-tls server
resolv-retry infinite
auth-user-pass
ca private-ca-itp.crt
# Comment this, if you don't want to redirect the default gateway
redirect-gateway def1               

Download our CA (Certificate of Authority) [2] and store it in the same place. This file is needed for the verification of the authenticity of the server.

For only accessing internal services and routing your the normal traffic to your normal uplink use the following configuration: [3]

client
dev tun
proto udp
nobind
remote vgw.itp.uni-frankfurt.de
verify-x509-name vgw.itp.uni-frankfurt.de name
remote-cert-tls server
resolv-retry infinite
auth-user-pass
ca private-ca-itp.crt


Previous VPN gateway (deperecated)

This is the old configuration, which will be retire in a few weeks. Please prefer the new setup.

This is fast and easy but requires to enter commands. Create or download [4] the config file and store it anywhere you like:

client
dev tap
proto udp
nobind
remote vpn.th.physik.uni-frankfurt.de
verify-x509-name vpn.th.physik.uni-frankfurt.de name
remote-cert-tls server
resolv-retry infinite
auth-user-pass
ca private-ca-itp.crt
redirect-gateway def1                       

Download our CA (Certificate of Authority) [5] and store it in the same place. This file is needed for the verification of the authenticity of the server.

This configuration routes all traffic trough ITP. This is useful if you want to download papers, which are restricted to the university network. 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' staetment.


client
dev tap
proto udp
nobind
remote vpn.th.physik.uni-frankfurt.de
verify-x509-name vpn.th.physik.uni-frankfurt.de name
remote-cert-tls server
resolv-retry infinite
auth-user-pass
ca private-ca-itp.crt

Start the VPN connection

Open a terminal and change to the path where the vpn config file is stored. Start the connection with

 sudo openvpn itp.ovpn

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).

If everything went fine the output will look like:

Fri Dec  7 15:03:00 2012 WARNING: Make sure you understand the semantics of --tls-remote before using it (see the man page).
Fri Dec  7 15:03:00 2012 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Fri Dec  7 15:03:00 2012 UDPv4 link local: [undef]
Fri Dec  7 15:03:00 2012 UDPv4 link remote: [AF_INET]141.2.246.2:1194
Fri Dec  7 15:03:00 2012 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Fri Dec  7 15:03:00 2012 [FIAS-ITP_Generic_VPN_Service] Peer Connection Initiated with [AF_INET]141.2.246.2:1194
Fri Dec  7 15:03:02 2012 TUN/TAP device tap0 opened
Fri Dec  7 15:03:02 2012 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
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
Fri Dec  7 15:03:02 2012 Initialization Sequence Completed

Termiate the session by pressing Ctrl-C in this terminal.