openvpn
OpenVPNサーバーとクライアントの構築・管理を支援し、VPNサーバーのセットアップ、クライアント証明書の作成、セキュリティー強化、クライアント設定の自動化など、VPN接続に関する様々な課題を解決するSkill。
📜 元の英語説明(参考)
Deploy and manage OpenVPN servers and clients. 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, or troubleshoot VPN connectivity. Covers server deployment, PKI management, client configuration, and production hardening.
🇯🇵 日本人クリエイター向け解説
OpenVPNサーバーとクライアントの構築・管理を支援し、VPNサーバーのセットアップ、クライアント証明書の作成、セキュリティー強化、クライアント設定の自動化など、VPN接続に関する様々な課題を解決するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o openvpn.zip https://jpskill.com/download/15214.zip && unzip -o openvpn.zip && rm openvpn.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/15214.zip -OutFile "$d\openvpn.zip"; Expand-Archive "$d\openvpn.zip" -DestinationPath $d -Force; ri "$d\openvpn.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
openvpn.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
openvpnフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
OpenVPN
概要
業界標準のオープンソース VPN である OpenVPN をデプロイおよび管理します。このスキルでは、PKI (EasyRSA) を使用した完全なサーバー設定、クライアント証明書管理、ルーティングモード (TUN/TAP)、スプリットトンネリング、サイト間リンク、MFA 統合、パフォーマンスチューニング、および監視について説明します。リモートアクセス VPN、オフィス間の接続、および信頼できないネットワーク上のトラフィックの保護に適しています。
手順
ステップ 1: サーバーのインストールと PKI の設定
# Ubuntu/Debian
apt update && apt install -y openvpn easy-rsa
# PKI の初期化
make-cadir ~/openvpn-ca && cd ~/openvpn-ca
cat > vars <<'EOF'
set_var EASYRSA_REQ_COUNTRY "US"
set_var EASYRSA_REQ_PROVINCE "California"
set_var EASYRSA_REQ_CITY "San Francisco"
set_var EASYRSA_REQ_ORG "MyCompany"
set_var EASYRSA_REQ_EMAIL "admin@company.com"
set_var EASYRSA_ALGO ec
set_var EASYRSA_CURVE secp384r1
set_var EASYRSA_CA_EXPIRE 3650
set_var EASYRSA_CERT_EXPIRE 825
EOF
./easyrsa init-pki
./easyrsa build-ca nopass
# サーバー証明書 + DH + TLS 認証
./easyrsa gen-req server nopass
./easyrsa sign-req server server
./easyrsa gen-dh
openvpn --genkey secret ta.key
# OpenVPN にコピー
cp pki/ca.crt pki/issued/server.crt pki/private/server.key pki/dh.pem ta.key /etc/openvpn/server/
ステップ 2: サーバーの設定
/etc/openvpn/server/server.conf:
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
tls-auth ta.key 0
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
cipher AES-256-GCM
auth SHA384
tls-version-min 1.2
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn/status.log
log-append /var/log/openvpn/openvpn.log
verb 3
max-clients 100
crl-verify /etc/openvpn/server/crl.pem
転送と NAT を有効にする:
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf && sysctl -p
IFACE=$(ip route get 1.1.1.1 | awk '{print $5; exit}')
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o "$IFACE" -j MASQUERADE
apt install -y iptables-persistent && netfilter-persistent save
systemctl enable --now openvpn-server@server
ステップ 3: クライアント証明書とプロファイルの生成
cd ~/openvpn-ca
./easyrsa gen-req alice nopass
./easyrsa sign-req client alice
.ovpn ファイルを自己完結型で生成する:
#!/bin/bash
# generate-client.sh
CLIENT=$1; CA_DIR=~/openvpn-ca; SERVER_IP="your.server.ip"
cat > ~/client-configs/$CLIENT.ovpn <<EOF
client
dev tun
proto udp
remote $SERVER_IP 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-GCM
auth SHA384
key-direction 1
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-auth>
$(cat "$CA_DIR/ta.key")
</tls-auth>
EOF
echo "Created: ~/client-configs/$CLIENT.ovpn"
ステップ 4: スプリットトンネリングとサイト間接続
スプリットトンネル — 特定のネットワークのみを VPN 経由でルーティングします。
# サーバー: redirect-gateway を特定ルートに置き換えます
push "route 10.0.0.0 255.0.0.0"
push "route 192.168.0.0 255.255.0.0"
クライアント側のオーバーライド:
route-nopull
route 10.0.0.0 255.0.0.0
route 192.168.1.0 255.255.255.0
サイト間接続 — 2 つのオフィスを接続します。
# オフィス A (サーバー): オフィス B の LAN へのルート
ifconfig 10.9.0.1 10.9.0.2
route 192.168.2.0 255.255.255.0
# オフィス B (クライアント): オフィス A の LAN へのルート
remote office-a.example.com 1195
ifconfig 10.9.0.2 10.9.0.1
route 192.168.1.0 255.255.255.0
ステップ 5: MFA とクライアントの失効
TOTP (Google Authenticator) を追加する:
apt install -y libpam-google-authenticator
su - vpnuser -c "google-authenticator -t -d -f -r 3 -R 30 -w 3"
server.conf に以下を追加: plugin /usr/lib/openvpn/openvpn-plugin-auth-pam.so openvpn
クライアントは以下を追加: auth-user-pass
クライアントを失効させる:
cd ~/openvpn-ca
./easyrsa revoke alice
./easyrsa gen-crl
cp pki/crl.pem /etc/openvpn/server/crl.pem
systemctl restart openvpn-server@server
ステップ 6: 監視とパフォーマンス
# 接続中のクライアント
cat /var/log/openvpn/status.log
# 管理インターフェース (server.conf に以下を追加: management 127.0.0.1 7505)
echo "status" | nc 127.0.0.1 7505
echo "kill alice" | nc 127.0.0.1 7505
パフォーマンスチューニング (server.conf に以下を追加):
sndbuf 0
rcvbuf 0
push "sndbuf 393216"
push "rcvbuf 393216"
fragment 1400
mssfix 1400
例
例 1: クライアントプロビジョニングを備えた完全な OpenVPN サーバーのデプロイ
ユーザープロンプト: 「198.51.100.25 の Ubuntu 22.04 VPS に OpenVPN サーバーをセットアップします。EasyRSA で完全な PKI を作成し、AES-256-GCM でポート 1194 で UDP を設定し、DNS 1.1.1.1 をクライアントにプッシュし、alice、bob、carol の .ovpn プロファイルを生成します。」
エージェントは、openvpn と easy-rsa をインストールし、EC キー (secp384r1) を使用して PKI を初期化し、CA を構築し、サーバーと 3 つのクライアント証明書を生成し、UDP/TUN/AES-256-GCM と NAT マスカレードを使用して server.conf を作成し、generate-client.sh スクリプトを書き込み、埋め込み証明書を使用して alice、bob、carol の自己完結型 .ovpn ファイルを生成し、IP 転送を有効にし、iptables ルールを永続化し、サービスを開始します。
例 2: 既存の OpenVPN サーバーに TOTP 2 要素認証を追加する
ユーザープロンプト: 「OpenVPN サーバーは実行されていますが、Google Authenticator MFA を追加する必要があります。各ユーザーが接続するために証明書と TOTP コードを必要とするように設定します。」
エージェントは libpam-google-authenticator をインストールし、Google Authenticator モジュールを必要とする /etc/pam.d/openvpn に PAM 構成を作成し、PAM プラグインディレクティブを server.conf に追加し、各 VPN システムユーザーに対して google-authenticator セットアップを実行し、クライアント .ovpn テンプレートに auth-user-pass を追加し、OpenVPN サービスを再起動します。ユーザーがプロンプトが表示されたら、ユーザー名と TOTP コードを入力することを説明します。
ガイドライン
- 常に
tls-authまたはtls-cryptを使用して追加します
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
OpenVPN
Overview
Deploy and manage OpenVPN — the industry-standard open-source VPN. This skill covers full server setup with PKI (EasyRSA), client certificate management, routing modes (TUN/TAP), split tunneling, site-to-site links, MFA integration, performance tuning, and monitoring. Suitable for remote access VPN, connecting offices, and securing traffic on untrusted networks.
Instructions
Step 1: Server Installation & PKI Setup
# Ubuntu/Debian
apt update && apt install -y openvpn easy-rsa
# Initialize PKI
make-cadir ~/openvpn-ca && cd ~/openvpn-ca
cat > vars <<'EOF'
set_var EASYRSA_REQ_COUNTRY "US"
set_var EASYRSA_REQ_PROVINCE "California"
set_var EASYRSA_REQ_CITY "San Francisco"
set_var EASYRSA_REQ_ORG "MyCompany"
set_var EASYRSA_REQ_EMAIL "admin@company.com"
set_var EASYRSA_ALGO ec
set_var EASYRSA_CURVE secp384r1
set_var EASYRSA_CA_EXPIRE 3650
set_var EASYRSA_CERT_EXPIRE 825
EOF
./easyrsa init-pki
./easyrsa build-ca nopass
# Server certificate + DH + TLS auth
./easyrsa gen-req server nopass
./easyrsa sign-req server server
./easyrsa gen-dh
openvpn --genkey secret ta.key
# Copy to OpenVPN
cp pki/ca.crt pki/issued/server.crt pki/private/server.key pki/dh.pem ta.key /etc/openvpn/server/
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 dh.pem
tls-auth ta.key 0
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
cipher AES-256-GCM
auth SHA384
tls-version-min 1.2
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn/status.log
log-append /var/log/openvpn/openvpn.log
verb 3
max-clients 100
crl-verify /etc/openvpn/server/crl.pem
Enable forwarding and NAT:
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf && sysctl -p
IFACE=$(ip route get 1.1.1.1 | awk '{print $5; exit}')
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o "$IFACE" -j MASQUERADE
apt install -y iptables-persistent && netfilter-persistent save
systemctl enable --now openvpn-server@server
Step 3: Client Certificate & Profile Generation
cd ~/openvpn-ca
./easyrsa gen-req alice nopass
./easyrsa sign-req client alice
Generate a self-contained .ovpn file:
#!/bin/bash
# generate-client.sh
CLIENT=$1; CA_DIR=~/openvpn-ca; SERVER_IP="your.server.ip"
cat > ~/client-configs/$CLIENT.ovpn <<EOF
client
dev tun
proto udp
remote $SERVER_IP 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-GCM
auth SHA384
key-direction 1
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-auth>
$(cat "$CA_DIR/ta.key")
</tls-auth>
EOF
echo "Created: ~/client-configs/$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 — connect two offices:
# Office A (server): route to Office B LAN
ifconfig 10.9.0.1 10.9.0.2
route 192.168.2.0 255.255.255.0
# Office B (client): route to Office A LAN
remote office-a.example.com 1195
ifconfig 10.9.0.2 10.9.0.1
route 192.168.1.0 255.255.255.0
Step 5: MFA & Client Revocation
Add TOTP (Google Authenticator):
apt install -y libpam-google-authenticator
su - vpnuser -c "google-authenticator -t -d -f -r 3 -R 30 -w 3"
Add to server.conf: plugin /usr/lib/openvpn/openvpn-plugin-auth-pam.so openvpn
Client adds: auth-user-pass
Revoke a client:
cd ~/openvpn-ca
./easyrsa revoke alice
./easyrsa gen-crl
cp pki/crl.pem /etc/openvpn/server/crl.pem
systemctl restart openvpn-server@server
Step 6: Monitoring & Performance
# Connected clients
cat /var/log/openvpn/status.log
# Management interface (add to server.conf: management 127.0.0.1 7505)
echo "status" | nc 127.0.0.1 7505
echo "kill alice" | nc 127.0.0.1 7505
Performance tuning (add to server.conf):
sndbuf 0
rcvbuf 0
push "sndbuf 393216"
push "rcvbuf 393216"
fragment 1400
mssfix 1400
Examples
Example 1: Deploy a full OpenVPN server with client provisioning
User prompt: "Set up an OpenVPN server on our Ubuntu 22.04 VPS at 198.51.100.25. Create a full PKI with EasyRSA, configure UDP on port 1194 with AES-256-GCM, push DNS 1.1.1.1 to clients, and generate .ovpn profiles for alice, bob, and carol."
The agent will install openvpn and easy-rsa, initialize a PKI with EC keys (secp384r1), build a CA, generate server and three client certificates, create a server.conf with UDP/TUN/AES-256-GCM and NAT masquerading, write a generate-client.sh script, produce self-contained .ovpn files for alice, bob, and carol with embedded certificates, enable IP forwarding, persist iptables rules, and start the service.
Example 2: Add TOTP two-factor authentication to an existing OpenVPN server
User prompt: "Our OpenVPN server is running but we need to add Google Authenticator MFA. Set it up so each user needs their certificate plus a TOTP code to connect."
The agent will install libpam-google-authenticator, create a PAM config at /etc/pam.d/openvpn requiring the Google Authenticator module, add the PAM plugin directive to server.conf, run google-authenticator setup for each VPN system user, add auth-user-pass to the client .ovpn templates, and restart the OpenVPN service. It will explain that users enter their username and TOTP code when prompted.
Guidelines
- Always use
tls-authortls-cryptto add an HMAC firewall that drops unauthenticated packets before they reach the TLS stack - Use elliptic curve keys (
EASYRSA_ALGO ec,EASYRSA_CURVE secp384r1) for faster handshakes and stronger security than RSA-2048 - Keep the CA private key offline or on a separate machine; if compromised, an attacker can issue valid client certificates
- Set
crl-verifyin server.conf and regenerate the CRL after every revocation, or revoked clients will still be able to connect - Prefer UDP over TCP for the VPN tunnel to avoid TCP-over-TCP performance degradation; use TCP 443 only as a fallback for restrictive networks
- Test split tunnel configurations by checking client routing tables (
ip route) after connecting to verify only intended traffic routes through the VPN