Photonicat 2 Smart WAN 智能上网
| 适用 / Applies to | Photonicat 2, photonicatWrt 26.04.1+ 与 pcat-manager-web 2026-06 及以后版本 / Photonicat 2 with photonicatWrt 26.04.1+ and pcat-manager-web builds from 2026-06 onward |
|---|
Smart WAN(智能上网)让 photonicat 2 像手机一样使用上游 WiFi:保存多个热点、自动回连信号最强的已知网络、识别强制门户(酒店/机场登录页)、支持企业级 802.1x 网络,并在 WiFi 不可用时自动切换回有线/蜂窝网络。
Smart WAN makes the photonicat 2 treat upstream WiFi like a phone does: save multiple hotspots, auto-reconnect to the strongest known network, detect captive portals (hotel/airport login pages), join enterprise 802.1x networks, and fail over to ethernet/cellular automatically when WiFi is unusable.
中文说明
功能总览
- 已保存网络 + 自动回连:像手机一样保存多个上游 WiFi。设备每 60 秒巡检一次:已连接则保持;掉线则扫描并自动加入信号最强的已保存网络;周围没有已知网络时让无线待机,流量自动回落到有线/蜂窝。
- 强制门户检测:优先用 HTTPS 探测(证书有效的 200 响应不可能被门户伪造),HTTPS 失败再用 HTTP 区分"被门户劫持"和"链路彻底没网"。检测到门户后界面会显示门户徽标。
- 检测到无网时自动降级:把 WiFi 上行的路由 metric 调低优先级,出口流量立即切换到有线/蜂窝,WiFi 链路保持连接以便你完成门户登录;恢复联网后自动还原优先级。
- 自动登录命令:可为每个已保存网络配置一条登录命令(如 curl 提交门户表单)。检测到门户时自动执行,环境变量
$WIFI_WAN_IFACE、$WIFI_WAN_GATEWAY可用。常连的酒店/公司门户可实现全自动上网。 - 企业级 802.1x(PEAP/TTLS):支持连接需要用户名+密码的企业/校园网(eduroam 类)。设备会自动探测 wpad 是否具备 EAP 能力,具备时界面才显示相关字段。
- 每 SSID 固定私有 MAC:仿 iPhone 的"私有地址"——对每个 SSID 使用一个稳定的随机 MAC。既不暴露硬件地址,又保证重连后门户授权和 DHCP 租约仍然有效。
使用方法
- 打开管理界面(默认
http://172.16.0.1)→ 设备控制页面,网络模式选择 Smart WAN。 - 点击扫描,选择目标热点输入密码即可保存并连接;企业网络会出现 EAP 身份/密码字段。
- 可选项:
- 私有 MAC 开关(默认建议开启);
- 自动登录命令(连接需要网页登录的热点时填写)。
- 之后设备会自动维护连接,无需人工干预。
排障
- 界面显示门户徽标但没弹登录页 → 用手机/电脑连到 photonicat 的下游 WiFi,浏览任意 http:// 网站即可触发门户。
- WiFi 已连接但流量走了蜂窝 → 说明门户探测判定该 WiFi 无法上网(可能需要登录);完成登录后约一分钟内自动切回。
- 企业网络字段不出现 → 固件的 wpad 不支持 EAP,需要更新到 26.04.1 及以上官方固件。
English
Feature overview
- Saved networks + auto-reconnect: save multiple upstream hotspots, phone-style. A reconciler runs every 60 s: stay put if associated; otherwise scan and join the strongest saved network in range; if none is reachable the radio idles and traffic falls back to ethernet/cellular via route metrics.
- Captive-portal detection: HTTPS-first probing (a valid-TLS 200 cannot be spoofed by a portal), falling back to HTTP to distinguish "hijacked by a portal" from "dead uplink". A portal badge appears in the UI when one is detected.
- Automatic demotion when offline: the WiFi uplink's route metric is demoted so egress instantly fails over to ethernet/cellular, while the WiFi link stays associated so you can complete the portal login; the metric is restored on recovery.
- Per-network auto-login command: attach a login command (e.g. a curl form submission) to any saved network; it runs automatically on portal detection with
$WIFI_WAN_IFACEand$WIFI_WAN_GATEWAYexported. Frequent hotel/office portals become fully hands-free. - Enterprise 802.1x (PEAP/TTLS): join username+password enterprise/campus networks (eduroam-style). The device probes wpad for EAP capability and only then offers the fields.
- Stable per-SSID private MAC: iPhone-style private addressing — one stable random MAC per SSID, hiding the hardware address while keeping portal authorizations and DHCP leases valid across reconnects.
How to use
- Open the manager UI (default
http://172.16.0.1) → Device Control, select network mode Smart WAN. - Scan, pick the hotspot, enter the password to save & connect; enterprise networks expose EAP identity/password fields.
- Optional: the private MAC toggle (recommended on) and the auto-login command for web-login hotspots.
- The device maintains the connection autonomously from then on.
Troubleshooting
- Portal badge shown but no login page → connect a phone/laptop to the photonicat's downstream WiFi and browse any http:// site to trigger it.
- WiFi associated but traffic uses cellular → the probe judged that WiFi offline (login likely required); after logging in it switches back within a minute.
- No enterprise fields → the firmware's wpad lacks EAP support; update to official 26.04.1+.
相关:让 photonicat 自己发布访客登录页 / Related: serving a guest splash page yourself | IPv6 术语表 Glossary