initial commit: wirecon WireGuard stack

Rootless-Docker server (wireguard-go + Caddy sharing netns) and
unprivileged-LXC client (kernel WG + systemd watchdog/monitor/MTU-probe)
with curl-pipeable bootstrap. Tuned for Telekom DSL/LTE Hybrid uplinks.
This commit is contained in:
d4nn13 committed 2026-04-19 18:20:21 +02:00
commit 49b01dfcd3
19 files changed
+770

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
#!/bin/bash
set -euo pipefail
IFACE="${WG_INTERFACE:-wg0}"
CONF="/etc/wireguard/${IFACE}.conf"
log() { printf '%s wirecon-wg[%s] %s\n' "$(date -u +%FT%TZ)" "$$" "$*"; }
if [[ ! -r "$CONF" ]]; then
log "FATAL: $CONF missing or unreadable"
exit 1
fi
if [[ ! -e /dev/net/tun ]]; then
log "FATAL: /dev/net/tun not present; mount it from the host"
exit 1
fi
shutdown() {
log "shutting down ${IFACE}"
wg-quick down "$IFACE" || true
exit 0
}
trap shutdown SIGINT SIGTERM
log "bringing up ${IFACE} (userspace impl: ${WG_QUICK_USERSPACE_IMPLEMENTATION})"
wg-quick up "$IFACE"
log "interface up; endpoint info:"
wg show "$IFACE" | while IFS= read -r line; do log " $line"; done
# Park foreground on a loop so signals reach us.
while :; do
sleep 60 &
wait $!
done