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

macos-networking

WiFi/Ethernet, DNS, proxy, VPN Tailscale, airport CLI, pfctl firewall

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

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

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

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

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して macos-networking.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → macos-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 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

macos-networking

目的

このスキルは、macOSのネットワークコンポーネント(WiFi、Ethernet、DNS、プロキシ、Tailscale VPN、pfctlファイアウォールなど)を管理するためのツールを提供し、ネットワーク設定タスクを自動化または支援します。

使用場面

このスキルは、macOS固有のネットワーク操作を扱う際に使用します。例えば、接続のトラブルシューティング、セキュアなVPNの構成、アプリケーションのDNS管理、スクリプトやユーザーインタラクションでのファイアウォールルールの適用などです。

主な機能

  • networksetupおよびairport CLIを介したWiFiおよびEthernet管理(ネットワークへの接続、スキャン、切り替え)。
  • networksetupを使用したDNS構成(Google DNS(例:8.8.8.8)などのサーバー設定)。
  • networksetupを使用したプロキシ設定(認証を含むHTTP/SOCKSプロキシ)。
  • Tailscale CLIと認証キーを必要とする、ピアツーピアネットワーキングのためのTailscale VPN統合。
  • pfctlを介したファイアウォール制御(ルールセットのロード、有効化/無効化、トラフィックの監視)。
  • Airport CLI(macOSの一部)によるワイヤレス診断(ネットワークのスキャンなど)。
  • 特定のツール:ほとんどの設定にはnetworksetup、VPNにはtailscale、パケットフィルタリングにはpfctl

使用パターン

必要な場合は、常にsudoを使用して昇格された権限でコマンドを実行してください。スクリプトの場合、まずtailscaleなどのツールがインストールされているかを確認してください。機密データには環境変数を使用してください。例えば、Tailscaleコマンドを実行する前にexport TAILSCALE_AUTH_KEY=$SERVICE_API_KEYとします。AIの応答と統合するには、ユーザーがコピー&ペーストできるbashスニペットを生成します。

例1:特定のWiFiネットワークに切り替える。

  • このパターンを使用します:まずairport en0 scanでネットワークをスキャンし、次にnetworksetup -setairportnetwork en0 SSID passwordで接続します。

例2:Tailscale VPNを設定する。

  • 認証して接続します:認証キーをexport TAILSCALE_AUTH_KEY=$SERVICE_API_KEYとしてエクスポートし、次にtailscale up --authkey=$TAILSCALE_AUTH_KEYを実行します。

一般的なコマンド/API

スクリプトや応答では、これらの正確なコマンドを使用してください。すべてmacOS環境が必要です。

  • WiFi:/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport en0 scanでネットワークをスキャンします。接続:sudo networksetup -setairportnetwork en0 "NetworkName" "Password"
  • Ethernet:有効化/無効化:sudo networksetup -setnetworkserviceenabled Ethernet on/off
  • DNS:Wi-Fiのサーバーを設定:sudo networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4。キャッシュをフラッシュ:sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • プロキシ:HTTPプロキシを設定:sudo networksetup -setwebproxy Wi-Fi proxy.example.com 8080。認証付きで有効化:sudo networksetup -setwebproxyusername Wi-Fi username -setwebproxypassword Wi-Fi password
  • Tailscale VPN:必要に応じてbrew install tailscaleでインストールします。認証:tailscale up --authkey=$TAILSCALE_AUTH_KEY。ステータス:tailscale status --json
  • pfctlファイアウォール:ルールをロード:sudo pfctl -f /etc/pf.conf。有効化:sudo pfctl -e。トラフィックをブロック:/etc/pf.confにblock in on en0 proto tcp from any to any port 80のようなルールを追加し、リロードします。

WiFi接続のコードスニペット:

#!/bin/bash
network=$(airport en0 scan | grep -o 'SSID: .\+' | cut -d' ' -f2-)
echo "Available networks: $network"
sudo networksetup -setairportnetwork en0 "$1" "$2"

Tailscaleセットアップのコードスニペット:

#!/bin/bash
export TAILSCALE_AUTH_KEY=$SERVICE_API_KEY
tailscale up --authkey=$TAILSCALE_AUTH_KEY
tailscale status

統合に関する注意点

AIが生成したスクリプトでコマンドをラップして統合します。Tailscaleの場合、ハードコーディングを避けるために認証キーが$TAILSCALE_AUTH_KEYを介して渡されることを確認してください。依存関係を確認します:command -v tailscale >/dev/null 2>&1 || brew install tailscaleを使用します。pfctlの場合、/etc/pf.confを直接またはスクリプトを介して編集し、リロードします。システムサービスとの競合を避けてください。関連するデーモンを管理するためにlaunchctlを使用します。例えば、sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.pfctl.plist。まず非本番環境でテストしてください。

エラー処理

ルート権限が必要なすべてのコマンドに対してsudoで権限を処理します。終了コードをチェックして失敗を捕捉します。例えば、if $? -ne 0の場合、「コマンドが失敗しました。sudoアクセスを確認してください。」とログに記録します。ネットワークエラーの場合、続行する前にpingを使用して接続を確認します。Tailscale認証の失敗:$TAILSCALE_AUTH_KEYが設定され、有効であることを確認します。tailscale logout && tailscale upで再試行します。pfctlの問題:「no ALTQ support」の場合、kextstat | grep pfでカーネル拡張がロードされていることを確認します。一般的なエラー:インターフェースが見つからないエラー(例:en0がない)—ifconfig -lを使用して利用可能なインターフェースをリストし、コマンドを調整します。

