Communitygithub.com

homelab-network-setup

實用的家庭與 Homelab 網路規劃指南,涵蓋閘道器、交換器、存取點、IP 範圍、DHCP 保留、DNS、佈線及常見初學者錯誤。當您規劃或修復家庭或 Homelab 網路(閘道器、交換器、AP、IP 範圍、DHCP、DNS 或佈線)時使用。

homelab-network-setup 是什麼?

這個 AI Agent 技能提供了一個完整的家庭或小型實驗室網路設計指南,其設計目標是讓網路能夠在不全面重建的情況下持續擴展。它詳細說明了如何規劃閘道器、交換器和存取點的角色,並提供了常見設備(如 ISP 路由器、UniFi 閘道器、OPNsense/pfSense、MikroTik 及 Linux 路由器)的最佳應用場景與取捨建議。技能提供了範例 IP 規劃,建議避開易與 VPN 衝突的 `192.168.1.0/24` 子網,並推薦使用 `home.arpa` 作為本地域名,以避免洩漏或衝突。此外,還涵蓋了 DHCP 保留策略(用於需要穩定地址的服務器與設備)、佈線最佳實踐(優先使用有線回程及 PoE 交換器),以及常見的反模式,例如未經審慎考慮就使用雙重 NAT、動態分配服務器 IP,或讓 IoT、伺服器與筆記型電腦共用同一平面網路。支援所有主要平台,包括 Claude Code、Cursor 和 Codex。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/homelab-network-setup

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Homelab 網路設定

使用此技能設計一個能夠在不需全面重建的情況下擴展的家庭或小型實驗室網路。

使用時機

  • 規劃新的家庭網路或重新設計僅有 ISP 路由器的設定。
  • 選擇閘道器、交換器和存取點的角色。
  • 設計 IP 範圍、DHCP 領域、靜態保留與 DNS。
  • 為未來的 VLAN、Pi-hole、NAS、實驗室伺服器或 VPN 存取做準備。
  • 疑難排解出現雙重 NAT、Wi-Fi 不穩定或伺服器位址變動的新網路。

運作方式

從區分設備角色開始:

網際網路
  |
數據機或 ONT
  |
閘道器或路由器      NAT、防火牆、DHCP、DNS、跨 VLAN 路由
  |
受管交換器         有線用戶端、AP 上行鏈路、可選 VLAN 主幹
  |
存取點            僅限 Wi-Fi;理想情況下需有有線回程
伺服器與 NAS       穩定位址、DNS 名稱、監控
用戶端與 IoT       DHCP 池,日後若可使用 VLAN,則可將其隔離

選擇符合營運商需求的閘道器,而不是只看功能清單:

選項最適合備註
ISP 路由器僅供基本網路連線控制能力有限,VLAN 支援常不佳
UniFi 閘道器受管家庭網路介面優良,生態系鎖定
OPNsense 或 pfSense靈活的 Homelab強大的 VLAN、防火牆、VPN 與 DNS 控制
MikroTik進階網路使用者功能強大,但容易誤設
Linux 路由器愛好者若用作主要閘道器,請先記錄回滾方案

IP 規劃

若您預計會使用 VPN,請避免最常見的預設值 192.168.1.0/24。它經常與旅館、辦公室和 ISP 路由器衝突。

小型 Homelab 規劃範例:

192.168.10.0/24  受信任的用戶端
192.168.20.0/24  IoT 與媒體裝置
192.168.30.0/24  伺服器與 NAS
192.168.40.0/24  訪客 Wi-Fi
192.168.99.0/24  網路管理

閘道器慣例:.1
基礎設施保留:.2 至 .49
動態 DHCP 池:.50 至 .240
備用空間:.241 至 .254

使用 home.arpa 作為本地名稱。它是為家庭網路保留的,可避免像 home.lan 這類臨時名稱的洩漏/衝突問題。

nas.home.arpa
pihole.home.arpa
gateway.home.arpa
switch-01.home.arpa

DHCP 與 DNS

  • 為任何您會透過 SSH 登入、加入書籤、監控或作為服務公開的設備使用 DHCP 保留。
  • 在尚未刻意部署本地解析器之前,將閘道器作為 DNS 發放。
  • 若使用 Pi-hole 或其他 DNS 過濾器,先為它設定保留,再將 DHCP DNS 選項指向該位址。
  • 每個子網保留一個小的靜態/保留範圍,以便更換設備時不會與動態租約衝突。

佈線與 Wi-Fi

  • 在可以拉設乙太網路線的情況下,優先使用有線 AP 回程而非 Mesh。
  • 若預算允許,使用 PoE 交換器供電給 AP 和攝影機。
  • 在每條線纜的兩端貼上標籤,並維護簡單的連接埠對照表。
  • 若停電常見,請將閘道器、交換器、DNS 伺服器和 NAS 接上 UPS 電源。

範例

新手升級

目標:保留 ISP 路由器,但穩定小型實驗室。

  1. 為 NAS、Pi 和任何 SSH 主機設定 DHCP 保留。
  2. 將本地名稱移至 home.arpa。
  3. 停用次要路由器或 AP 上的重複 DHCP 伺服器。
  4. 有線連接主要 AP,而非依賴無線回程。

準備 VLAN 的計畫

目標:為未來的分割做準備,但不立即啟用。

  1. 為信任、IoT、伺服器、訪客和管理選擇不重疊的 /24 範圍。
  2. 在每個子網上保留 .1 給閘道器,.2 至 .49 給基礎設施。
  3. 購買支援 VLAN 和跨 VLAN 防火牆規則的閘道器與交換器。
  4. 記錄哪些 SSID 和交換器連接埠最終會對應到每個網路。

反模式

  • 無正當理由或文件說明的雙重 NAT。
  • 規劃 VPN 存取時仍使用 192.168.1.0/24。
  • 為 NAS、Pi-hole、Home Assistant 或其他服務主機使用動態位址。
  • 消費級路由器被重新用作 AP,但其 DHCP 伺服器仍保持啟用。
  • 攝影機、智慧插座、筆記型電腦與伺服器共用相同信任邊界的平面網路。

另請參閱

  • 技能:network-interface-health
  • 技能:network-config-validation

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

相關技能