Type to search…
Skip to content

Wireguard

Wireguard provides confidentiality and authenticity between two IP addresses

Taught in
Planificació i administració de xarxesConnexió de xarxes privades a xarxes públiquesASIXSeguretat i alta disponibilitatAccés remotASIX

Introduction

Wireguard is an application that lets you create virtual private networks.

Create three virtual machines: box-1, box-2 and box-3 at Desktop.

The machines must be “Ubuntu 24.04 Server” with 2 CPU, 4 GB of RAM and an interface of the institute:

Connect to the box-1 machine with ssh!

https://isard.gitlab.io/isardvdi-docs/user/private_and_personal_networks/private_and_personal_networks.ca

Activate the enp3s0 interfaces with a fixed IP:

shell
box-1$ sudo ip addr add dev enp3s0 10.0.0.101/24
box-1$ sudo ip link set dev enp3s0 up

Do the same with box-2 (IP 10.0.0.102/24).

Verify that you can ping from box-1 to box-2:

shell
box-1$ ping 10.0.0.102
PING 10.0.0.102 (10.0.0.102) 56(84) bytes of data.
64 bytes from 10.0.0.102: icmp_seq=1 ttl=64 time=1.06 ms
64 bytes from 10.0.0.102: icmp_seq=2 ttl=64 time=1.09 ms
^C
--- 10.0.0.102 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 1.055/1.090/1.108/0.021 ms

The first step is to install WireGuard:

shell
box-1$ sudo apt update && sudo apt install -y wireguard

Interface

Wireguard integrates in a completely transparent way with the rest of the system’s elements because what it does is create virtual interfaces that externally work like any other physical interface.

Add a new interface using ip-link:

shell
box-1$ sudo ip link add dev wg0 type wireguard

Keep reading — it's free.

The rest of this page is open to anyone with a free account. Nothing is sold here and nothing is charged for: the account exists so we know who agreed to the terms, and so we can send you the newsletter if you want it.

Create a free account

You will be asked to accept the Terms · Privacy Policy