I’ve got some trouble getting IPTV to work with OpenWRT. I’ve read quite a few posts on here, tweakers and the openwrt forum, but I’m still missing something.
I’ve got the following simple setup:
- OpenWRT (23.05.5) on an Asus RT-AX53U (2 cores, 256 Mb RAM).
- Modem is a Draytek 167, latest firmware, on Freedom VDSL. Bridged to the router.
- I have a
wan
interface for PPPoE (br-wan.6
) and aniptv
interface (br-wan.4
). Local interface for the STB islan_tv
(br-lan2
). - The WAN VLAN 4 IP Address is
100.68.x.y/23
(so not the range starting with10.
that I see others have). - The
route
output shows the expectedpppoe-wan
route (185.93…), and two forbr-wan.4
(100.64.0.0
,100.68.210.0
). - igmpproxy is running (details below).
My issue:
The STB doesn’t show live streams pretty much at all. Sometimes, it briefly shows channel 20, it never shows any live stream for NPO1, 2, etc. When on a live stream channel, the router graphs shows that the traffic is going to the STB’s port (and not to other ports or wifi).
When any stream higher than SD is active, internet access fails. Some pings go through, but really lagged. Local connections are still fine though – it’s only WAN.
I’ve tested the streams with VLC:
Watching the SD stream for NPO1 (rtp://@224.0.251.1:8002) works well enough (stutters occasionally). HD and HD+ streams (rtp://@224.0.252.126:7252, rtp://@224.0.251.124:8248) don’t work. HD sometimes starts for a few seconds, then freezes. HD+ never starts displaying.
I’ve verified:
- It all works with the standard Fritzbox – internet and TV work just fine (on the same STB).
- Watching a stream on demand works fine, stream comes in over br-wan.6, displays fine.
- The router load should be ok. It has 2 cores and only goes up to max 0.75 spikes for HD+ streams. (Load seems similar for working VOD stream.)
- IGMP group membership works. Memberships look ok, no errors in the logs. Leaving works, and stop the stream.
- IGMP snooping works. Graphs show that traffic is only going to the correct LAN port.
- Firewall is not blocking any relevant traffic (logging is on for all zones).
I’ve tried:
- IGMP snooping and multicast settings changed for devices.
- sendopts 121 and vendor class “IPTV_RG” included for the iptv interface (though that is outdated configuration, right?).
- Added a DNAT rule to forward streams directly to the STB (or attempted to, may have messed that up, config below)
- Enabled SQM QoS (cake) for the bridge devices (lan and wan), did not make any difference.
Any help is appreciated. Even examples of debug output for healthy setups would be great.
I’m not a networking pro, but willing to learn (and I know my way around the basics, linux well enough).
(Not using the STB is not an option for me. If I can’t get it to work with OpenWRT, I’ll have to go back to using the FB or try OpnSense.)
Debugging:
When a live stream is open for the STB, this is what tcpdump shows. What’s weird, to me, is the traffic on wan.6. I would have expected the IPTV streams to come only from wan.4. (And when watching the SD NPO1 stream with VLC, traffic does only go over wan.4).
tcpdump -nai br-lan2
:
13:28:22.053315 IP 217.166.225.124.49152 > 224.0.251.124.8248: BCM-LI-SHIM: direction unknown, pkt-type unknown, pkt-subtype unknown, li-id 2185616
13:28:22.054903 IP 217.166.225.124.49152 > 224.0.251.124.8248: BCM-LI-SHIM: direction unknown, pkt-type unknown, pkt-subtype unknown, li-id 2185617
13:28:22.056910 IP 217.166.225.124.49152 > 224.0.251.124.8248: BCM-LI-SHIM: direction unknown, pkt-type unknown, pkt-subtype unknown, li-id 2185618
13:28:22.059018 IP 217.166.225.124.49152 > 224.0.251.124.8248: BCM-LI-SHIM: direction unknown, pkt-type unknown, pkt-subtype unknown, li-id 2185619
tcpdump -nai br-wan.6
:
13:25:33.697741 PPPoE [ses 0x390] IP <MyPublicWanIp>.44494 > 185.24.175.211.10001: UDP, length 16
13:25:33.702921 PPPoE [ses 0x390] IP <MyPublicWanIp>.44494 > 185.24.175.211.10001: UDP, length 16
13:25:33.706882 PPPoE [ses 0x390] IP 185.24.175.211.10001 > <MyPublicWanIp>.44494: UDP, length 1330
13:25:33.708062 PPPoE [ses 0x390] IP <MyPublicWanIp>.44494 > 185.24.175.211.10001: UDP, length 16
13:25:33.713291 PPPoE [ses 0x390] IP <MyPublicWanIp>.44494 > 185.24.175.211.10001: UDP, length 16
13:25:33.716897 PPPoE [ses 0x390] IP 185.24.175.211.10001 > <MyPublicWanIp>.44494: UDP, length 1330
13:25:33.723655 PPPoE [ses 0x390] IP <MyPublicWanIp>.44494 > 185.24.175.211.10001: UDP, length 16
13:25:33.725886 PPPoE [ses 0x390] IP 185.24.175.211.10001 > <MyPublicWanIp>.44494: UDP, length 1330
Configuration
Installed packages:
igmpproxy
kmod-ipt-nathelper-~rtsp~
luci-app-sqm
network:
config device
option name 'br-lan'
option type 'bridge'
option acceptlocal '1'
list ports 'lan1'
option igmp_snooping '1'
option multicast '0'
option multicast_querier '0'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.3.1'
option netmask '255.255.255.0'
option ip6assign '60'
list dns '185.93.175.43'
config device
option type 'bridge'
option name 'br-wan'
list ports 'wan'
option multicast '0'
option igmp_snooping '1'
option multicast_querier '0'
config bridge-vlan
option device 'br-wan'
option vlan '2'
list ports 'wan:t'
config bridge-vlan
option device 'br-wan'
option vlan '4'
list ports 'wan:t'
config bridge-vlan
option device 'br-wan'
option vlan '6'
list ports 'wan:t'
config device
option type 'bridge'
option name 'br-lan2'
option multicast '0'
option igmp_snooping '1'
list ports 'lan2'
list ports 'lan3'
config interface 'wan'
option proto 'pppoe'
option device 'br-wan.6'
option username 'fake@freedom.nl'
option password '1234'
option ipv6 'auto'
config interface 'wan_tv'
option proto 'dhcp'
option device 'br-wan.4'
option type 'bridge'
option peerdns '0'
option defaultroute '0'
# option sendopts '121'
config interface 'lan_tv'
option proto 'static'
option ipaddr '192.168.4.1'
option netmask '255.255.255.0'
list dns '185.93.175.43'
option device 'br-lan2'
firewall
config rule
option name 'IPTV-Allow-Multicast'
list proto 'udp'
option src 'iptv'
option dest 'lan_tv'
list dest_ip '224.0.0.0/4'
option target 'ACCEPT'
config rule
option name 'IPTV-Allow-IGMP'
list proto 'igmp'
option src 'iptv'
option dest 'lan_tv'
option target 'ACCEPT'
config rule
option name 'Allow-IGMP'
option src 'wan'
option proto 'igmp'
option family 'ipv4'
option target 'ACCEPT'
config zone
option name 'lan_tv'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option masq_allow_invalid '1'
option auto_helper '0'
list helper 'rtsp'
list network 'lan_tv'
config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option mtu_fix '1'
option masq '1'
list network 'wan'
config zone
option name 'iptv'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
option masq_allow_invalid '1'
option masq '1'
option mtu_fix '1'
list network 'wan_tv'
config forwarding
option src 'lan_tv'
option dest 'iptv'
config forwarding
option src 'lan_tv'
option dest 'wan'
config rule
option name 'LanTV-Allow-Internet'
list proto 'all'
option src 'lan_tv'
option dest 'wan'
option target 'ACCEPT'
igmpproxy config: [edited with actual up to date config]
config igmpproxy
option quickleave 1
option verbose 3
config phyint
option network wan_tv
option zone iptv
option direction upstream
# list altnet 0.0.0.0/0
# list altnet 185.24.172.0/24 <- tried with and without these
# list altnet 185.24.175.0/24 <- tried with and without these
# list altnet 185.41.48.0/24 <- tried with and without these
list altnet 217.166.0.0/16
config phyint
option network lan_tv
option zone lan_tv
option direction downstream
# list altnet 192.168.4.1/24
Extra DNAT rules to forward traffic to STB (just to try):
config redirect
option dest 'lan_tv'
option target 'DNAT'
option name 'Stream Test'
option src 'wan'
option src_ip '185.24.0.0/16'
option src_dport '10000'
option dest_ip '192.168.4.4'
config redirect
option dest 'lan_tv'
option target 'DNAT'
option name 'IPTV TV test 2'
option src 'wan'
option src_ip '185.41.48.0/24'
option src_dport '10000'
option dest_ip '192.168.4.4'
Edit: updated igmpproxy config.