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:
commit
49b01dfcd3
19 files changed
+770
No files matched your search
Executable
+36
@@ -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
|
||||
Reference in new issue
Block a user