Back to: The Accidental Platform  ·  flowformlab.com

🛡️ Self-Hosted VPN Hub — Technical Reference

FlowForm Consulting  |  Infrastructure Documentation
Updated: 2026-06-06 OCI Always Free · Zero Cost Public Reference
ℹ️ This document describes the architecture of a self-hosted VPN hub built on Oracle Cloud Infrastructure (OCI) Always Free tier. Internal IPs, credentials, hostnames, and identifying details have been removed. Companion article: The Accidental Platform →
🗺️ Network Topology
OCI VPN Hybrid Topology — WireGuard (full Internet) + L2TP (Internal only)
OCI VPN Hybrid Topology · WireGuard (full tunnel) + L2TP (site-to-site, internal only)
WireGuard provides full-tunnel internet access for roaming devices. L2TP/IPSec connects Site A and Site B for internal resource access only — no internet traffic routes through OCI for site clients. Cross-VPN routing between WireGuard and L2TP clients is permitted via the OCI VM.
📋 Overview

A lightweight always-on VPN hub running on a single OCI Always Free VM, providing:

All services run at zero cost on OCI Always Free tier.
🖥️ VM Specification
1
OCPU (AMD EPYC)
954 MB
RAM
2 GB
Swap
45 GB
Boot Volume
~1%
Typical CPU Load
Ubuntu
24.04 LTS
ItemValue
ProviderOracle Cloud Infrastructure (OCI) Always Free
ShapeVM.Standard.E2.1.Micro
OSUbuntu 24.04.4 LTS
Kernel6.17.0-oracle (x86_64)
vCPUs2 (hyperthreaded, 1 OCPU)
Typical idle~97%
🌐 Network Architecture
Internet │ ┌────────────┴────────────┐ │ │ Site A ISP (Fixed) Site B ISP (4G) │ │ Site A Router Site B Router (MikroTik hEX) (MikroTik hAP lite) │ │ │ L2TP/IPSec │ L2TP/IPSec │ (internal only) │ (internal only) └──────────┬──────────────┘ │ OCI VPN Hub (Singapore region) │ ┌────┴────┐ │ │ WireGuard Internal Clients Services (all traffic (Password vault, via OCI) Accounting, Docs, DNS)
  • Site A and Site B LAN devices use their own ISP for internet — L2TP tunnels are for internal resource access only
  • WireGuard clients route all traffic through OCI (Singapore), giving them a Singapore egress IP
🔒 VPN Stack

⚡ WireGuard — Remote Access

  • Full-tunnel configuration (all traffic via OCI)
  • Internal DNS (AdGuard Home) pushed to each peer
  • Peers created and removed via Telegram bot commands
  • QR code generated automatically for mobile onboarding
  • Peer handshake monitoring — alert sent if handshake goes stale

🔗 L2TP/IPSec — Site-to-Site

  • StrongSwan (OCI) ↔ MikroTik (each site)
  • AES-256/SHA-256 encryption
  • Per-site LAN routes installed automatically via PPP ip-up hook
  • LAN clients reach internal services without any VPN client installed
  • Tunnels can be toggled on/off via Telegram command
👥 WireGuard Peers

5 active peers across personal devices. All peers use full-tunnel mode with internal DNS and persistent keepalive.

📱 Smartphone
Android · personal device
📱 Smartphone
Android · personal device
💻 Laptop
Windows · personal device
🖥️ Desktop PC
Windows · home device
📟 Tablet
Android · personal device

