Communitygithub.com

homelab-network-setup

用于规划家庭或实验室网络的实用技能,涵盖网关、交换机、接入点、IP 范围、DHCP 保留、DNS、布线以及常见新手错误。在规划或修复家庭/实验室网络(网关、交换机、AP、IP 范围、DHCP、DNS 或布线)时使用。

homelab-network-setup 是什么?

该技能旨在帮助开发者或 AI 代理用户设计一个可随需求增长而扩展的家庭或小型实验室网络,而无需完全重建。它详细指导如何分离网关、交换机、接入点等设备角色,并提供根据运营商和功能需求选择网关(如 ISP 路由器、UniFi、OPNsense、MikroTik、Linux 路由器)的对比表。技能强调了避免使用默认 `192.168.1.0/24` 地址段的重要性(尤其在 VPN 场景下),并给出了一个包含信任客户端、IoT 设备、服务器/ NAS 等子网的 IP 规划示例。它还涵盖了 DHCP 和 DNS 最佳实践(如使用 `home.arpa` 域名、为关键设备设置静态保留)、布线建议(优先有线回程、使用 PoE 交换机、标记线缆)以及常见反模式(如双重 NAT、动态地址用于服务主机、未禁用的消费者路由器 DHCP 等)。支持所有主流 AI 代理平台(如 Claude Code、Cursor、Codex 等),通过结构化的 Markdown 文档提供即用型指南。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/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灵活的实验室强大的 VLAN、防火墙、VPN 和 DNS 控制
MikroTik高级网络用户功能强大,但容易配置错误
Linux 路由器折腾爱好者在作为主网关前请记录回滚方案

IP 规划

如果您计划使用 VPN,请避免最常见的默认地址段 192.168.1.0/24。它经常与酒店、办公室和 ISP 路由器的地址冲突。

小型实验室规划示例:

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 回程而非网格网络。
  • 如果预算允许,请为 AP 和摄像头使用 PoE 交换机。
  • 标记每根电缆的两端,并保留简单的端口映射。
  • 在断电常见的情况下,将网关、交换机、DNS 服务器和 NAS 连接到 UPS 电源。

示例

初学者升级

目标:保留 ISP 路由器,但稳定一个小型实验室。

  1. 为 NAS、树莓派和任何 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/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

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.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

相关技能