jpskill.com
📦 その他 コミュニティ

linux-networking

netplan/ip, ufw/nftables firewall, DNS, VPN Wireguard/Tailscale, inter-instance routing System76

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o linux-networking.zip https://jpskill.com/download/22239.zip && unzip -o linux-networking.zip && rm linux-networking.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22239.zip -OutFile "$d\linux-networking.zip"; Expand-Archive "$d\linux-networking.zip" -DestinationPath $d -Force; ri "$d\linux-networking.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して linux-networking.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → linux-networking フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

linux-networking

目的

このスキルは、NetplanによるIP設定、UFWまたはNftablesによるファイアウォール管理、DNS設定、WireguardまたはTailscaleによるVPN設定、System76などのシステムにおけるインスタンス間ルーティングを含む、Linuxのネットワークタスクを処理します。

使用場面

Ubuntu/Debianシステムでのサーバーセットアップ、ファイアウォールによるアプリケーションの保護、VPNを介した安全なリモートアクセス確立、コンテナ化された環境でのDNS問題解決、データセンターやエッジデバイスにおけるネットワークインスタンス間のルーティング最適化にこのスキルを使用してください。

主要な機能

  • Netplan YAMLファイルを使用して静的/動的IPアドレスを設定します(例:インターフェースをDHCPまたは静的IPに設定)。
  • UFWでシンプルなルール(例:ポートの許可/拒否)を、Nftablesでテーブルとチェーンを介した高度なパケットフィルタリングを管理します。
  • systemd-resolvedや/etc/resolv.confの編集などのツールでDNS解決を処理します。
  • VPNを設定します:wg-quickを使用したピアツーピアトンネルにはWireguard、キー認証による自動メッシュネットワークにはTailscaleを使用します。
  • System76ハードウェアでインスタンス間ルーティングを実装します。例えば、複数デバイス間の通信のためにOSPFや静的ルートを設定します。

使用パターン

常にsudoでコマンドを実行し、root権限を使用してください。スクリプトの場合、NetworkManagerやsystemd-networkdなどのサービスがアクティブであるかを確認してください。機密データには環境変数を使用してください。例えば、Tailscale操作の前にexport TAILSCALE_API_KEY=$SERVICE_API_KEYを実行します。AIの応答では、タスクを順次コマンドとして構成してください。まず設定ファイルを検証し、次に変更を適用し、最後に診断ツールで確認します。自動化の場合、set -eを使用して失敗時に終了するなど、エラーチェックを含むbashスクリプトにコマンドをラップしてください。

