Wednesday, July 5, 2023

Using wireguard vpn client on ubuntu

Wireguard is an extremely simple yet fast and modern VPN that utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPsec, while avoiding the massive headache. It intends to be considerably more performant than OpenVPN.


To use wireguard as a client, first, we need to get the wireguard configuration file from the provider. It will come with .conf naming convention.

Once we have that, we need to install wireguard package together with resolvconf
$ sudo apt install wireguard resolvconf -y

Then, put the wireguard configuration file into /etc/wireguard
$ sudo mv mywireguard.conf /etc/wireguard

We are now able to use wireguard and connect to the wireguard server. Use below command to setup wireguard  interface using the above configuration
$ sudo wg-quick up mywireguard

An interface will be created with the same name
$ sudo ip link dev show mywireguard
8: mywireguard: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/none

We should now be able to connect to any host inside the wireguard server's network.

To turn off wireguard, simply use below command
$ sudo wg-quick down mywireguard

No comments: