New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Practical VPN setup guide covering WireGuard, OpenVPN, and strongSwan IPsec configuration and management.

skills.sh installs
194
GitHub stars
60
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers WireGuard key generation, server and client configs, and wg-quick or systemd management for each peer
  • Includes OpenVPN PKI setup with easy-rsa, server and client .conf templates, and certificate revocation steps
  • Provides a strongSwan IKEv2 configuration with EAP-MSCHAPv2 user authentication and certificate generation with ipsec pki
  • Designed for administrators deploying remote-access or site-to-site tunnels across Debian, Ubuntu, CentOS, and RHEL hosts

Install

$ npx -y skills add chaterm/terminal-skills --skill vpn -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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

Details

Repository
github.com/chaterm/terminal-skills
Categories
DevOps & Cloud, Security
First seen
Jun 3, 2026

More from chaterm/terminal-skills

All 5

Similar to Vpn

More DevOps & Cloud