63 lines
11 KiB
HTML
63 lines
11 KiB
HTML
<div class="hn-first-use">
|
|
<style>
|
|
/* Shared source, embedded in each HN article because the document renderer filters external stylesheets. */
|
|
.doc-body .hn-first-use {
|
|
--guide-accent:var(--theme-color,#a3cc4b);
|
|
--guide-muted:var(--text-muted,#a5adb5);
|
|
--guide-border:var(--border-color,#394047);
|
|
display:flex; flex-direction:column; align-items:stretch; gap:14px;
|
|
max-width:900px; margin:0 auto; color:var(--text-color);
|
|
font-size:16px; font-weight:400; line-height:1.75;
|
|
letter-spacing:normal; word-spacing:normal;
|
|
}
|
|
.doc-body .hn-first-use > * { flex:none; margin:0; }
|
|
.doc-body .hn-first-use p:empty { display:none; }
|
|
.doc-body .hn-first-use p { margin:0; line-height:inherit; letter-spacing:normal; }
|
|
.doc-body .hn-first-use .intro { font-size:17px; }
|
|
.doc-body .hn-first-use .before { color:var(--guide-muted); font-size:14px; }
|
|
.doc-body .hn-first-use h2 { margin:18px 0 0; padding:0; border:0; font-size:23px; line-height:1.45; font-weight:600; }
|
|
.doc-body .hn-first-use h2:first-of-type { margin-top:10px; }
|
|
.doc-body .hn-first-use h3 { margin:0; padding:0; border:0; font-size:15px; line-height:1.6; font-weight:600; }
|
|
.doc-body .hn-first-use strong { font-weight:600; }
|
|
.doc-body .hn-first-use ol { display:flex; flex-direction:column; gap:6px; margin:0; padding:0 0 0 24px; }
|
|
.doc-body .hn-first-use ol > li { position:static; margin:0; padding:0 0 0 3px; line-height:1.75; list-style:decimal; }
|
|
.doc-body .hn-first-use figure { width:100%; margin:0; }
|
|
.doc-body .hn-first-use figure img { display:block; width:100%; height:auto; margin:0; padding:0; border:1px solid var(--guide-border); border-radius:7px; box-shadow:none; }
|
|
.doc-body .hn-first-use figcaption { margin:8px 0 0; font-size:13px; line-height:1.6; color:var(--guide-muted); }
|
|
.doc-body .hn-first-use .compact { max-width:760px; }
|
|
.doc-body .hn-first-use .download { display:inline-flex; align-items:center; align-self:flex-start; min-height:42px; padding:8px 17px; margin:0; border-radius:6px; background:rgba(var(--theme-color-rgb,163,204,75),.12); border:1px solid rgba(var(--theme-color-rgb,163,204,75),.24); color:var(--guide-accent); text-decoration:none; font-size:15px; line-height:1.6; font-weight:500; cursor:pointer; }
|
|
.doc-body .hn-first-use .download:hover { background:rgba(var(--theme-color-rgb,163,204,75),.2); }
|
|
.doc-body .hn-first-use .downloads { display:flex; flex-wrap:wrap; gap:8px; margin:0; }
|
|
.doc-body .hn-first-use .small { color:var(--guide-muted); font-size:13px; line-height:1.7; }
|
|
.doc-body .hn-first-use .alternative { display:block; min-height:40px; margin:0; padding:0 0 0 14px; border-left:2px solid var(--guide-border); font-size:14px; line-height:1.8; }
|
|
.doc-body .hn-first-use .alternative > summary { display:block; min-height:40px; margin:0; padding:7px 0; line-height:26px; list-style:none; cursor:pointer; font-size:14px; font-weight:500; color:var(--guide-muted); transition:color .15s ease; }
|
|
.doc-body .hn-first-use .alternative > summary::-webkit-details-marker { display:none; }
|
|
.doc-body .hn-first-use .alternative > summary::before { content:""; display:inline-block; width:6px; height:6px; margin:0 12px 2px 1px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(-45deg); transition:transform .15s ease; }
|
|
.doc-body .hn-first-use .alternative[open] > summary::before { transform:rotate(45deg); }
|
|
.doc-body .hn-first-use .alternative > summary:hover { color:var(--guide-accent); }
|
|
.doc-body .hn-first-use .alternative > :not(summary) { margin:12px 0 0; }
|
|
.doc-body .hn-first-use .alternative:not([open]) > :not(summary) { display:none; }
|
|
.doc-body .hn-first-use .alternative[open] { padding-bottom:4px; }
|
|
.doc-body .hn-first-use .alternative figure { max-width:760px; }
|
|
.doc-body .hn-first-use .result { font-size:14px; color:var(--guide-muted); }
|
|
.doc-body .hn-first-use .result strong { color:var(--text-color); }
|
|
.doc-body .hn-first-use .troubleshooting { display:flex; flex-direction:column; gap:18px; margin-top:14px; padding-top:24px; border-top:1px solid var(--guide-border); }
|
|
.doc-body .hn-first-use .troubleshooting h2 { margin:0; font-size:20px; }
|
|
.doc-body .hn-first-use .qa { display:flex; flex-direction:column; gap:6px; margin:0; }
|
|
.doc-body .hn-first-use .qa p { margin:0; color:var(--guide-muted); font-size:14px; line-height:1.75; }
|
|
.doc-body .hn-first-use .back { display:inline-block; align-self:flex-start; padding:6px 0; margin:0; font-size:14px; }
|
|
.doc-body .hn-first-use a:focus-visible, .doc-body .hn-first-use summary:focus-visible { outline:2px solid var(--guide-accent); outline-offset:4px; border-radius:3px; }
|
|
.doc-body .hn-first-use code { font-size:.9em; overflow-wrap:anywhere; }
|
|
.doc-body .hn-first-use pre { margin:0; padding:12px 16px; background:rgba(127,127,127,.08); border:1px solid var(--guide-border); border-radius:6px; overflow:auto; line-height:1.7; }
|
|
.doc-body .hn-first-use table { width:100%; border-collapse:collapse; font-size:14px; }
|
|
.doc-body .hn-first-use th,.doc-body .hn-first-use td { padding:10px 12px; text-align:left; border-bottom:1px solid var(--guide-border); }
|
|
@media(max-width:600px) {
|
|
.doc-body .hn-first-use { font-size:15px; gap:12px; }
|
|
.doc-body .hn-first-use .intro { font-size:16px; }
|
|
.doc-body .hn-first-use h2 { font-size:21px; margin-top:16px; }
|
|
.doc-body .hn-first-use h2:first-of-type { margin-top:8px; }
|
|
}
|
|
</style>
|
|
<p class="intro">在 OpenWrt 路由器上使用 <strong>OpenClash</strong>,让接入它的设备使用 hardnerd。</p><p class="before">适用于已运行 OpenWrt 或兼容固件的路由器,需要后台管理权限。本文不包含刷机;开始前,请确认套餐有效。</p><h2>1. 准备路由器和 OpenClash</h2><p class="">电脑连接路由器网络,登录路由器管理后台,先到<strong>系统 → 备份 / 升级</strong>保存当前配置备份。已安装 OpenClash 并准备好内核,可以直接看第 2 步。</p><a class="download" href="/#/docs/2">查看 OpenClash 安装入口</a><p class="">在「所有客户端」中找到 <strong>OpenClash</strong>,进入版本选择页。使用 opkg 的固件选 <strong>.ipk</strong>,使用 apk 的固件选 <strong>.apk</strong>;这里的 APK 是 OpenWrt 软件包,不是安卓安装包。</p><ol><li>在路由器的<strong>系统 → 软件包</strong>中更新列表,再上传并安装匹配固件的安装包;有内置插件商店时,也可以使用它的 OpenClash 安装入口。</li><li>刷新页面,打开<strong>服务 → OpenClash</strong>,在<strong>版本更新</strong>中准备与路由器架构匹配的 <strong>Meta / Mihomo 内核</strong>。</li></ol><figure class="compact"><img src="/brand/hn/tutorials/router/install.svg" width="760" height="398" loading="lazy" alt="操作示意:先备份,再安装插件和内核。菜单位置随固件版本而异。"><figcaption>操作示意:先备份,再安装插件和内核。菜单位置随固件版本而异。</figcaption></figure><details class="alternative"><summary>安装时提示缺少依赖</summary><p class="">使用固件的软件包管理器安装缺失的依赖。插件与内核模块需要匹配固件和防火墙版本;具体依赖可在「所有客户端」的 OpenClash 入口查看安装说明。不要强制忽略依赖或覆盖系统库。</p></details><h2>2. 添加网站订阅</h2><p class="">回到 hardnerd <strong>仪表盘 → 导入订阅</strong>,点击<strong>复制订阅地址</strong>。</p><p class="">进入路由器的<strong>服务 → OpenClash → 配置订阅</strong>,添加订阅:</p><ol><li>名称填一个好认的名字,例如 <strong>hardnerd</strong>;订阅地址粘贴刚才复制的完整地址。</li><li>User-Agent 选 <strong>clash.meta / Clash</strong> 类型;关闭<strong>在线订阅转换</strong>,直接读取网站配置。</li><li>保存订阅并保持条目启用,再点击<strong>更新配置</strong>,等待下载完成。</li></ol><figure class="compact"><img src="/brand/hn/tutorials/router/subscribe.svg" width="760" height="412" loading="lazy" alt="填写示意:粘贴完整地址,保存后更新配置。"><figcaption>填写示意:粘贴完整地址,保存后更新配置。</figcaption></figure><p class="small">订阅地址相当于你的个人连接凭据,请勿公开或分享给别人。</p><h2>3. 切换配置,启动并选择线路</h2><ol><li>在<strong>配置管理</strong>找到刚下载的配置,点击<strong>切换</strong>。</li><li>回到<strong>运行状态</strong>启用 OpenClash,等待插件和内核运行。</li><li>打开 OpenClash 的<strong>控制面板 → 代理</strong>,选择<strong>规则</strong>模式,再选择可用线路或自动选择组。</li></ol><figure class="compact"><img src="/brand/hn/tutorials/router/start.svg" width="760" height="351" loading="lazy" alt="操作示意:切换配置 → 启动插件 → 选择线路。"><figcaption>操作示意:切换配置 → 启动插件 → 选择线路。</figcaption></figure><h2>4. 让设备通过路由器上网</h2><p class=""><strong>作为主路由:</strong>手机、电脑连接这台路由器的 Wi-Fi 或 LAN,通常保持自动获取 IP、网关和 DNS。</p><p class=""><strong>作为旁路由:</strong>先用一台设备测试,让它的网关和 DNS 指向旁路由 LAN 地址。旁路由自身还需要正确的上游网关、转发与 NAT 配置,不能只安装插件。</p><figure class="compact"><img src="/brand/hn/tutorials/router/network.svg" width="760" height="374" loading="lazy" alt="连接示意:流量必须经过运行 OpenClash 的路由器。"><figcaption>连接示意:流量必须经过运行 OpenClash 的路由器。</figcaption></figure><p class="small">测试设备先停止其他 VPN 或代理客户端,再用浏览器打开需要的网站。保留设备原来的网关与 DNS;若启用后网络异常,先停用 OpenClash,并恢复原设置。</p><section class="troubleshooting"><h2>遇到问题</h2><div class="qa"><h3>后台没有 OpenClash 菜单</h3><p>刷新或重新登录后台,检查软件包与依赖是否安装成功。</p></div><div class="qa"><h3>内核不存在或无法启动</h3><p>到版本更新中确认内核已下载且架构匹配,再查看运行日志中的具体错误。</p></div><div class="qa"><h3>订阅更新失败</h3><p>重新复制完整地址,确认路由器本身能联网;使用 Clash 类型 User-Agent,关闭在线订阅转换后重试。</p></div><div class="qa"><h3>插件运行了,设备却打不开网页</h3><p>检查设备流量是否经过这台路由器,尤其是旁路由的网关和 DNS。先停用插件恢复联网,再排查配置。</p></div><div class="qa"><h3>仍然无法使用</h3><p>在网站仪表盘点击「工单支持」,说明卡在哪一步,并附上系统版本、客户端版本和报错截图。不要附上完整订阅地址。</p></div></section><a class="back" href="/#/docs/1">← 返回新手指引</a>
|
|
</div>
|