VPN with Wireguard (Ubuntu)

! HNE Eberswalde only provides instructions for Ubuntu as a common Linux distro!

The VPN is created, activated and deactivated entirely in the terminal.

Creating the VPN: 
# Install Wireguard
-$ sudo apt install wireguard

# Create a private and public key
-$ wg genkey | tee privatekey|wg pubkey > publickey

# Output the public key
-$ cat publickey

-----------------------------------------------------------------------------------------------------------------------------------------------------
Send your HNEE login name, the type of your device (laptop, PC) and the public key to support@hnee.de and 
wait for a reply with your configuration details.
-----------------------------------------------------------------------------------------------------------------------------------------------------

# Output the private key and copy it for the next step.
-$ cat privatekey

# Create a .conf file in the Wireguard folder and fill it out using the configuration data we sent you.
-$ sudo nano /etc/wireguard/wg0.conf

[Interface]
PrivateKey = "Deinen Privaten Schlüssel"
Address = "Von uns zugesendete IP Adresse"
DNS = 10.1.1.24, 10.1.1.5

[Peer]
PublicKey = vK/0hCkyTSIBk5nyin69Q3wdgrxzrruOw43Qj/thMy8=
AllowedIPs = 0.0.0.0/0
Endpoint = vpn.hnee.de:51820

# Save the file.

Start the VPN:
-$ wg-quick up wg0

Deactivate der VPN:
-$ wg-quick down wg0

Testing the VPN-Connection:
-$ sudo wg