/major-ai-skills:wireguardfrom major-ai-skills
Design WireGuard interfaces with cryptokey routing (AllowedIPs), PersistentKeepalive for NAT, and forwarding/NAT only when intended; debug handshake vs routing failures.
Ships in major-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
WireGuard is a UDP tunnel with Noise-based handshake and a single critical idea: cryptokey routing. Each peer’s AllowedIPs is both the ACL (which source packets may arrive as that peer) and the route table (which destinations are sent to that peer). There is no user/password plane—only keys, endpoints, and OS forwarding. Agents must generate keys on-box, never paste private keys into repos/chat, and separate “no handshake” from “handshake OK but AllowedIPs/routes wrong.”
┌─────────────────────────────────────────────────────────────┐
│ WireGuard cryptokey routing │
│ │
│ Interface wg0 │
│ ├── PrivateKey (local) / ListenPort (server) │
│ └── Peer: PublicKey + Endpoint? + AllowedIPs + keepalive? │
│ │
│ Packet out: dst ∈ peer AllowedIPs → encrypt to that peer │
│ Packet in: src must match peer AllowedIPs or drop │
│ │
│ Optional host role │
│ ├── ip_forward + FORWARD rules (site / LAN access) │
│ └── MASQUERADE (full-tunnel internet egress only if needed)│
└─────────────────────────────────────────────────────────────┘
Use when
wg0 only).Do not use when
@tailscale.0600 and secret managers (@vault)./etc/wireguard/ mode 700/600)./32s plus intentional LAN prefixes—avoid reflexive 0.0.0.0/0 on every peer unless full-tunnel is the design.10.1.0.0/16 to B, B’s peer entry for A must allow A’s tunnel IP (and return path for LAN sources if applicable).PersistentKeepalive = 25 on the NAT’d side so the mapping stays open (WireGuard is silent by default).ip_forward and firewall FORWARD/NAT only for designed gateway roles; persist via sysctl.d.[email protected] for boot persistence; validate with wg show handshakes and ip route get.Keygen (on each host, do not echo secrets into logs):
umask 077
wg genkey | tee /etc/wireguard/server.key | wg pubkey > /etc/wireguard/server.pub
wg genkey | tee /etc/wireguard/client.key | wg pubkey > /etc/wireguard/client.pub
Server /etc/wireguard/wg0.conf (placeholders only):
[Interface]
Address = 10.10.0.1/24
ListenPort = 51820
PrivateKey = <SERVER_PRIVATE_KEY>
# Optional LAN access for clients — enable forwarding first
# PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT
# PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT
[Peer]
# laptop
PublicKey = <CLIENT_PUBLIC_KEY>
AllowedIPs = 10.10.0.2/32
Client:
[Interface]
Address = 10.10.0.2/24
PrivateKey = <CLIENT_PRIVATE_KEY>
DNS = 10.10.0.1
[Peer]
PublicKey = <SERVER_PUBLIC_KEY>
Endpoint = vpn.example.com:51820
AllowedIPs = 10.10.0.0/24, 10.1.0.0/16
PersistentKeepalive = 25
Bring-up and validation:
sudo systemctl enable --now wg-quick@wg0
sudo wg show wg0
sudo wg show wg0 latest-handshakes
ping -c 3 10.10.0.1
ip route get 10.1.0.10
# Firewall: allow UDP/51820 on server WAN
| Signature | Likely cause | Fix path |
|---|---|---|
No latest handshake / transfer counters stuck at 0 | UDP blocked, wrong Endpoint/DNS, key mismatch | Check WAN UDP ListenPort; verify pubkeys not swapped; tcpdump -n udp port 51820 |
| Handshake OK, ping fails | AllowedIPs / OS routes mismatch | Align AllowedIPs both sides; ip addr / ip route on wg0 |
Destination Host Unreachable / “Destination address required” | Peer has no Endpoint and has not received traffic yet; or NAT mapping expired | Initiate from side that has Endpoint; set PersistentKeepalive on NAT peer |
| Works briefly then dies behind NAT | Missing keepalive | PersistentKeepalive = 25 on client |
| Clients reach hub but not LAN | ip_forward=0 or FORWARD drop; missing return routes | Persist sysctl; firewall ACCEPT forward; optional MASQUERADE only if designed |
| TCP stalls / weird HTTP hangs | MTU / nested tunnel | Lower MTU (e.g. 1280–1420); test with ping -M do -s |
| Intermittent one-way traffic | Asymmetric AllowedIPs (source not allowed on return peer) | Fix peer AllowedIPs for real source CIDRs |
@tailscale / Headscale).@tailscale — managed mesh, ACLs, DERP, MagicDNS on top of WireGuard@nginx-hardening — publish apps only on WG interface@lets-encrypt — TLS for any public portal in front of VPN onboarding@cloudflare-dns — stable Endpoint hostname for hubs@ansible — distribute peer configs without printing private keysMANDATORY: Treat AllowedIPs as routing + ACL on every peer. Separate handshake failures from routing failures. Require PersistentKeepalive for NAT’d clients that must receive inbound traffic. Never invent or commit private keys; use placeholders and file permissions. Enable forwarding/MASQUERADE only when the design explicitly needs a gateway.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization./act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.Other plugins' skills for the same job