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.
33 lines
1.2 KiB
Plaintext
33 lines
1.2 KiB
Plaintext
# /etc/wireguard/wg0.conf on the Docker (server) side.
|
|
# Rename to wg0.conf and fill in the marked fields.
|
|
#
|
|
# Generate keys:
|
|
# wg genkey | tee server.key | wg pubkey > server.pub
|
|
# wg genkey | tee client.key | wg pubkey > client.pub
|
|
|
|
[Interface]
|
|
# Server's tunnel address. Pick a subnet that doesn't clash with 192.168.1.0/24.
|
|
Address = 10.42.0.1/24
|
|
ListenPort = 51820
|
|
PrivateKey = REPLACE_WITH_SERVER_PRIVATE_KEY
|
|
|
|
# Match MTU on both ends. 1280 is safe default behind Telekom Hybrid.
|
|
MTU = 1280
|
|
|
|
# Enable forwarding + MASQ inside the container's own netns so traffic from
|
|
# the proxy container (sharing this netns) can flow into wg0 and back.
|
|
# No host iptables are touched.
|
|
PostUp = sysctl -w net.ipv4.ip_forward=1
|
|
PostUp = iptables -A FORWARD -i %i -j ACCEPT
|
|
PostUp = iptables -A FORWARD -o %i -j ACCEPT
|
|
PostDown = iptables -D FORWARD -i %i -j ACCEPT
|
|
PostDown = iptables -D FORWARD -o %i -j ACCEPT
|
|
|
|
[Peer]
|
|
# The LXC client.
|
|
PublicKey = REPLACE_WITH_CLIENT_PUBLIC_KEY
|
|
# Route both the client's tunnel IP and its LAN subnet back through wg0.
|
|
AllowedIPs = 10.42.0.2/32, 192.168.1.0/24
|
|
# Server should not set PersistentKeepalive — the client drives this, since
|
|
# it's the one behind NAT / hybrid uplink.
|