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.4 KiB
Plaintext
33 lines
1.4 KiB
Plaintext
# /etc/wireguard/wg0.conf on the LXC (client) side.
|
|
# Rename to wg0.conf and fill in the marked fields.
|
|
|
|
[Interface]
|
|
Address = 10.42.0.2/24
|
|
PrivateKey = REPLACE_WITH_CLIENT_PRIVATE_KEY
|
|
|
|
# Default 1280 for Telekom DSL/LTE Hybrid (GRE overlay eats headroom).
|
|
# Run wirecon-mtu-probe.sh to find a better value and update here +
|
|
# on the server side.
|
|
MTU = 1280
|
|
|
|
# MASQ traffic from the WG tunnel onto the LAN so hosts on 192.168.1.0/24
|
|
# see it as coming from the LXC's LAN IP and reply without needing a
|
|
# return route to 10.42.0.0/24.
|
|
# Replace eth0 with the LXC's LAN interface name.
|
|
PostUp = sysctl -w net.ipv4.ip_forward=1
|
|
PostUp = iptables -t nat -A POSTROUTING -s 10.42.0.0/24 -o eth0 -j MASQUERADE
|
|
PostUp = iptables -A FORWARD -i %i -o eth0 -j ACCEPT
|
|
PostUp = iptables -A FORWARD -i eth0 -o %i -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
|
PostDown = iptables -t nat -D POSTROUTING -s 10.42.0.0/24 -o eth0 -j MASQUERADE
|
|
PostDown = iptables -D FORWARD -i %i -o eth0 -j ACCEPT
|
|
PostDown = iptables -D FORWARD -i eth0 -o %i -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
|
|
|
[Peer]
|
|
PublicKey = REPLACE_WITH_SERVER_PUBLIC_KEY
|
|
Endpoint = REPLACE_WITH_SERVER_PUBLIC_HOST:51820
|
|
# Only route the server's tunnel IP through wg0. We do NOT set 0.0.0.0/0
|
|
# here because the LXC's default gateway stays on the LAN.
|
|
AllowedIPs = 10.42.0.1/32
|
|
# Client drives handshakes through the NAT; 25s is standard.
|
|
PersistentKeepalive = 25
|