グラフの関係

  • クラスター「macos」に関連(例:macos-file-system、macos-securityスキルと依存関係を共有)。
  • タグによる関連:「networking」(一般的なネットワーキングスキルに接続)、「vpn」(リモートアクセススキルにリンク)、「firewall」(セキュリティ監視スキルに関連付け)、「dns」(ドメイン解決スキルと統合)。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

macos-networking

Purpose

This skill provides tools for managing macOS networking components, including WiFi, Ethernet, DNS, proxies, Tailscale VPN, and the pfctl firewall, to automate or assist in network configuration tasks.

When to Use

Use this skill when handling macOS-specific network operations, such as troubleshooting connectivity, configuring secure VPNs, managing DNS for applications, or enforcing firewall rules in scripts or user interactions.

Key Capabilities

  • WiFi and Ethernet management via networksetup and airport CLI for connecting, scanning, or switching networks.
  • DNS configuration using networksetup to set servers like Google DNS (e.g., 8.8.8.8).
  • Proxy setup with networksetup for HTTP/SOCKS proxies, including authentication.
  • Tailscale VPN integration for peer-to-peer networking, requiring Tailscale CLI and an auth key.
  • Firewall control via pfctl for loading rulesets, enabling/disabling, and monitoring traffic.
  • Airport CLI (part of macOS) for wireless diagnostics, like scanning networks.
  • Specific tools: networksetup for most settings, tailscale for VPN, and pfctl for packet filtering.

Usage Patterns

Always run commands with elevated privileges using sudo where needed. For scripts, check if tools like tailscale are installed first. Use environment variables for sensitive data, e.g., export TAILSCALE_AUTH_KEY=$SERVICE_API_KEY before running Tailscale commands. Integrate with AI responses by generating bash snippets that users can copy-paste.

Example 1: Switch to a specific WiFi network.

  • Use this pattern: First, scan networks with airport en0 scan, then connect via networksetup -setairportnetwork en0 SSID password.

Example 2: Set up Tailscale VPN.

  • Authenticate and connect: Export your auth key as export TAILSCALE_AUTH_KEY=$SERVICE_API_KEY, then run tailscale up --authkey=$TAILSCALE_AUTH_KEY.

Common Commands/API

Use these exact commands in scripts or responses. All require macOS environment.

  • WiFi: Scan networks with /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport en0 scan. Connect: sudo networksetup -setairportnetwork en0 "NetworkName" "Password".
  • Ethernet: Enable/disable: sudo networksetup -setnetworkserviceenabled Ethernet on/off.
  • DNS: Set servers for Wi-Fi: sudo networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4. Flush cache: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder.
  • Proxy: Set HTTP proxy: sudo networksetup -setwebproxy Wi-Fi proxy.example.com 8080. Enable with auth: sudo networksetup -setwebproxyusername Wi-Fi username -setwebproxypassword Wi-Fi password.
  • Tailscale VPN: Install via brew install tailscale if needed. Authenticate: tailscale up --authkey=$TAILSCALE_AUTH_KEY. Status: tailscale status --json.
  • pfctl Firewall: Load rules: sudo pfctl -f /etc/pf.conf. Enable: sudo pfctl -e. Block traffic: Add rule in /etc/pf.conf like block in on en0 proto tcp from any to any port 80, then reload.

Code snippet for WiFi connection:

#!/bin/bash
network=$(airport en0 scan | grep -o 'SSID: .\+' | cut -d' ' -f2-)
echo "Available networks: $network"
sudo networksetup -setairportnetwork en0 "$1" "$2"

Code snippet for Tailscale setup:

#!/bin/bash
export TAILSCALE_AUTH_KEY=$SERVICE_API_KEY
tailscale up --authkey=$TAILSCALE_AUTH_KEY
tailscale status

Integration Notes

Integrate by wrapping commands in AI-generated scripts. For Tailscale, ensure the auth key is passed via $TAILSCALE_AUTH_KEY to avoid hardcoding. Check dependencies: Use command -v tailscale >/dev/null 2>&1 || brew install tailscale. For pfctl, edit /etc/pf.conf directly or via scripts, then reload. Avoid conflicts with system services; use launchctl to manage related daemons, e.g., sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.pfctl.plist. Test in a non-production environment first.

Error Handling

Handle permissions with sudo for all root-required commands; catch failures by checking exit codes, e.g., if $? -ne 0, log "Command failed, check sudo access." For network errors, use ping to verify connectivity before proceeding. Tailscale auth failures: Check if $TAILSCALE_AUTH_KEY is set and valid; retry with tailscale logout && tailscale up. pfctl issues: If "no ALTQ support", ensure kernel extensions are loaded via kextstat | grep pf. Common: Interface not found errors (e.g., en0 missing)—use ifconfig -l to list available interfaces and adjust commands.

Graph Relationships

  • Related to cluster: "macos" (e.g., shares dependencies with macos-file-system, macos-security skills).
  • Related by tags: "networking" (connects to general-networking skills), "vpn" (links to remote-access skills), "firewall" (associates with security-monitoring skills), "dns" (integrates with domain-resolution skills).