-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.xml
336 lines (336 loc) · 33.7 KB
/
search.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title>OpenWrt发送日志到远端</title>
<url>/2024/07/05/1099985578/</url>
<content><![CDATA[<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/hint.css/2.4.1/hint.min.css"><p>OpenWrt的日志默认都存放在/tmp中,重启之后日志文件都会被清空。本来这样没有问题,但是最近它总会在运行了36个小时左右时莫名重启,想要排查下问题。于是启用OpenWrt的远程日志记录功能,将日志输出到群晖上的Syslog服务–日志中心,以便排除原因。</p>
<span id="more"></span>
<h2 id="配置Syslog服务">配置Syslog服务</h2>
<p>这里的Syslog服务是利用群晖内自带的<strong>日志中心</strong>,步骤如下:</p>
<ol>
<li>在日志中心 > 归档设置,选择一个用于存储和归档日志的位置</li>
<li>在日志中心 > 日志接收 > 创建,随便起一个名字,如OpenWrt,其他保持如下图默认即可<br>
<img src="/2024/07/05/1099985578/nas-syslog.png" alt="alt text" loading="lazy"></li>
<li>单击<strong>应用</strong>来保存设置<br>
至此,在群晖上的Syslog服务配置完毕了。</li>
</ol>
<h2 id="配置OpenWrt">配置OpenWrt</h2>
<ol>
<li>在<strong>系统</strong>-><strong>系统</strong>-><strong>日志</strong>,在<strong>外部系统日志服务器地址</strong>输入上一步Syslog服务的ip地址<br>
<img src="/2024/07/05/1099985578/op-log.png" alt="alt text" loading="lazy"></li>
<li>点击<strong>保持并应用</strong></li>
<li>ssh登陆到软路由中,或者网页端的TTYD,输入以下命令重启服务</li>
</ol>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line">service <span class="built_in">log</span> restart</span><br><span class="line">service system restart</span><br></pre></td></tr></table></figure>
<p>正常情况下,等几秒即可在群晖中看到OpenWrt日志了,测试效果如下。<br>
<img src="/2024/07/05/1099985578/log-results.png" alt="alt text" loading="lazy"></p>
<h2 id="参考文档">参考文档</h2>
<ol>
<li><a href="https://www.utopiafar.com/2022/08/11/logging-network-requests-via-openwrt/" rel="external nofollow noreferrer">配置openwrt的网络请求日志</a></li>
<li><a href="https://openwrt.org/docs/guide-user/base-system/log.essentials#logd" rel="external nofollow noreferrer">Logging messages–OpenWrt</a></li>
<li><a href="https://kb.synology.cn/zh-cn/DSM/help/LogCenter/logcenter_server?version=7" rel="external nofollow noreferrer">群晖知识库–日志中心–接收日志</a></li>
</ol>
]]></content>
<tags>
<tag>OpenWrt</tag>
<tag>日志服务器</tag>
<tag>Syslog</tag>
</tags>
</entry>
<entry>
<title>软路由折腾记-上篇</title>
<url>/2024/06/26/2174825710/</url>
<content><”">[1]</span></a></sup> :</h3>
<ol>
<li><strong>设备准备</strong>:移除R5s设备上的所有外设和TF卡,用卡针按住<strong>靠近HDMI接口边</strong>的Mask按键不放, 插上电源, 保持按住Mask键, 状态灯亮起3秒后即可松开;</li>
<li><strong>连接设备</strong>:用USB公对公数据线,将设备与电脑进行连接, 连接方法参照下图, 需要连接靠近外侧的USB端口;<br>
<img src="/2024/06/26/2174825710/image.png" alt="USB Connection Diagram" loading="lazy"></li>
<li><strong>烧录固件</strong>:解压缩官方固件zip包,运行其中RKDevTool.exe,启动瑞芯微开发工具,界面上会显示 “发现一个Maskrom设备”, 点击界面上的“执行”按钮, 稍等片刻即可完成烧写, 完成后设备会自动重启;<br>
<strong>小贴士</strong>:刷完官方固件后,若要再次进入刷机模式,Mask孔的位置变了哦,现在在USB口下方,别找错地方了😉。</li>
</ol>
<p>登陆FriendlyWrt网页,通过web版的<strong>eMMC刷机助手</strong>刷入第三方固件,我选择了Lean大佬的固件<sup id="fnref:2"><a href="#fn:2" rel="footnote"><span class="hint--top hint--error hint--medium hint--rounded hint--bounce" aria-label="Lean大佬的固件性能强悍,运行稳定,温度也控制得不错,室温26度的密闭弱电箱内,CPU温度在43度左右。但是其Luci界面版本还停留在18.06,会导致某些系统界面和插件的选项显示不全。">[2]</span></a></sup>(<a href="https://pan.baidu.com/s/10w9yoLx5aG2sW4uggXCfZA?pwd=mkgq" rel="external nofollow noreferrer">网盘链接在此</a>)。至此,刷机大功告成!<img src="/2024/06/26/2174825710/image-1.png" alt="Flashed Lean IMG" loading="lazy"><br>
下一篇文章,我将分享在R5s LTS上运行的服务和我的配置心得,敬请期待!</p>
<div id="footnotes"><hr><div id="footnotelist"><ol style="list-style: none; padding-left: 0; margin-left: 40px"><li id="fn:1"><span style="display: inline-block; vertical-align: top; padding-right: 10px; margin-left: -40px">1.</span><span style="display: inline-block; vertical-align: top; margin-left: 10px;">详情参考友善官网“<a href="https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R5S/zh#.E6.96.B9.E6.B3.953:_.E9.80.9A.E8.BF.87USB.E7.83.A7.E5.86.99" rel="external nofollow noreferrer">通过USB烧写</a>”<a href="#fnref:1" rev="footnote"> ↩</a></span></li><li id="fn:2"><span style="display: inline-block; vertical-align: top; padding-right: 10px; margin-left: -40px">2.</span><span style="display: inline-block; vertical-align: top; margin-left: 10px;">Lean大佬的固件性能强悍,运行稳定,温度也控制得不错,室温26度的密闭弱电箱内,CPU温度在43度左右。但是其Luci界面版本还停留在18.06,会导致某些系统界面和插件的选项显示不全。<a href="#fnref:2" rev="footnote"> ↩</a></span></li></ol></div></div>]]></content>
<tags>
<tag>OpenWrt</tag>
<tag>软路由</tag>
</tags>
</entry>
<entry>
<title>软路由折腾记-下篇</title>
<url>/2024/07/03/958223243/</url>
<content><![CDATA[<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/hint.css/2.4.1/hint.min.css"><p>本篇讲述,如何通过OpenClash实现IPv4和IPv6的双栈支持,并结合SmartDNS进行DNS分流和优选,可以显著提升网络体验和应用性能,并记录关键的配置要点。由于版本的不同,请根据自己的实际情况调整;✓代表勾选 ✕代表取消勾选;若未提及的设置,一般保留默认值。</p>
<h2 id="准备">准备</h2>
<ol>
<li>基于NanoPi-R5s-LST版 + Lean固件QWRT-R24.02.26(R24.3.3)</li>
<li>OpenClash, TUN内核:v1.18.0-13-gd034a40,Meta内核:alpha-g0d4e57c,客户端版本:v0.46.001-beta</li>
<li>SmartDNS Release 45, 即1.2024.02.08-0828版本, 注意Luci需要下载<strong>luci-compat-all.ipk</strong>,才能在Web界面显示配置菜单</li>
</ol>
<span id="more"></span>
<h2 id="SmartDNS配置">SmartDNS配置</h2>
<p>在折腾过MosDNS之后,还是用回SmartDNS,使用OpenClash的白名单分流国内外DNS查询。SmartDNS 国内分组使用的端口是:6053,第二组的DNS服务器端口是:6553,注意端口号不能跟已运行的服务相冲突。DNS 上游服务器配置如下图(自动设置 Dnsmasq❌),根据官方建议,上游DNS不宜超过10个:<img src="/2024/07/03/958223243/dns0.png" alt="alt text" loading="lazy"><br>
<img src="/2024/07/03/958223243/dns.png" alt="alt text" loading="lazy"><br>
<em>可以参考这个网址[<a href="https://dns.icoa.cn/" rel="external nofollow noreferrer">https://dns.icoa.cn/</a>],挑选符合自己网络的国内外DNS服务器。</em><br>
当然,你也可以直接vi编辑"/etc/config/smartdns"文件,批量将DNS服务器加入(最上方Tencent作为运营商解析dns的示例),代码如下:</p>
<figure class="highlight bash"><table><tr><td class="code"><pre><span class="line">config server</span><br><span class="line"> option enabled <span class="string">'1'</span></span><br><span class="line"> option <span class="built_in">type</span> <span class="string">'udp'</span></span><br><span class="line"> option exclude_default_group <span class="string">'1'</span></span><br><span class="line"> option addition_arg <span class="string">'-bootstrap-dns'</span></span><br><span class="line"> option ip <span class="string">'119.29.29.29'</span></span><br><span class="line"> option name <span class="string">'Tencent'</span></span><br><span class="line"></span><br><span class="line">config server</span><br><span class="line"> option enabled <span class="string">'1'</span></span><br><span class="line"> option name <span class="string">'cn-Ali-DOH'</span></span><br><span class="line"> option ip <span class="string">'https://dns.alidns.com/dns-query'</span></span><br><span class="line"> option <span class="built_in">type</span> <span class="string">'https'</span></span><br><span class="line"> option server_group <span class="string">'cn'</span></span><br><span class="line"></span><br><span class="line">config server</span><br><span class="line"> option enabled <span class="string">'1'</span></span><br><span class="line"> option name <span class="string">'cn-Ali'</span></span><br><span class="line"> option server_group <span class="string">'cn'</span></span><br><span class="line"> option ip <span class="string">'dns.alidns.com'</span></span><br><span class="line"> option <span class="built_in">type</span> <span class="string">'tls'</span></span><br><span class="line"></span><br><span class="line">config server</span><br><span class="line"> option enabled <span class="string">'1'</span></span><br><span class="line"> option name <span class="string">'cn-Tencent'</span></span><br><span class="line"> option server_group <span class="string">'cn'</span></span><br><span class="line"> option ip <span class="string">'https://doh.pub/dns-query'</span></span><br><span class="line"> option <span class="built_in">type</span> <span class="string">'https'</span></span><br><span class="line"></span><br><span class="line">config server</span><br><span class="line"> option enabled <span class="string">'1'</span></span><br><span class="line"> option server_group <span class="string">'cn'</span></span><br><span class="line"> option name <span class="string">'cn-Tencent'</span></span><br><span class="line"> option ip <span class="string">'1.12.12.12'</span></span><br><span class="line"> option <span class="built_in">type</span> <span class="string">'tls'</span></span><br><span class="line"> option tls_host_verify <span class="string">'dot.pub'</span></span><br><span class="line"></span><br><span class="line">config server</span><br><span class="line"> option enabled <span class="string">'1'</span></span><br><span class="line"> option name <span class="string">'us-g1'</span></span><br><span class="line"> option server_group <span class="string">'us'</span></span><br><span class="line"> option exclude_default_group <span class="string">'1'</span></span><br><span class="line"> option ip <span class="string">'https://dns.google/dns-query'</span></span><br><span class="line"> option <span class="built_in">type</span> <span class="string">'https'</span></span><br><span class="line"></span><br><span class="line">config server</span><br><span class="line"> option enabled <span class="string">'1'</span></span><br><span class="line"> option name <span class="string">'us-cf2'</span></span><br><span class="line"> option <span class="built_in">type</span> <span class="string">'https'</span></span><br><span class="line"> option server_group <span class="string">'us'</span></span><br><span class="line"> option exclude_default_group <span class="string">'1'</span></span><br><span class="line"> option tls_host_verify <span class="string">'cloudflare-dns.com'</span></span><br><span class="line"> option ip <span class="string">'https://1.0.0.1/dns-query'</span></span><br><span class="line"></span><br><span class="line">config server</span><br><span class="line"> option enabled <span class="string">'1'</span></span><br><span class="line"> option <span class="built_in">type</span> <span class="string">'tls'</span></span><br><span class="line"> option server_group <span class="string">'us'</span></span><br><span class="line"> option exclude_default_group <span class="string">'1'</span></span><br><span class="line"> option name <span class="string">'us-Quad9'</span></span><br><span class="line"> option ip <span class="string">'9.9.9.9'</span></span><br><span class="line"> option tls_host_verify <span class="string">'dns.quad9.net'</span></span><br></pre></td></tr></table></figure>
<h3 id="SmartDNS高级设置">SmartDNS高级设置</h3>
<ul>
<li>测速模式:默认</li>
<li>TCP服务器:✖️</li>
<li>DOT服务器:✖️</li>
<li>DOH服务器:✖️</li>
<li>IPV6服务器:✔</li>
<li>绑定到设备:✔</li>
<li>双栈IP优选:✔</li>
<li>域名预加载: ✔</li>
<li>缓存过期服务:✖️</li>
<li>缓存大小:10000 (这个根据实际性能调整)</li>
<li>持久化缓存:✖️</li>
<li>解析本地主机名:✔</li>
<li>停用IPV6地址解析:✖️</li>
<li>停用HTTPS记录解析:✖️<br>
<img src="/2024/07/03/958223243/dns1.png" alt="alt text" loading="lazy"><br>
<img src="/2024/07/03/958223243/dns2.png" alt="alt text" loading="lazy"></li>
</ul>
<h3 id="SmartDNS第二DNS服务器">SmartDNS第二DNS服务器</h3>
<ul>
<li>启用:✔</li>
<li>服务器组:us</li>
<li>跳过测速:✔</li>
<li>跳过双栈优选:✔</li>
<li>跳过cache:✔</li>
<li>停用IPV6地址解析:✔<br>
<img src="/2024/07/03/958223243/2dns-1.png" alt="alt text" loading="lazy"></li>
</ul>
<h3 id="自定义配置">自定义配置</h3>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">#iOS系统解析缓慢</span><br><span class="line">force-qtype-SOA 65</span><br></pre></td></tr></table></figure>
<h3 id="域名规则">域名规则</h3>
<p>域名地址,添加自定义配置</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line"># Stop ipv6 for google,停止谷歌的ipv6解析</span><br><span class="line">#address /google.com/#6</span><br><span class="line">#address /dns.google/#6</span><br><span class="line">#DDNS pointed to internal server,将ddns域名转换成实际内网服务器ip</span><br><span class="line">address /example.example.com/192.168.xx.xx</span><br></pre></td></tr></table></figure>
<p>至此,SmartDNS部分配置完毕。</p>
<h2 id="OpenClash配置">OpenClash配置</h2>
<p>先准备好订阅地址,我使用CF通过Worker部署了定制汇聚订阅,可以将多个订阅或者节点汇聚在一起,并能加载分流规则,方便在多设备上同步配置文件。<br>
<img src="/2024/07/03/958223243/op1.png" alt="alt text" loading="lazy"><br>
<strong>保存配置,<span style="color: red;">不要应用</span></strong></p>
<h3 id="插件设置">插件设置</h3>
<ol>
<li>模式设置</li>
</ol>
<ul>
<li>使用 Meta 内核:✔</li>
<li>运行模式:Redir-Host (TUN-混合)模式</li>
<li>延迟启动(秒):10<br>
<img src="/2024/07/03/958223243/op2.png" alt="alt text" loading="lazy"></li>
</ul>
<ol start="2">
<li>流量控制</li>
</ol>
<ul>
<li>禁用QUIC: ✔</li>
<li>仅允许常用端口流量:默认常用端口</li>
<li>绕过中国大陆IP:✔</li>
<li>绕过中国大陆IPv4黑名单:添加以下网站(我理解的是即使该网站解析的IP识别为大陆,仍然用代理)</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">## 方便使用Bing的Copilot</span><br><span class="line">bing.com</span><br></pre></td></tr></table></figure>
<p><img src="/2024/07/03/958223243/op3.png" alt="alt text" loading="lazy"></p>
<ol>
<li>DNS设置</li>
</ol>
<ul>
<li>本地DNS劫持:使用Dnsmasq转发</li>
<li>禁止Dnsmasq缓存:✔</li>
</ul>
<ol start="2">
<li>黑白名单:<br>
使用黑名单,即只有添加IP或mac的设备不走代理,其他设备都走代理。<span style="color: red;">添加设备的mac效果更好,一次性把设备的IPv4和IPv6都包含其中</span></li>
<li>IPv6设置</li>
</ol>
<ul>
<li>IPv6 流量代理:✔</li>
<li>IPv6 代理模式:TUN模式</li>
<li>允许 IPv6 类型 DNS 解析:✔</li>
<li>绕过中国大陆 IPv6:✔</li>
<li>绕过中国大陆IPv6黑名单:添加以下网站</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">## 方便使用Bing的Copilot</span><br><span class="line">bing.com</span><br></pre></td></tr></table></figure>
<ol start="4">
<li>GEO数据库订阅</li>
</ol>
<ul>
<li>自动更新 GeoIP Dat 数据库:✔</li>
<li>自动更新 GeoSite 数据库:✔<br>
避开重启的时段,选择更新时间。</li>
</ul>
<ol start="5">
<li>大陆白名单订阅自动更新:✔</li>
</ol>
<h3 id="覆写设置">覆写设置</h3>
<p><strong>DNS设置</strong></p>
<ul>
<li>自定义上游 DNS 服务器:✔</li>
<li>追加上游DNS:×</li>
<li>追加默认DNS:×<br>
设置自定义上游 DNS 服务器:</li>
<li>NameServer 和 Default-NameServer 使用127.0.0.1,6053,UDP, 即SmartDNS 第一服务器</li>
<li>FallBack使用127.0.0.1, 6553,UDP, 即使用 SmartDNS 第二服务器<br>
至此,SmartDNS 就会接管所有的 DNS 请求。<br>
<img src="/2024/07/03/958223243/op4.png" alt="alt text" loading="lazy"></li>
</ul>
<h3 id="规则管理">规则管理</h3>
<p>添加一个不走代理的白名单,强制这些域名走本地直连。</p>
<ul>
<li>规则集文件列表->新建文件,文件名为CN-Whitelist.yaml</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">payload:</span><br><span class="line"> ## > Ubiquiti</span><br><span class="line"> - DOMAIN-SUFFIX,ui.com</span><br><span class="line"> - DOMAIN-SUFFIX,uwn.com</span><br></pre></td></tr></table></figure>
<h3 id="规则附加">规则附加</h3>
<p>添加<span style="color: blue;">自定义规则集附加</span>,顺序选择<span style="color: red;">优先(覆盖)</span>。但是我实际使用下来<em>未能生效</em>,后来还是在线分流规则中新建了<strong>国内直连</strong>的分组。<img src="/2024/07/03/958223243/op5.png" alt="alt text" loading="lazy"><br>
在Openclash中点击<strong>保存配置</strong>并<strong>应用配置</strong>,启动其客户端后,即可正常使用。<br>
<img src="/2024/07/03/958223243/op6.png" alt="alt text" loading="lazy"></p>
<h2 id="参考文档">参考文档</h2>
<ul>
<li><a href="https://rushb.pro/article/openwrt-config.html#smartdns" rel="external nofollow noreferrer">OpenWrt 配置不完全指北</a></li>
<li><a href="https://www.hughh.top/posts/soft-routing-guide-3/#%E4%B8%80openclash%E8%AE%BE%E7%BD%AE" rel="external nofollow noreferrer">软路由科学上网,openclash,openwrt IPv6配置</a></li>
<li><a href="https://rushb.pro/article/router-dns.html" rel="external nofollow noreferrer">软路由与 DNS 折腾笔记</a></li>
<li><a href="https://github.com/cutethotw/ClashRule" rel="external nofollow noreferrer">clash自用分流规则以及转换教程</a></li>
<li><a href="https://github.com/cmliu/CF-Workers-SUB" rel="external nofollow noreferrer">CM大佬的定制汇聚订阅及视频教程</a></li>
</ul>
]]></content>
<tags>
<tag>OpenWrt</tag>
<tag>OpenClash</tag>
<tag>SmartDNS</tag>
<tag>IPv6</tag>
<tag>DNS</tag>
</tags>
</entry>
<entry>
<title>软路由折腾记-中篇</title>
<url>/2024/06/28/3158614889/</url>
<content><![CDATA[<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/hint.css/2.4.1/hint.min.css"><p>书接上文,这篇将主要阐明在路由器里运行哪些服务和插件,并重点记录下魔都IPv6网络和IPTV收看的配置要点。</p>
<h2 id="服务和插件🌟">服务和插件🌟</h2>
<ul>
<li>PPPoE拨号</li>
<li>IPv6网络</li>
<li>IPTV收看和转单播</li>
<li>DNS防污染和加密</li>
<li>科学上网</li>
<li>Alist网盘</li>
<li>DDNS映射</li>
<li>KMS服务器</li>
<li>HomeAssistant设备跟踪</li>
<li>Wireguard回家</li>
</ul>
<span id="more"></span>
<h2 id="准备工作🔑">准备工作🔑</h2>
<ol>
<li>光猫改桥接,致电10000,向客服申请下,然后重启光猫即可;</li>
<li>刷入OpenWrt固件的软路由,这里使用的版本是QWRT R24.3.3;</li>
<li>获取到拨号上网的账号和密码。</li>
</ol>
<h2 id="开始配置🛠️">开始配置🛠️</h2>
<p>SSH登录路由器,输入以下代码,解锁显示科学上网</p>
<figure class="highlight shell"><figcaption><span>Unlock SSR & OpenClash</span></figcaption><table><tr><td class="code"><pre><span class="line">echo 0xDEADBEEF > /etc/config/google_fu_mode</span><br></pre></td></tr></table></figure>
<p>以下未提及的配置皆为默认:</p>
<h3 id="修改WAN口配置">修改WAN口配置</h3>
<ul>
<li>协议:PPPoE</li>
<li>设备:eth0(本人eth0连光猫,请以自己实际情况为准)</li>
<li>开机自动运行:勾选</li>
<li>PAP/CHAP 用户名:PPPoE账号</li>
<li>PAP/CHAP 密码:PPPoE密码</li>
<li>高级设置-获取 IPv6 地址:手动(不自动生成Wan6,使用固定的Wan6接口。)</li>
</ul>
<h3 id="配置WAN6接口:">配置WAN6接口:</h3>
<ul>
<li>协议:DHCPv6客户端</li>
<li>开机自动运行:勾选</li>
<li>请求IPv6地址:try</li>
<li>请求指定长度的IPv6前缀:自动</li>
<li>物理设置-自定义接口:pppoe-wan</li>
</ul>
<h3 id="配置LAN接口:">配置LAN接口:</h3>
<ul>
<li>物理设置-启用 IGMP 嗅探:勾选 (<span style="color: red;">后续IPTV配置需要</span>)</li>
<li>IPv6 分配长度:60 (请以自己实际情况为准)</li>
<li>DHCP服务器-IPv6设置:前三项“混合模式”</li>
<li>DHCP服务器-IPv6设置-DHCPv6模式:无状态的+有状态的<br>
<img src="/2024/06/28/3158614889/image.png" alt="alt text" loading="lazy"></li>
</ul>
<p>至此已经可以<strong>正常访问内外网</strong>🎉,并有了IPv6网络环境,可以打开<a href="https://ipw.cn/" rel="external nofollow noreferrer">https://ipw.cn/</a> 测试查看。</p>
<h2 id="配置IPTV📺">配置IPTV📺</h2>
<h3 id="添加IPTV85接口">添加IPTV85接口</h3>
<ul>
<li>名称:iptv85</li>
<li>协议:DHCP客户端</li>
<li>桥接:勾选</li>
<li>自定义接口:eth0.85, eth1.85, eth2.85(添加所有端口的VLAN方便盲插IPTV)</li>
<li>开机自动运行:勾选</li>
<li>高级设置-使用默认网关:勾选</li>
<li>高级设置-使用网关跃点:20(大于0即可)</li>
<li>防火墙设置-创建/分配防火墙区域:lan</li>
</ul>
<h3 id="添加IPTV51接口">添加IPTV51接口</h3>
<ul>
<li>名称:iptv51</li>
<li>协议:不配置协议</li>
<li>桥接:勾选</li>
<li>自定义接口:eth0.51, eth1.51, eth2.51(回看要用到vlan,不确定是否有用,加不加都可以)</li>
<li>防火墙设置-创建/分配防火墙区域:lan</li>
</ul>
<h3 id="修改dnsmasq-conf">修改dnsmasq.conf</h3>
<p>SSH远程到路由器,修改/etc/dnsmasq.conf文件,添加以下内容并保存。</p>
<figure class="highlight sh"><figcaption><span>dnsmasq.conf</span></figcaption><table><tr><td class="code"><pre><span class="line">dhcp-option-force=125,00:00:00:00:1a:02:06:48:47:57:2d:43:54:03:04:5a:58:48:4e:0a:02:20:00:0b:02:00:55:0d:02:00:2e</span><br><span class="line">dhcp-option=15</span><br><span class="line">dhcp-option=28</span><br><span class="line">dhcp-option=60,00:00:01:06:68:75:61:71:69:6E:02:0A:48:47:55:34:32:31:4E:20:76:33:03:0A:48:47:55:34:32:31:4E:20:76:33:04:10:32:30:30:2E:55:59:59:2E:30:2E:41:2E:30:2E:53:48:05:04:00:01:00:50</span><br></pre></td></tr></table></figure>
<p>重启dnsmasq服务后,IPTV机顶盒便可以使用了,<strong>直播和回放</strong>均正常。</p>
<h3 id="强制IGMPv2">强制IGMPv2</h3>
<p>修改/etc/sysctl.conf 文件,添加以下内容保存,强制使用IGMPv2,<span style="color: red;">可以不开IPTV机顶盒也能播放</span></p>
<figure class="highlight sh"><figcaption><span>sysctl.conf</span></figcaption><table><tr><td class="code"><pre><span class="line">net.ipv4.conf.all.force_igmp_version=2</span><br></pre></td></tr></table></figure>
<h3 id="设置MSDLudpxy插件">设置<s>MSDL</s>udpxy插件</h3>
<p><s>配置Multi Stream Daemon Lite,这款插件据称比udpxy更省运行资源。</s> 试用了一周,IPTV播放一卡一卡的,还是切换回用<span style="color: red;">udpxy</span>。</p>
<ul>
<li>启用:勾选</li>
<li>状态:勾选(可通过<a href="http://ip:4022/status%EF%BC%8C%E6%9F%A5%E7%9C%8B%E8%BF%90%E8%A1%8C%E7%8A%B6%E6%80%81%EF%BC%89" rel="external nofollow noreferrer">http://ip:4022/status,查看运行状态)</a></li>
<li>Bind IP/Interface:br-lan(lan接口请根据实际情况调整)</li>
<li>端口:4022</li>
<li>Source IP/Interface: br-IPTV85(vlan接口请根据实际情况调整)</li>
<li>Buffer size:2097152<br>
<img src="/2024/06/28/3158614889/udpxy.png" alt="udpxy" loading="lazy"><br>
到了这里,组播转单播也工作了,根据自己的网络,更新这个<a href="https://pan.baidu.com/s/1cGbKRzjKfUPVEA3K74Y0Eg?pwd=cbn5" rel="external nofollow noreferrer">m3u文件</a>,就是把<em>192.168.50.254</em>批量替换成你自己的路由器IP地址。</li>
</ul>
<h2 id="便捷配置🔄">便捷配置🔄</h2>
<p>若你正好也正巧也是使用同款固件或者Lean大佬的其他版本,可以根据自身硬件修改以下配置文件,保存后重启设备生效。</p>
<p><span style="color: red;"> vi /etc/config/network </span></p>
<figure class="highlight shell"><figcaption><span>network</span></figcaption><table><tr><td class="code"><pre><span class="line">config interface 'loopback'</span><br><span class="line"> option ifname 'lo'</span><br><span class="line"> option proto 'static'</span><br><span class="line"> option ipaddr '127.0.0.1'</span><br><span class="line"> option netmask '255.0.0.0'</span><br><span class="line"></span><br><span class="line">config interface 'lan'</span><br><span class="line"> option type 'bridge'</span><br><span class="line"> option ifname 'eth1 eth2'</span><br><span class="line"> option proto 'static'</span><br><span class="line"> option netmask '255.255.255.0'</span><br><span class="line"> option ip6assign '60'</span><br><span class="line"> option delegate '0'</span><br><span class="line"> option ipaddr '192.168.50.1'</span><br><span class="line"> option igmp_snooping '1'</span><br><span class="line"></span><br><span class="line">config interface 'wan'</span><br><span class="line"> option ifname 'eth0'</span><br><span class="line"> option _orig_ifname 'eth0'</span><br><span class="line"> option _orig_bridge 'false'</span><br><span class="line"> option proto 'pppoe'</span><br><span class="line"> option username 'ad1234'</span><br><span class="line"> option password '12345678'</span><br><span class="line"> option keepalive '0'</span><br><span class="line"> option ipv6 '1'</span><br><span class="line"> </span><br><span class="line">config interface 'wan6' </span><br><span class="line"> option ifname 'pppoe-wan' </span><br><span class="line"> option _orig_ifname 'pppoe-wan' </span><br><span class="line"> option _orig_bridge 'false' </span><br><span class="line"> option proto 'dhcpv6' </span><br><span class="line"> option reqaddress 'try' </span><br><span class="line"> option reqprefix 'auto' </span><br><span class="line"> </span><br><span class="line">config interface 'IPTV85' </span><br><span class="line"> option type 'bridge' </span><br><span class="line"> option proto 'dhcp' </span><br><span class="line"> option hostname 'zte' </span><br><span class="line"> option metric '20' </span><br><span class="line"> option _orig_bridge 'true' </span><br><span class="line"> option ifname 'eth0.85 eth1.85 eth2.85' </span><br><span class="line"> option _orig_ifname 'eth0.85 eth1.85 eth2.85' </span><br><span class="line"> option broadcast '1' </span><br><span class="line"> </span><br><span class="line">config interface 'IPTV51' </span><br><span class="line"> option type 'bridge' </span><br><span class="line"> option proto 'none' </span><br><span class="line"> option auto '1' </span><br><span class="line"> option _orig_ifname 'eth0.51' </span><br><span class="line"> option _orig_bridge 'true' </span><br><span class="line"> option ifname 'eth0.51 eth1.51 eth2.51' </span><br><span class="line"> option delegate '0' </span><br><span class="line"> option igmp_snooping '1' </span><br></pre></td></tr></table></figure>
<h2 id="参考文档📑">参考文档📑</h2>
<blockquote><p><a href="https://www.right.com.cn/forum/thread-8268077-1-1.html" rel="external nofollow noreferrer">上海电信 猫棒/光猫桥接 OpenWrt下实现 Internet+IPTV+udpxy+VoIP</a><br>
<a href="https://github.com/paulcx/Shanghai-Telecom-4k-iptv-with-merlin/tree/master" rel="external nofollow noreferrer">Shanghai-Telecom-4k-iptv-with-merlin</a><br>
<a href="https://www.right.com.cn/forum/thread-4071391-1-1.html" rel="external nofollow noreferrer">上海电信光猫桥接+IPTV 配置方法.-Openwrt软路由</a></p>
</blockquote>
]]></content>
<tags>
<tag>OpenWrt</tag>
<tag>IPv6</tag>
<tag>IPTV</tag>
</tags>
</entry>
</search>