This walks you through setting up and managing three major VPN protocols: WireGuard, OpenVPN, and IPSec with strongSwan. You get installation commands for Debian and RHEL families, complete server and client configs, and certificate generation workflows. The WireGuard section is especially practical with key generation one-liners and a script for adding new users. It covers common scenarios like site-to-site tunnels and split tunneling, plus troubleshooting commands for when handshakes fail or routing breaks. If you're deploying VPNs on Linux and need working configs instead of theory, this gives you copy-paste starting points for all three stacks with the actual iptables rules and systemd commands you'll need.

skills.sh installs
194
GitHub stars
59
last updated
Aug 21, 2026

Install

$ npx -y skills add chaterm/terminal-skills --skill vpn --agent claude-code

Installs into .claude/skills of the current project.

Files

VPN 配置与管理

概述

OpenVPN、WireGuard、IPSec VPN 配置与管理技能。

WireGuard

安装

# Debian/Ubuntu
apt install wireguard

# CentOS/RHEL
yum install epel-release elrepo-release
yum install kmod-wireguard wireguard-tools

# 验证安装
wg --version

生成密钥

# 生成私钥
wg genkey > privatekey

# 从私钥生成公钥
wg pubkey < privatekey > publickey

# 一步生成
wg genkey | tee privatekey | wg pubkey > publickey

# 生成预共享密钥(可选,增强安全)
wg genpsk > presharedkey

服务端配置

# /etc/wireguard/wg0.conf
[Interface]
Address = 10.0.0.1/24
ListenPort = 51820
PrivateKey = <server_private_key>

# 启用 IP 转发
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]
PublicKey = <client_public_key>
AllowedIPs = 10.0.0.2/32

客户端配置

# /etc/wireguard/wg0.conf
[Interface]
Address = 10.0.0.2/24
PrivateKey = <client_private_key>
DNS = 8.8.8.8

[Peer]
PublicKey = <server_public_key>
Endpoint = server.example.com:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25

管理命令

# 启动
wg-quick up wg0
systemctl start wg-quick@wg0

Sponsors

Details

Repository
github.com/chaterm/terminal-skills
Category
CLI & Terminal
First seen
Jun 3, 2026

More from chaterm/terminal-skills

All 5
1jacob-bd avatarnlm-skilljacob-bd/notebooklm-mcp-clinlm skill184skills.sh installs
2smithery-ai avatarsmitherysmithery-ai/clismithery168skills.sh installs
3nansen-ai avatarnansen-smart-moneynansen-ai/nansen-cliSmart money tracking — netflow, trades, holdings, perp trades. Use when finding what smart money wallets are buying/selling or tracking whale activity.165skills.sh installs
4nansen-ai avatarnansen-tokennansen-ai/nansen-cliToken deep dive — info, OHLCV, holders, flows, flow intelligence, who bought/sold, DEX trades, PnL, perp trades, perp positions, perp PnL leaderboard. Use when 136skills.sh installs
5nansen-ai avatarnansen-profilernansen-ai/nansen-cliWallet profiler — balance, PnL, labels, transactions, counterparties, related wallets, batch, trace, compare. Use when analysing a specific wallet address or co133skills.sh installs
6nansen-ai avatarnansen-walletnansen-ai/nansen-cliWallet management — create, list, show, export, send, delete. Use when creating wallets, checking balances, or sending tokens.124skills.sh installs