Remote Access
This document describes how remote access to the homelab is implemented.
The environment uses Cloudflare Dynamic DNS to keep a public hostname updated with the current public IP address. Remote clients connect to this hostname, which forwards traffic to the WireGuard server hosted on hades.skynet.lan.
Architecture
flowchart TB
PUBLICHOSTNAME[🌐 Static Hostname using Cloudflare DDNS]
ISP[🌐 ISP Connection]
ROUTER[📡 ISP Router]
MT[🔀 MikroTik Router]
HADES[🖥️ hades.skynet.lan\nWireGuard]
CLIENTS[💻 iPhone / MacBook]
SERVERS[🖥️ *.skynet.lan\nApplication Servers]
CLIENTS --> PUBLICHOSTNAME
PUBLICHOSTNAME --> ISP
ISP --> ROUTER
ROUTER --> MT
MT --> HADES
HADES --> SERVERS
Connection Flow
- A remote client (MacBook, iPhone, etc.) initiates a WireGuard connection.
- The client connects to the public Cloudflare hostname.
ddclientcontinuously updates the DNS record whenever the ISP changes the public IP address.- The ISP router receives the connection and forwards the WireGuard UDP port to the MikroTik router.
- The MikroTik router forwards the traffic to
hades.skynet.lan. - The WireGuard server authenticates the client.
- After authentication, the client becomes part of the internal network and can securely access services hosted under
*.skynet.lan.
Components
| Component | Purpose |
|---|---|
| Cloudflare | Public DNS hosting |
| ddclient | Automatically updates the Cloudflare DNS record |
| ISP Router | Receives inbound Internet traffic and forwards the WireGuard port |
| MikroTik Router | Internal routing and firewall |
| hades.skynet.lan | WireGuard VPN server |
| Clients | iPhone, MacBook, laptop, etc. |
| Internal Servers | All services hosted inside the homelab |
Port Forwarding
The ISP router forwards the WireGuard UDP port to the MikroTik router.
Example:
| Protocol | Port | Destination |
|---|---|---|
| UDP | 51820 | MikroTik |
The MikroTik firewall then forwards the traffic to:
Dynamic DNS
The public hostname always points to the current ISP public IP.
The DNS record is automatically maintained by ddclient.
ddclient Configuration
Configuration file:
Example placeholder:
# ddclient configuration
daemon=300 # check every 300 seconds
syslog=yes # log update msgs to syslog
pid=/run/ddclient/ddclient.pid
ssl=yes
use=web
web=ifconfig.me
##
## Cloudflare
protocol=cloudflare, \
zone=<mydomain.tld>, \
ttl=1,
password='Cloudflare API Key',
vpn.<mydomain.tld>
#############################################
Install Wireguard here
Set up Wireguard Server
WireGuard Authentication
Clients authenticate using WireGuard public/private key pairs.
Only configured peers are allowed to establish a VPN connection.
After authentication, clients receive an internal VPN address and can securely access resources inside the skynet.lan network.
Network Flow
Internet
│
▼
Cloudflare DNS
│
▼
Public IP Address
│
▼
ISP Router
│
▼
MikroTik
│
▼
hades.skynet.lan
│
▼
Internal Services
Benefits
- Secure encrypted remote access.
- Automatic DNS updates when the ISP changes the public IP.
- No need to remember changing IP addresses.
- Internal services remain private and accessible only through the VPN.
- Centralized access to all homelab resources through a single WireGuard endpoint.