Skip to content

Instantly share code, notes, and snippets.

@malash
Created July 5, 2021 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malash/a2bcb1bb3751535526357b8a148fd8a0 to your computer and use it in GitHub Desktop.
Save malash/a2bcb1bb3751535526357b8a148fd8a0 to your computer and use it in GitHub Desktop.
北京联通IPTV+OpenWrt配置方法

参考

https://gist.github.com/malash/fc0c573300b080e5745e68522d1617bf

适用

  1. 北京联通默认配置为:所有LAN都支持互联网和IPTV
  2. 北京联通拨打客服可以改桥街,无需破解。本教程光猫已改桥接
  3. 光猫到路由器使用单线连接

光猫配置

无需额外配置

路由器设置

  1. 安装几个必要的包。
opkg install luci-app-udpxy igmpproxy
  1. 配置 /etc/config/igmpproxy,其中

2.1. list altnet 239.21.1.0/24 需要写组播服务器的地址段(可以搜索别人做的好组播地址列表,然后找到合适的IP段,一般情况下运营商不会使用太复杂的IP段)。

2.2. option network wan 为WAN接口(注意不是link名,是 OpenWRT后台——网络——接口 处的名字)

2.3. option network lan 为LAN接口(注意不是link名,是 OpenWRT后台——网络——接口 处的名字)

config igmpproxy
	option quickleave 1
#	option verbose [0-3](none, minimal[default], more, maximum)

config phyint
	option network wan
	option zone wan
	option direction upstream
	list altnet 239.3.1.0/24

config phyint
	option network lan
	option zone lan
	option direction downstream

2.4. 重启 igmpproxy (也可以直接重启路由器)

service igmpproxy restart

添加防火墙规则

在 OpenWRT后台——网络——防火墙——通信规则 添加一个新的转发规则。配置如下:

image image

  1. 名称:Allow-udpxy
  2. 传输协议:UDP
  3. 源区域:WAN
  4. 目标区域:设备(输入)
  5. 目标地址:224.0.0.0/4

检查服务

  1. 访问udpxy地址 http://192.168.x.y:4022/status ,IP为路由器的IP

  2. 如果未能成功访问udpxy地址,或igmp没有生效,请检查并确保这两个服务正常启动了

service udpxy enable
service udpxy restart
service igmpproxy enable
service igmpproxy restart
  1. 使用VLC或IINA播放 .m3u8 文件,地址为 https://tool.malash.net/iptv/beijing-unicom-iptv.m3u8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment