Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

openvpn

БесплатноБез исполняемых скриптовНе проверен

OpenVPN is an open-source VPN daemon that builds encrypted TLS tunnels for remote access and site-to-site links. Use when a user asks to set up a VPN server…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

OpenVPN

Overview

Deploy and manage OpenVPN — the industry-standard open-source VPN. This skill covers full server setup with PKI (EasyRSA), client certificate management, split tunneling, site-to-site links, MFA integration, revocation, and monitoring. Suitable for remote access VPN, connecting offices, and securing traffic on untrusted networks. The configuration below works on OpenVPN 2.5 through 2.7; 2.7 (current stable) refuses static-key mode unless --allow-deprecated-insecure-static-crypto is set (2.8 removes it) and uses the in-kernel ovpn data channel offload on Linux 6.16+.

Instructions

Step 1: Server Installation & PKI Setup

Run as root. --batch stops Easy-RSA from prompting, which matters when an agent runs the commands.

# Ubuntu/Debian (netcat-openbsd: the nc that can talk to the management socket; Debian's default nc cannot)
apt update && apt install -y openvpn easy-rsa netcat-openbsd

# Initialize PKI
make-cadir ~/openvpn-ca && cd ~/openvpn-ca
cat > vars <<'EOF'
set_var EASYRSA_ALGO           ec
set_var EASYRSA_CURVE          secp384r1
set_var EASYRSA_CA_EXPIRE      3650
set_var EASYRSA_CERT_EXPIRE    825
set_var EASYRSA_CRL_DAYS       180
EOF

./easyrsa init-pki
mv vars pki/vars   # Easy-RSA 3.0 (Ubuntu 22.04) reads vars only from the PKI directory; left here it is ignored and keys become RSA-2048
./easyrsa --batch --req-cn="Northwind VPN CA" build-ca nopass

# Server certificate, CRL and control-channel key (EC keys need no DH parameters)
./easyrsa --batch build-server-full server nopass
./easyrsa gen-crl
openvpn --genkey tls-crypt-v2-server /etc/openvpn/server/tls-crypt-v2-server.key

# Copy to OpenVPN; the CRL must stay readable after the daemon drops root
cp pki/ca.crt pki/issued/server.crt pki/private/server.key /etc/openvpn/server/
install -m 644 pki/crl.pem /etc/openvpn/server/crl.pem

Step 2: Server Configuration

/etc/openvpn/server/server.conf:

port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh none
tls-crypt-v2 tls-crypt-v2-server.key

server 10.8.0.0 255.255.255.0
topology subnet
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 1.0.0.1"
keepalive 10 120

data-ciphers AES-256-GCM:CHACHA20-POLY1305
tls-version-min 1.2
user nobody
group nogroup
persist-key
persist-tun

verb 3
max-clients 100
crl-verify crl.pem
management /run/openvpn-server/mgmt.sock unix

cipher is ignored in TLS mode since 2.6; data-ciphers sets what may be negotiated. persist-key is needed up to 2.6 and is the default on 2.7, which logs a harmless deprecation note for it.

Enable forwarding and NAT:

echo "net.ipv4.ip_forward = 1" > /etc/sysctl.d/99-openvpn.conf && sysctl --system
DEBIAN_FRONTEND=noninteractive apt install -y iptables-persistent   # also installs iptables
IFACE=$(ip route get 1.1.1.1 | sed -n 's/.* dev \([^ ]*\).*/\1/p')   # the interface that carries the default route
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o "$IFACE" -j MASQUERADE
netfilter-persistent save
systemctl enable --now openvpn-server@server

Step 3: Client Certificate & Profile Generation

cd ~/openvpn-ca
./easyrsa --batch build-client-full alice nopass

Generate a self-contained .ovpn file (save the script as ~/generate-client.sh; each client gets its own tls-crypt-v2 key):

#!/bin/bash
# generate-client.sh — usage: VPN_SERVER_HOST=vpn.northwind.dev ./generate-client.sh alice
set -euo pipefail
umask 077
CLIENT=$1; CA_DIR=~/openvpn-ca; OUT=~/client-configs
mkdir -p "$OUT"
openvpn --tls-crypt-v2 /etc/openvpn/server/tls-crypt-v2-server.key \
  --genkey tls-crypt-v2-client "$OUT/$CLIENT-tc.key"
cat > "$OUT/$CLIENT.ovpn" <<PROFILE
client
dev tun
proto udp
remote $VPN_SERVER_HOST 1194
resolv-retry infinite
nobind
persist-tun
remote-cert-tls server
data-ciphers AES-256-GCM:CHACHA20-POLY1305
verb 3
<ca>
$(cat "$CA_DIR/pki/ca.crt")
</ca>
<cert>
$(sed -n '/BEGIN CERTIFICATE/,/END CERTIFICATE/p' "$CA_DIR/pki/issued/$CLIENT.crt")
</cert>
<key>
$(cat "$CA_DIR/pki/private/$CLIENT.key")
</key>
<tls-crypt-v2>
$(cat "$OUT/$CLIENT-tc.key")
</tls-crypt-v2>
PROFILE
rm "$OUT/$CLIENT-tc.key"
echo "Created: $OUT/$CLIENT.ovpn"

Step 4: Split Tunneling & Site-to-Site

Split tunnel — only route specific networks through VPN:

# Server: replace redirect-gateway with specific routes
push "route 10.0.0.0 255.0.0.0"
push "route 192.168.0.0 255.255.0.0"

Client-side override:

route-nopull
route 10.0.0.0 255.0.0.0
route 192.168.1.0 255.255.255.0

Site-to-site — Office B (LAN 192.168.2.0/24) connects as an ordinary client with its own certificate, and the server routes B's LAN to it. Static-key point-to-point tunnels no longer start on 2.7.

# Office A server.conf: A's LAN is 192.168.1.0/24
client-config-dir ccd
route 192.168.2.0 255.255.255.0
push "route 192.168.1.0 255.255.255.0"

# /etc/openvpn/server/ccd/office-b  (file name = the client's
Полный SKILL.md на GitHub

Установить openvpn в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл openvpn?

OpenVPN is an open-source VPN daemon that builds encrypted TLS tunnels for remote access and site-to-site links. Use when a user asks to set up a VPN server, create client certificates, configure site-to-site tunnels, set up split tunneling, manage PKI with EasyRSA, harden OpenVPN security, automate client provisioning, configure routing and NAT, set up MFA for VPN, monitor connected clients, revoke a client, or troubleshoot VPN connectivity.

Как установить скилл openvpn?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл openvpn запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить openvpn с