- Replace systemd units with OpenRC init scripts (supervise-daemon) - Add wirecon-watchdog-loop.sh since OpenRC has no timers - Switch install.sh to apk + rc-update - Update bootstrap.sh to install git/bash via apk - New proxmox/create-lxc.sh: picks next VMID, downloads Alpine template, creates unprivileged LXC with tun passthrough, chains bootstrap - Rewrite README around the Proxmox one-liner flow
3.0 KiB
wirecon
WireGuard tunnel between a rootless-Docker internet host and an unprivileged Alpine LXC on Proxmox, with Caddy reverse-proxying inbound traffic into the LXC's LAN. Tuned for flaky uplinks (Telekom DSL/LTE Hybrid) with a fast-reconnect watchdog and structured logging.
internet Telekom Hybrid (DSL+LTE)
clients ──► Docker host ══════ wg0 (UDP 51820) ══════ LXC ──► 192.168.1.0/24
(Caddy + (Alpine + kernel WG
wireguard-go, + OpenRC watchdog
rootless) & monitor)
Install
Proxmox side — one-liner (creates the LXC from scratch)
Run on the Proxmox host as root:
curl -fsSL https://git.d4nn13.de/d4nn13/wirecon/raw/branch/main/proxmox/create-lxc.sh | bash
Defaults: Alpine template (latest), hostname concad, 1 core, 256 MiB RAM, 2 GiB disk, DHCP on vmbr0, auto-picked VMID. The script creates the container, applies the /dev/net/tun passthrough, starts it, and chains into the in-LXC bootstrap which clones the repo and runs lxc/install.sh. Override defaults via env vars:
HOSTNAME=tunbox MEMORY=512 STORAGE=fast-nvme \
bash -c "$(curl -fsSL https://git.d4nn13.de/d4nn13/wirecon/raw/branch/main/proxmox/create-lxc.sh)"
LXC side only (if the container already exists)
Inside the unprivileged LXC as root:
curl -fsSL https://git.d4nn13.de/d4nn13/wirecon/raw/branch/main/lxc/bootstrap.sh | sudo bash
Finishing up (either path)
Edit /etc/wireguard/wg0.conf (keys, endpoint, LAN iface in PostUp), optionally tune /etc/wirecon/wirecon.conf, then:
rc-update add wg-quick.wg0 default && rc-service wg-quick.wg0 start
rc-update add wirecon-watchdog default && rc-service wirecon-watchdog start
rc-update add wirecon-monitor default && rc-service wirecon-monitor start
tail -F /var/log/wirecon-watchdog.log /var/log/wirecon-monitor.log
Docker side (internet host)
Rootless Docker daemon already running:
git clone https://git.d4nn13.de/d4nn13/wirecon.git
cd wirecon/docker
cp wg/config/wg0.conf.example wg/config/wg0.conf # fill in keys
# edit proxy/Caddyfile for your sites
docker compose up -d --build
Host prereqs:
/dev/net/tunreadable by the rootless usersysctl net.ipv4.ip_unprivileged_port_start=80if you want 80/443 bound directly
Layout
docker/ rootless-Docker stack: wg (wireguard-go) + Caddy sharing netns
lxc/ Alpine installer, OpenRC services, watchdog/monitor/MTU-probe
proxmox/ host-side LXC creator + tun-passthrough snippet
Tuning
- MTU — default
1280. Run/usr/local/bin/wirecon-mtu-probe.shinside the LXC to find the real path MTU; updateMTU =on both peers. - Watchdog (
/etc/wirecon/wirecon.conf):HANDSHAKE_MAX_AGE,PING_LOSS_THRESHOLD,FAIL_STREAK_THRESHOLD,WATCHDOG_INTERVAL. - Logs — structured
key=valuelines in/var/log/wirecon-*.log; grep-friendly.