Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

How to setup Wireguard VPN client in Ubuntu

Index:
1. Download and Configure Wireguard VPN
2. Connect to Wireguard VPN
3. How To access Library Resources from Wireguard VPN
4. How To Disconnect from Wireguard VPN

Download and Configure Wireguard VPN


1. Install Wireguard

Ubuntu ≥ 19.10 [module – v0.0.20200318 & tools –


v1.0.20200319]
$ sudo apt install wireguard
$ sudo reboot

OR

Ubuntu ≤ 19.04 [module – v0.0.20200318 & tools –


v1.0.20200319]
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard resolvconf

$ sudo reboot

2. Once installed you will need to create the key pair as well:

Shift to root# sudo su


root# mkdir -p /etc/wireguard/keys
root# cd /etc/wireguard/keys
root# umask 077
root# wg genkey | tee privatekey | wg pubkey > publickey
Note: Keep your PrivateKey safe and secure. Don’t share Your Private
key with anyone.

3. Copy and Share your PublicKey to the IT administrator (IITH VPN


Access Form)

View your public key:


root$ cat /etc/wireguard/keys/publickey

4. After submitting the IITH VPN Access Form, your IT administrator


will send you the following via email.
a. Your VPN Static IP address ex: 10.10.xx.xx/zz
b. IITH VPN PublicKey:
oAhOjd1HLCgUYZ1pxEoOqFae1a7R8y/ezpYsJtIt3x8=

5. Once you receive static ip from the administrator, create a


configuration file

root$ vi /etc/wireguard/wg0.conf

[Interface]
PrivateKey = <private key of the client>
Address = <Static IP address provided to you>/20
DNS = 192.168.36.53

[Peer]
PublicKey = <public key of IITH VPN Server>
AllowedIPs = 10.10.16.0/20, 192.168.0.0/16
Endpoint = wgvpn.iith.ac.in:51820
PersistentKeepalive = 25

Example:

View your privatekey key:


root$ cat /etc/wireguard/keys/privatekey
Connect to Wireguard VPN
6. Type the below command to connect to Wireguard VPN.

Example:
# sudo wg-quick up wg0

Check status of VPN

# sudo wg show
How To access Library Resources from Wireguard VPN
To Access Library resources, set proxy IP “192.168.35.5” and port
“3128” in browser settings.

Example: How to Turn on proxy setting

1. Open the Firefox Menu and select Options

2. In the Options window, click on the General


3. Go to the Network Tab
4. In the Connection section click the Settings button
5. In the Connection Settings window select 'Manual proxy configuration URL' and
enter the address
HTTP Proxy: 192.168.35.5 Port: 3128
Tick on “Also use this proxy for FTP and HTTPS”

6. Click on the OK button and close the window.


7. Test by opening any Journal website such as IEEE Xplore, ScienceDirect etc in
Firefox browser.
If you are not accessing Library E-Resources, please Turn off
proxy.

Example: How to Turn off proxy setting

1. Open the Firefox Menu and select Options

2. In the Options window, click on the General


3. Go to the Network Tab
4. In the Connection section click the Settings button
5. In the Connection Settings window select 'No Proxy' and enter the address

6. Click on the OK button and close the window.


How To Disconnect from Wireguard VPN

1. Type the below command as to disconnect from Wireguard VPN

# sudo wg-quick down wg0

2. After Disconnecting, if you have set any proxy setting in the browser, Turn off the
proxy.

Example: How to Turn off proxy setting


a. Open the Firefox Menu and select Options

b. In the Options window, click on the General


c. Go to the Network Tab
d. In the Connection section click the Settings button
e. In the Connection Settings window select 'No Proxy' and enter the
address

f. Click on the OK button and close the window.

You might also like