Skip to Content
Guides网络设备评估

网络设备评估

本指南为 WireGuard、DNS 和路由实验室创建双接口 Debian 映像。生产使用需要精确的接口映射、经过审查的防火墙策略、真正的密钥保管、硬件驱动程序测试和恢复路径。

提示

Create a Debian Trixie headless network-appliance evaluation image with two NICs, SSH, firewall, WireGuard, dnsmasq, nftables, and IP forwarding. Keep WireGuard private keys and site addresses out of the recipe. Create a locked operator account and require key-only SSH only after its public key path is verified. Add a client VM scenario that proves DHCP/DNS behavior, routed traffic, allowed management access, and denied traffic.

配方形状

{ "name": "branch-network-appliance-evaluation", "base_image": "debian-trixie", "hardware": { "platform": "pc", "architecture": "x86_64", "min_cpu_cores": 2, "min_memory_gb": 2, "min_storage_gb": 16, "nic_count": 2 }, "os": { "features": ["headless", "ssh", "firewall", "vpn-wireguard"], "packages": ["dnsmasq", "nftables"], "users": [ { "username": "operator", "groups": ["sudo"], "shell": "/bin/bash" } ], "services": [ { "name": "ssh", "enabled": true, "config": { "port": 2222, "allow_root": false, "disable_password_auth": true } } ], "startup_scripts": [ { "name": "enable-ip-forwarding", "description": "Persist the reviewed IPv4 forwarding setting.", "command": "set -Eeuo pipefail\nprintf '%s\\n' 'net.ipv4.ip_forward = 1' > /etc/sysctl.d/99-openfactory-forwarding.conf\nsysctl --system >/dev/null", "packages": [], "run_as": "root", "after": "network.target" } ] } }

更改 SSH 端口可减少扫描噪音,但不是身份验证控制。仅密钥 SSH 仅在安装并测试工作密钥后才有价值。

测试数据路径,而不仅仅是包

单个虚拟机可以显示 wgdnsmasq 和 nftables 存在并且转发已启用。它不能证明客户的行为。构建至少包含以下内容的拓扑:

  • 具有 WAN 和 LAN 接口的设备;
  • 没有备用默认路由的 LAN 客户端;和
  • 有界上游服务或探测。

验证 DHCP 租约分配、DNS 转发、预期路由、NAT(如果需要)、使用仅测试密钥的 WireGuard 握手、允许的管理访问以及拒绝未经请求的流量。包括负面测试,以便宽松的防火墙无法通过。

部署边界

在部署时,单独检查:

  • 将VM接口顺序映射到物理NIC名称和MAC地址;
  • 私钥生成、存储、轮换和撤销;
  • 批准的子网、路由、转发、NAT 和 DNS 策略;
  • IPv6 行为而不是默默地禁用它;
  • 更新时无需切断管理访问权限;
  • 配置备份和离线恢复;和
  • 链路、DNS、时钟和电源故障后的故障打开/故障关闭行为。

在生产使用之前验证确切的设备硬件。