Communitygithub.com

家庭实验室网络设置

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

家庭实验室网络设置 是什么?

该技能旨在帮助用户设计一个可扩展且稳定的家庭或小型实验室网络,避免需要进行全面重建。它提供了清晰的设备角色分离指导(互联网 -> 调制解调器 -> 网关 -> 托管交换机 -> 接入点 -> 服务器/客户端),并针对不同类型的网关(如 ISP 路由器、UniFi、OPNsense、MikroTik、Linux 路由器)给出了最佳适用场景建议。技能还包含了一个完整的 IP 规划示例,强烈建议避免使用默认的 `192.168.1.0/24` 网段,尤其是在计划使用 VPN 时,并推荐使用 `home.arpa` 域进行本地名称解析。此外,技能详细阐述了 DHCP 和 DNS 的最佳实践(使用保留地址、部署本地解析器)、布线建议(优先有线回传、使用 PoE 交换机、标记网线),并提供了“初学者升级”和“准备 VLAN”两种典型场景的逐步示例。最后,它列举了常见的反模式(如双重 NAT、动态地址分配给关键服务),帮助用户避免典型陷阱。该技能适用于 Claude Code、Cursor 等开发工具,其内容基于详细的 SKILL.md 文档。

兼容平台~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 的新对话。

文档

家庭实验室网络设置 是做什么的?

使用此技能设计一个可随需扩展而无需全面重建的家庭或小型实验室网络。

何时使用

  • 规划新的家庭网络或重新设计仅使用 ISP 路由器的设置。
  • 选择网关、交换机和接入点的角色。
  • 设计 IP 范围、DHCP 作用域、静态保留和 DNS。
  • 为未来的 VLAN、Pi-hole、NAS、实验室服务器或 VPN 访问做准备。
  • 排查存在双重 NAT、Wi-Fi 不稳定或服务器地址变动等问题的网络。

工作原理

首先,分离设备角色:

互联网
  |
调制解调器或 ONT
  |
网关或路由器      NAT、防火墙、DHCP、DNS、VLAN 间路由
  |
托管交换机         有线客户端、AP 上行链路、可选 VLAN 中继
  |
接入点             仅用于 Wi-Fi;理想情况下使用有线回传
服务器和 NAS        稳定的地址、DNS 名称、监控
客户端和物联网设备  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  物联网和媒体设备
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、树莓派和任何 SSH 主机设置 DHCP 保留。
  2. 将本地名称迁移到 home.arpa。
  3. 禁用辅助路由器或 AP 上的重复 DHCP 服务器。
  4. 将主 AP 通过有线连接,而非依赖无线回传。

准备 VLAN 的计划

目标:为未来的网络分段做准备,而不立即启用。

  1. 为受信任、物联网、服务器、访客和管理选择不重叠的 /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.

相关技能