Difference between revisions of "OpenVPN"

From ITSwiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
(Windows)
Line 1: Line 1:
 +
<div style="background-color: #FFFF00; border-style: dotted;"> This guide is for users at '''DTU Compute''' only</div>
 +
 +
 +
 
=OpenVPN for users with an account at DTU Compute=
 
=OpenVPN for users with an account at DTU Compute=
  

Revision as of 17:59, 18 May 2022

This guide is for users at DTU Compute only


OpenVPN for users with an account at DTU Compute

Download certificate

Visit https://openvpn.compute.dtu.dk and use your DTU initials to log in.

Here you will be presented with two options:

Download old: should be used if you would like to redownload your existing certificate. E.g. if you would like to put it on multiple computers.

Download new: should be used if don't already have a certificate or if you would like to block your previous certificate (revoke your old certificate) and get a new certificate.

Linux

Connecting using commandline

unzip openvpn-mttj-2372ce1bea8340915a4129952a25a2d3235197d0.zip
cd openvpn-mttj/Linux
sudo openvpn --config client.conf

Connecting using GUI

Note: For the Gnome Desktop (Ubuntu / Pop_OS! / Fedora) install this package first:

network-manager-openvpn-gnome

Add a new connection

  • Open Network Settings
  • Add a VPN connection
  • Select OpenVPN


OpenVPN settings values

Gateway openvpn.compute.dtu.dk
Type Password with Certificates (TLS)
Username Your DTU Compute username
Password Your DTU Compute password
CA certificate ca.crt
User Certificate abcd--20120305133738.crt
User private key abcd--20120305133738.key
User key password Your DTU Compute password
Data compression (Advanced) LZO

Openvpn-settings1.png

Openvpn-settings2.png

Openvpn-settings3.png

Verify VPN connection is working

ssh your_username_here@serv1.compute.dtu.dk
echo $SSH_CLIENT

If the return IP address is

130.225.68.58 54448 22

then the VPN connection is working, and you can now exit the SSH connection. The second value (54448) may differ.

Or your can test that the VPN connection is working by opening a Nautilus window. Press CTRL-L and type

smb://nas1.compute.dtu.dk

You will be prompted for:

Username: Enter the username that works for SunRay terminals and DTU Compute's Linux servers
Domain: win
Password: your password

If success you will be able to see several shares.

Windows

  • Run the setup and follow the installation steps (default installation - no need to change options). Confirm the Windows security messages.

Notice the two options on the site:

"Download old": You have already other devices using your Compute OpenVPN certificate, and need to setup a new device with the same certificate and configuration.

"Download new": This will create a new certificate. Earlier certificates will not work anymore. If you have other devices using Compute OpenVPN, you must update the configuration with these files.


  • Unpack the downloaded cert.zip file. You will find 3 folders - go to the "Windows" folder, and copy all files to the OpenVPN configuration folder (By default C:/Program Files/OpenVPN/config/). Confirm the Windows security messages.
  • Right-click on the OpenVPN desktop icon. Click on "Settings" and go to the tab "Compatibility". Check "Run the program as administrator".
  • Start OpenVPN and in the task tray, either right-click and choose "Connect" or just double-click the task tray icon. In the login-box use DTU credentials.


openvpn-windows.png


Verify VPN connection is working

Type:

\\nas1.compute.dtu.dk

as the location in a window. If you see several shares, then the VPN connection is working.

If you want to access your private home directory, then type

\\nas1.compute.dtu.dk\home\your_username_here
or
\\nas1.compute.dtu.dk\winhome\your_username_here

Note: When prompted for a username/password, the username in that particular box must be prefixed with WIN\ (e.g. "WIN\abcd")

Mac (tested on 10.12.3)

Install Tunnelblick 3.7.0 (build 4790) from http://tunnelblick.net (Tunnelblick is free software: you can redistribute it and/or modify it under the terms of the |GNU General Public License version 2 as published by the |Free Software Foundation.)

PLEASE NOTE THE HOMEPAGE - They are pretty good at telling you what version to download/install - - - - - - - > - - - - > - - - -
alt text

Once installed - follow the Tunnelblick guides on How To Add a Configuration.

Start with downloading a Certificat here https://openvpn.compute.dtu.dk

Authentification.jpg

Once authentificated, download the zipped certificate

Download_new.jpg

Once downloaded, unzip it to any folder. THEN you are back info the Tunnelblick-guide on how-to-create-a-connection, and NOW you have the configuration files.

Place them in the opened folder, and you are ready.

Click on Tunnelblick icon in top bar and connect using your DTU login.

unzipped_and_moved.jpg

ps - you might want to rename the connection just created - "client" is not a very good name, but you cannot do this while connected.

Test your connection: use Finder - chose Go - ConnectToServer: smb://nas1.compute.dtu.dk

You will be prompted for:

Username: Enter the same username that works for SunRay terminals and DTU Compute's Linux servers
Domain: win
Password: your password

If success you will be able to see several shares. If you should do anything wrong - or a new cetificate should be issued, just delete the connection and create a new one with the proper certificate etc.

Android

VPN will give you a VPN connection to DTU Compute's network. If you install apps for it, it can give you access to your files on the fileserver nas1.compute.dtu.dk with i.e. ES File Explorer or remote desktop access to a PC connected to DTU Compute's network, but it will not enable you to print to DTU Compute's printers (unless you find an app which can communicate with a CUPS printserver).

For Android 4 and 5 you can use The app OpenVPN Connect

  • From a PC Connect to: https://openvpn.compute.dtu.dk and authenticate using DTUlogin. Click the Download link.
  • Unpack the zip file and open the Windows folder
  • Unpack the certs.zip file and copy the contents to your phone, you can use a cable - in the example they where copied to /sdcard0/Download. For Android 4.4 you need to enable 'display advanced devices' to access the folder.

Example setup with OpenVPN Connect:

Profile Name: Compute

Server Address: openvpn.compute.dtu.dk

Choose the certificates:

/storage/sdcard0/Download/client.openvpn

Username <your DTU windows login>

Password <enter your password>

Android versions before 4.0

The app FEAT VPN can be used for Android versions before 4.0. It does not require root and works with openvpn.
There is a free Lite version, which can run 1 hour a day and a paid version without limits which costs about 25 kr.

To set it up:

Known problems: If you change between different wireless networks or between phone network and wireless, you may have to stop and start the service.