1) Install WireGuard
sudo apt update sudo apt install -y wireguard resolvconf
create root user if not exist
2) Create keys (client side)
su sudo mkdir -p /etc/wireguard && cd /etc/wireguard umask 077 wg genkey | tee client_private.key | wg pubkey > client_public.key
Show them if needed:
cat /etc/wireguard/client_public.key cat /etc/wireguard/client_private.key
3) Collect server details (from your VPN server admin)
Server public key (e.g., SERVER_PUBLIC_KEY=...)
Server endpoint (public IP or DNS) and port (you’ve been using 9595/UDP)
VPN subnet (example: 10.10.0.0/24) and your client address (e.g., 10.10.0.2/24)
(Optional) PreSharedKey if your server uses one.
4) Create the client config /etc/wireguard/wg0.conf
Template (split-tunnel to reach only VPN networks & SCADA via VPN):
[Interface] PrivateKey = REPLACE_WITH_CONTENTS_OF_/etc/wireguard/client_private.key Address = 10.10.0.2/24 DNS = 1.1.1.1
Optional: slightly lower MTU helps on some networks
MTU = 1380
Don’t auto-overwrite this file
SaveConfig = false
[Peer] PublicKey = REPLACE_WITH_SERVER_PUBLIC_KEY
If you have one from the server:
PresharedKey = REPLACE_WITH_PRESHAREDKEY
(portal.gess-sweden.com:9595)
Endpoint = YOUR_SERVER_PUBLIC_IP_OR_DNS:9595
Split tunnel: send only VPN subnet(s) and SCADA LAN via the tunnel.
Add your SCADA LAN(s) below if you need to reach them (examples shown):
AllowedIPs = 10.10.0.0/24, 192.168.50.0/24, 10.20.0.0/16
Keeps NAT pinhole open so the server can reach you
PersistentKeepalive = 25
If you want a full-tunnel (all traffic through VPN):
AllowedIPs = 0.0.0.0/0, ::/0
5) Bring it up & enable on boot
sudo wg-quick up wg0 sudo systemctl enable wg-quick@wg0
6) Verify it’s working
ip a show wg0 wg show ping -c 3 10.10.0.1 # (or the server’s wg IP)