TypeOSTunnel ModeDNS
Smartphone (×2)AndroidFull tunnel (0.0.0.0/0)Internal (AdGuard Home)
LaptopWindowsFull tunnel (0.0.0.0/0)Internal (AdGuard Home)
Desktop PCWindowsFull tunnel (0.0.0.0/0)Internal (AdGuard Home)
TabletAndroidFull tunnel (0.0.0.0/0)Internal (AdGuard Home)
⚙️ Services
ServiceTechnologyPurpose
WireGuard VPNWireGuardRemote device access — full tunnel
Site-to-Site VPNL2TP/IPSec (StrongSwan + xl2tpd)Site interconnect — internal only
Password ManagerKeePass + Apache WebDAV + HTTPSSelf-hosted vault sync, no device limits
AccountingGnuCash + PostgreSQL 16Self-hosted personal finance
DNSAdGuard HomeInternal DNS + ad/tracker blocking
MonitoringBash scripts + Telegram botsReal-time alerts, 20+ scripts
DocumentationApache + Marked.jsInternal docs portal
Backupsrclone + DropboxOffsite backup for all critical data
🔍 DNS Design

All internal services use a .vpn namespace resolved by AdGuard Home (WireGuard peers) and MikroTik static DNS (site LAN clients). No split DNS required — all clients use the same hostnames regardless of connection method.

HostnameService
keepass.vpnPassword vault (WebDAV)
gnucash.vpnAccounting database (PostgreSQL)
document.vpnInternal documentation portal
monitor.vpnMonitoring dashboard
🔐 Security Design
LayerApproach
WireGuardModern cryptography (Curve25519, ChaCha20, Poly1305) — no exposed surface when idle
L2TP/IPSecEncrypted tunnel, PSK authentication
Password VaultDigest authentication + TLS, IP-based access control restricted to VPN subnets
PostgreSQLBound to VPN interface only — not exposed publicly, subnet restrictions via pg_hba.conf
AdGuard HomeInternal interface only — no public exposure
FirewallOCI Security List (cloud layer) + UFW/iptables (VM layer) — double-gated
All servicesBound to VPN interface — not reachable from public internet
BackupsEncrypted at rest on Dropbox
💾 Backup Strategy

All backup scripts run via cron. Dropbox sync via rclone. No manual steps required.

DataLocal RetentionOffsite
Accounting database30 days (daily dumps)Dropbox — daily overwrite + biweekly dated archive (~6 months)
Password vault30 daysDropbox — latest overwrite
WireGuard config30 daysDropbox — latest overwrite
Scripts30 daysGitHub (versioned history)
Infrastructure docsN/AGitHub (versioned history)
🔔 Monitoring & Alerts

All monitoring is Telegram-based — no external monitoring service required.

OCI NODE ALERTS
WireGuard peer up/down
Handshake check every 15s
⚠️
Long VPN session (>2h)
Re-alert every 1 hour
🔓
Password vault opened/saved
Apache access log pipe
🐘
Accounting session opened/closed
PostgreSQL pg_stat_activity polling
🚨
Service health failure
Every 5 minutes
📊
Bandwidth warning / critical
Hourly threshold checks
📅
Daily traffic summary
07:00 UTC — per-interface breakdown
📆
Monthly traffic report
1st of month
SITE ROUTER ALERTS (BOTH SITES)
💬 Remote Management (Telegram)

All three nodes are controllable via a shared Telegram group:

NodeCommands
OCI HubWireGuard peer add/remove/enable/disable, L2TP control, manual documentation sync
Site AFull system status, L2TP control, per-device internet block/unblock
Site BFull system status, L2TP control, reboot
🔧 Site Routers (MikroTik)
ItemSite ASite B
ModelRB750Gr3 hEXRB941-2nD hAP lite
RouterOS6.49.196.49.19
RAM256 MB32 MB
CPUMIPS 4-core 880MHzMIPS 1-core 650MHz
InternetFixed ISP4G mobile
L2TP statusAlways-onAlways-on

Each router runs a custom RouterOS script suite (scheduler-driven, Telegram-integrated) for monitoring, alerting, and remote management.

💰 Cost

The entire infrastructure runs at zero cost:

ResourceCost
OCI VM.Standard.E2.1.MicroFree Always Free
45 GB OCI boot volumeFree Always Free
Up to 10 TiB/month outboundFree Always Free
Dropbox backup storageFree tier (<2 GB/year)
GitHub private repositoryFree
MikroTik routersOne-time hardware cost only
📋 Changelog
2026-06-06
Public reference published — topology diagram, full service and security documentation