Skip to main content
  1. Posts/

Remote Setup with EdgeVPN

·208 words·1 min·
System Administration

Last week I started using my old 13" laptop and left the bulky 15" workstation permanently at my desk. This setup gives me portability without loosing power when I’m connected to my home network. Today, I decided to configure EdgeVPN on both devices to also have this setup while on the road.

EdgeVPN makes use of tokens, to connect nodes to a network. Since I have a Nextcloud server, which keeps files in sync on both of my laptops. I decided to put the EdgeVPN configuration file there and created a small script that reads from it to generate the token, and decide which IP to give to each device, based on their hostname:

#!/bin/sh
TOKEN=$(cat /path/to/Nextcloud/edgevpn-config.yaml | base64 -w0)
IP=""
if [ "$(hostname)" = "zeno" ]; then
	IP="10.1.0.10"
elif [ "$(hostname)" = "seneca" ]; then
	IP="10.1.0.11"
fi

if [ "$IP" = "" ]; then
	echo "IP not configured for $(hostname)"
	exit 1
else
	echo Using IP: $IP
fi
edgevpn --token="$TOKEN" --address="$IP/24"

Plus I created systemd services so I can make use of systemctl instead of having to remember the name of that shell script

[Unit]
Description=EdgeVPN
Wants=network.target

[Service]
ExecStart=/path/to/start-edgevpn.sh

[Install]
WantedBy=multi-user.target

On any of the nodes, I can start EdgeVPN’s web UI and list all connected nodes

EdgeVPN API
Reply by Email

Related

Running Multiple Instances of a Service
·679 words·4 mins
System Administration

This article will teach you how to run one or more Redis instances on a Linux server using systemd to spawn copies of a service.

Deploying a Go Microservice in Kubernetes
·1427 words·7 mins
Application Development

Most of my experience with web applications is with monoliths deployed to a PaaS or using configuration management tools to traditional servers. Last week, I submerged myself in a different paradigm, the one of microservices. In this post, I’m going to share what I learned by deploying a Go application on top of Kubernetes.