一般的なコマンド/API

  • Netplan設定:/etc/netplan/01-netcfg.yamlnetwork: version: 2 renderer: networkd ethernets: eno1: dhcp4: trueのような内容で編集し、sudo netplan applyを実行します。
  • UFWファイアウォール:sudo ufw enableで有効にし、sudo ufw allow 22/tcpのようなルールを追加し、sudo ufw status verboseでステータスを確認します。
  • Nftablesファイアウォール:/etc/nftables.confからルールをロードし(例:table ip filter { chain input { type filter hook input priority 0; policy accept; } })、sudo nft -f /etc/nftables.confで適用します。
  • DNS管理:/etc/resolv.confを編集し(例:nameserver 8.8.8.8を追加)、またはsystemd-resolve --set-dns=8.8.8.8 eth0を使用します。
  • Wireguard VPN:wg genkey | tee privatekey | wg pubkey > publickeyでキーを生成し、/etc/wireguard/wg0.conf[Interface] PrivateKey = <key> Address = 10.0.0.1/24で設定し、sudo wg-quick up wg0で起動します。
  • Tailscale VPN:tailscale up --authkey $TAILSCALE_API_KEYで認証し、Tailscale APIを介してピアを管理します(例:GET https://api.tailscale.com/api/v2/devices)。
  • インスタンス間ルーティング:sudo ip route add 192.168.1.0/24 via 10.0.0.1で静的ルートを追加するか、vtyshでrouter ospfのようなコマンドを使用してSystem76でquaggaを使ってOSPFを設定します。

統合に関する注意点

Ansibleのようなオーケストレーションツールと統合するには、Netplanコマンドを実行するためのansible.builtin.shellモジュールや、ファイアウォールルール用のcommunity.general.ufwモジュールを使用します。Tailscaleの場合、APIキーを環境変数(例:$TAILSCALE_API_KEY)経由で渡し、デバイス管理にはHTTP APIを使用します。Wireguardはsudo systemctl enable wg-quick@wg0でサービスを有効にすることでsystemdと統合します。NetplanのためにNetworkManagerを無効にすることで互換性を確保します(例:sudo systemctl stop NetworkManager)。DNSの場合、/etc/resolv.confをマウントすることでコンテナ内のsystemd-resolvedと連携させます。変更を適用する前に、nmcliip aなどのツールで常に設定を検証してください。

エラー処理

sudoをコマンドの前に付けて権限エラーを確認します。netplan applyが「Invalid YAML」で失敗した場合は、yamllint /etc/netplan/01-netcfg.yamlでファイルを検証します。UFW/Nftablesの場合、sudo ufw statusまたはsudo nft list rulesetを使用してルールをデバッグします。一般的な問題にはポートの競合があり、ss -tulnで確認して解決します。VPNエラー:Wireguardが起動しない場合は、wg showでキーを確認し、journalctl -u wg-quick@wg0でログを確認します。Tailscaleの場合、認証失敗は$TAILSCALE_API_KEYを再エクスポートして再試行することで処理します。ルーティングの問題:ip route showで診断します。ルートが伝播しない場合は、sudo systemctl restart networkingでネットワークを再起動します。スクリプトでは常に>> error.log 2>&1を使用して出力をログに記録してください。

具体的な使用例

  1. Ubuntuで基本的なファイアウォールを設定します。まず、sudo ufw enableでUFWを有効にします。次に、SSHを許可します:sudo ufw allow 22。確認します:sudo ufw status。これにより、リモートアクセスを許可しつつサーバーを保護します。
  2. Wireguard VPNトンネルを設定します。/etc/wireguard/wg0.conf[Interface] Address = 10.0.0.1/24 PrivateKey = <generated_key>という設定ファイルを作成します。起動します:sudo wg-quick up wg0。接続をテストします:ping 10.0.0.2。これにより、インスタンス間に安全なリンクが確立されます。

グラフの関係

  • クラスターに関連:linux
  • タグを介して接続:networking (直接リンク), linux (クラスター親), firewall (サブスキル), vpn (依存関係), tailscale (特定のツール)
  • 発信エッジ:より広範な保護のためにlinux-securityと統合、ネットワークマウントされたボリュームのためにlinux-storageにリンク
  • 受信エッジ:コアOSコマンドのためにlinux-basicsに依存、自動化ワークフローのためにdevops-toolsから参照
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

linux-networking

Purpose

This skill handles Linux networking tasks, including IP configuration with Netplan, firewall management via UFW or Nftables, DNS setup, VPN configuration for Wireguard or Tailscale, and inter-instance routing on systems like System76.

When to Use

Use this skill for server setup on Ubuntu/Debian systems, securing applications with firewalls, establishing secure remote access via VPN, resolving DNS issues in containerized environments, or optimizing routing between networked instances in data centers or edge devices.

Key Capabilities

  • Configure static/dynamic IP addresses using Netplan YAML files (e.g., set interface to DHCP or static IP).
  • Manage firewalls with UFW for simple rules (e.g., allow/deny ports) or Nftables for advanced packet filtering via tables and chains.
  • Handle DNS resolution with tools like systemd-resolved or /etc/resolv.conf edits.
  • Set up VPNs: Wireguard for peer-to-peer tunnels using wg-quick, or Tailscale for automatic mesh networks with key authentication.
  • Implement inter-instance routing on System76 hardware, such as setting up OSPF or static routes for multi-device communication.

Usage Patterns

Always run commands with sudo for root privileges. For scripts, check if services like NetworkManager or systemd-networkd are active. Use environment variables for sensitive data, e.g., export TAILSCALE_API_KEY=$SERVICE_API_KEY before Tailscale operations. In AI responses, structure tasks as sequential commands: first validate config files, then apply changes, and finally verify with diagnostic tools. For automation, wrap commands in bash scripts with error checks, e.g., use set -e to exit on failure.

Common Commands/API

  • Netplan configuration: Edit /etc/netplan/01-netcfg.yaml with content like network: version: 2 renderer: networkd ethernets: eno1: dhcp4: true, then run sudo netplan apply.
  • UFW firewall: Enable with sudo ufw enable, add rules like sudo ufw allow 22/tcp, and check status with sudo ufw status verbose.
  • Nftables firewall: Load rules from /etc/nftables.conf (e.g., table ip filter { chain input { type filter hook input priority 0; policy accept; } }), then apply with sudo nft -f /etc/nftables.conf.
  • DNS management: Edit /etc/resolv.conf (e.g., add nameserver 8.8.8.8), or use systemd-resolve --set-dns=8.8.8.8 eth0.
  • Wireguard VPN: Generate keys with wg genkey | tee privatekey | wg pubkey > publickey, configure /etc/wireguard/wg0.conf with [Interface] PrivateKey = <key> Address = 10.0.0.1/24, and start with sudo wg-quick up wg0.
  • Tailscale VPN: Authenticate with tailscale up --authkey $TAILSCALE_API_KEY, then manage peers via Tailscale API (e.g., GET https://api.tailscale.com/api/v2/devices).
  • Inter-instance routing: Add static routes with sudo ip route add 192.168.1.0/24 via 10.0.0.1, or configure OSPF on System76 using quagga with commands like router ospf in vtysh.

Integration Notes

Integrate with orchestration tools like Ansible by using modules such as ansible.builtin.shell for running Netplan commands, or community.general.ufw for firewall rules. For Tailscale, pass API keys via environment variables (e.g., $TAILSCALE_API_KEY) and use their HTTP API for device management. Wireguard integrates with systemd by enabling services via sudo systemctl enable wg-quick@wg0. Ensure compatibility with NetworkManager by disabling it for Netplan (e.g., sudo systemctl stop NetworkManager). For DNS, link with systemd-resolved in containers by mounting /etc/resolv.conf. Always validate configs with tools like nmcli or ip a before applying changes.

Error Handling

Check for permission errors by prefixing commands with sudo; if netplan apply fails with "Invalid YAML", validate the file with yamllint /etc/netplan/01-netcfg.yaml. For UFW/Nftables, use sudo ufw status or sudo nft list ruleset to debug rules; common issues include port conflicts—resolve by checking with ss -tuln. VPN errors: If Wireguard fails to start, verify keys with wg show and check logs with journalctl -u wg-quick@wg0; for Tailscale, handle authentication failures by re-exporting $TAILSCALE_API_KEY and retrying. Routing problems: Use ip route show to diagnose; if routes don't propagate, restart networking with sudo systemctl restart networking. Always log outputs in scripts using >> error.log 2>&1.

Concrete Usage Examples

  1. Set up a basic firewall on Ubuntu: First, enable UFW with sudo ufw enable. Then, allow SSH: sudo ufw allow 22. Verify: sudo ufw status. This secures the server while permitting remote access.
  2. Configure a Wireguard VPN tunnel: Create a config file at /etc/wireguard/wg0.conf with [Interface] Address = 10.0.0.1/24 PrivateKey = <generated_key>. Start it: sudo wg-quick up wg0. Test connectivity: ping 10.0.0.2. This establishes a secure link between instances.

Graph Relationships

  • Related to cluster: linux
  • Connected via tags: networking (direct link), linux (cluster parent), firewall (sub-skill), vpn (dependency), tailscale (specific tool)
  • Outgoing edges: integrates with linux-security for broader protection, links to linux-storage for network-mounted volumes
  • Incoming edges: depends on linux-basics for core OS commands, referenced by devops-tools for automation workflows