-
-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create database of IPTV setups #2
Comments
UK, BT TVYour This also works if you Double NAT behind your BT Hub (with your UDM in the DMZ), just remove all the "fake ip" stuff for eth8/9. The IP address being added to eth8/9 is irrelevant really, but a random private address is probably the best idea. /sbin/ip addr add 10.20.30.1 dev eth8/9
IPTV_WAN_INTERFACE="eth8/9"
IPTV_WAN_RANGES="224.0.0.0/4 109.159.247.0/24"
IPTV_WAN_VLAN="0"
IPTV_WAN_DHCP_OPTIONS="-O staticroutes"
IPTV_LAN_INTERFACES="br150"
if podman container exists iptv; then
podman rm -f iptv
fi
podman run --network=host --privileged \
--name iptv -i -d --restart on-failure:5 \
-e IPTV_WAN_INTERFACE="$IPTV_WAN_INTERFACE" \
-e IPTV_WAN_RANGES="$IPTV_WAN_RANGES" \
-e IPTV_WAN_VLAN="$IPTV_WAN_VLAN" \
-e IPTV_WAN_DHCP_OPTIONS="$IPTV_WAN_DHCP_OPTIONS" \
-e IPTV_LAN_INTERFACES="$IPTV_LAN_INTERFACES" \
-e IPTV_LAN_RANGES="" \
fabianishere/udm-iptv -d -v Because Unifi, sometimes the IP you added to eth8/9 may get removed, so you should consider a cron job setup with udm-utilities something like:
#!/bin/sh
FILE=/etc/cron.d/bt
CONTENTS="* * * * * /bin/sh /mnt/data/on_boot.d/10-BT.sh>/dev/null 2>&1"
if [ -f "$FILE" ]; then
echo "$FILE exists."
else
echo "$FILE does not exist. Creating..."
echo "$CONTENTS" >> $FILE
fi
/etc/init.d/S90dcron restart
#!/bin/sh
if [ "$(/sbin/ip addr show eth8/9 | /bin/grep -cim1 '10.20.30.1')" -ge 1 ]; then
#echo 'Fake IP on eth8/9 Exists!'
:
else
echo "Adding Fake IP to eth8/9"
/sbin/ip addr add 10.20.30.1 dev eth9/9
/mnt/data/on_boot.d/15-iptv.sh
fi |
NL, SolconYour
|
wondering if anyone has it working with PT MEO? |
PT, MEO IPTVYour Some notes:
@jonferreira take a look on this configuration. It's working! Reach me out if you need further notes. |
Brilliant thanks, wil give it a shot soon. On the 3rd I'll get my box replaced with an Android one and will test it afterwards. When you say "required firewall rules" do you have them? |
Please ping me here with your email address (in a private way) and I'll sent you a copy of the rules I have on my UDM-PRO. Please take in consideration that the new android box might not need specific multicast settings, if it works in the same way as AppleTV box. If you don't have a standard IPTV box, you might not need to make this settings. |
@jpatriarca Are you sure you need specific firewall rules for multicast to get IPTV working? In my experience, it should work without custom firewall rules. |
@jpatriarca I was actually wondering the same. My take is the android box is basically a "tablet with an app". I currently have the 4K Sofia but MEO will replace it next week so maybe best to wait till then to find out. Thanks though and I'll ping you regardless, there's a bunch of people trying to make this work! |
Hi @fabianishere, I'll make another round later today or tomorrow on this and let you know. Hi @jonferreira, If you're replacing 4K box with Android, I also suggest you to hold it and test. If you have your WiFi managed by UDM-Pro, I will work perfectly. I've made this setup because I hold a 4K box that need this specific multicast setup. Abd regarding the firewall settings, I'll continue to make some tests and prove Fabian information that the firewall rules might not be needed. But ping me anytime you might need. |
Yeah will do. The box will be replaced on January 3rd so not much of a point to work on this till then. Guess for now I'll focus on figuring out why I can't print to my printer wirelessly lol As much as I'm loving the UDM, there's deffo some rough edges that need to be taken care of! |
Hi @fabianishere, I confirm that I need two specific firewall rule, authorizing all multicast subnets to pass from WAN to LAN (Internet In type) and multicast subnet traffic in LAN (Internet Local type), to have IPTV working on my install. Without the first I have the 8-10 seconds freeze, without the second I have a 5 minutes freeze. I can update my post with the firewall settings needed for this setup. During my tests I've detected that some commands, specifically about Also, another note, all this research and settings were made without rebooting my UDM-Pro, so I don't know if this makes difference or not. I'm glad with all the work you've made and finally to be able again (after OpenWRT and pfSense/OPNsense) using my actual Ubiquiti setup. Thank you for your work and for UniFi to make the kernel changes to make it possible. Let me know if you need my help and further tests to research about your idea around the rules needs. |
MagentaTV, GermanyThis configuration is working for me on MagentaTV / DE on a BGN fiber connection with UDM (non-pro).
The proxy will only start once the ppp connection is up, this happens a while after the S15 boot execution.
If the proxy comes up too early, you will see messages about "VIF interfaces", just restart the container manually. With my (1.11) UDM I also needed to add firewall policies to allow inbound UDP and IGMP from the IPTV_WAN_RANGES on the "WAN in" firewall section. Of course IGMP snooping has to be enabled. |
Oh and thanks Fabian for the awesome work on this, I don't have to scrap my Unifi setup now! |
One last update on firewall rules, I found that I still had remaining issues until I implemented these firewall rules: While FireTV sticks with the MagentaTV app are working without issue with just the UDP rule, the MediaReceiver 401 device needs the "WAN local" too. I have no good indication why, found this by elimination - the receiver had 10 sec outages every 2.5 minutes, I assume this could be related to a igmp_proxy timeout that will try to switch between igmp v2 and v3 every 400 seconds. |
Hi @osterlitz, are you sure that FireTV app needs the UDP rules? Here in Portugal, local operators with AndroidTV, AndroidOS, tvOS or iOS are using service authentication with UDP unicast to provide channels and other services. I do not need any UDP rules for multicast subnets in my UDM-Pro. I just need the rules for my IPTV box. I'm "lucky" that my service don't use IGMPv3 and just IGMPv2. Also, just found out that my service just need multicast only for live tv. If I get back in time on live stream, watch a past or recorder program on TV, it uses only unicast. |
Hi @jpatriarca, Once unicast is working the app is streaming fine. LiveTV adds another requirement as it will use multicast. In the app this just requires IGMPv2, so it's one step harder - we need the multicast proxy now. If I shut that down, neither app nor receiver are working. The media receiver adds another requirement for IGMPv3 on top, this requires to force the IGMP version. If you don't do this, you will see IGMPv3 warnings with MagentaTV. With the wrong settings I see 10 sec outages every 2.5 minutes, these coincide with timeouts expiring in the icmp_proxy logs - these go away with the "WAN local" igmp allow. This is either related to igmp snooping by switches or more likely the proxy is trying to switch back to IGMPv3 periodically - group membership requests seem to be coming in in V2 only, this is probably driven by the switches as these are trying to become members to implement their snooping. Your results may vary based on your IPTV provider, the kind of fiber connection and the requirements of app or receiver model. |
Hi @osterlitz, When UDP multicast are involved (independently if it is IGMPv2 or IGMPv3), an igmpproxy needs to be implemented to pass this traffic from WAN to LAN. Thank you for your detailed description. |
This change updates the README with common configuration values based on the documentation in #2.
Closing this issue. Ideally, these values should be documented in the README or in a separate discussion if they require more configuration. |
Hey, what script did you rename or where can i find it to edit it? Thanks for the how to! BR |
Hi, thanks for the great work, guys! Everything works great, until the system gets rebooted or a new ip address is assigned to ppp0. Also, I haven't found the script anywhere. Is it a new one to be created in init.d? The directory /mnt/data/on_boot.d doesn't exist. Neither inside the unifi-sh container, nor outside. Could you give some insights, whether I am missing something, or is the installation broken? KR |
Oh, sorry, when I creasted the setup I forgot that I had the package below already installed / Fabian has a different way of persisting the install. https://github.com/boostchicken-dev/udm-utilities This package creates the /mnt/data/on_boot.d folder that I have my scripts in. @voegel: I have two small scripts to restart the proxy when an IP change is detected: cat /mnt/data/on_boot.d/94-ipchange.sh
cat /mnt/data/ipchange
|
Brilliant, thanks! That's what I assumed, as I had already found a reference to udm-utils. How is Fabian's implementation of persistence? And where does the service get started, if I don't go through udm-utils? |
@voegel It is just a systemd service that runs inside UniFi OS: https://github.com/fabianishere/udm-iptv/blob/master/debian/udm-iptv.service udm-utils uses the same approach to run the boot scripts. |
Hey @osterlitz, do you know how to force the IGMPv3 using the new version of @fabianishere iptv (https://github.com/fabianishere/udm-iptv)? Thanks and best regards |
I would have to solve the same problem. Is there somewhere a persistent approach for the new version. |
Hi @Onyxmoon, ich antworte dir einfach mal auf deutsch, die meisten im Rahmen von MangentaTV sprechen ja auch deutsch. Also das ganze persistent hinzubekommen ist kein großes Problem. Dafür kannst du https://github.com/boostchicken-dev/udm-utilities/tree/master/on-boot-script nutzen. Problematisch ist allerdings die Implementierung des igmpproxy. Diese unterstützt am Downstream-Interface aktuell leider nur IGMPv1 und IGMPv2. Es gibt dort aktuell einen relativ neuen Pull-Request für IGMPv3, dauert aber wohl noch ein paar Tage (pali/igmpproxy#80). Aktuell ist daher kein IGMPv3 für die Media Receiver möglich. |
Is there a way to restart the service when I get a force reconnect from the provider? |
Hi, I am trying to set Magenta TV up. Can someone help me please, where is that script located in which I need to make those changes described above? Is the rename of the file neccessary? If yes, why? Thanks |
You don't need that config. If you're using MagentaTV with a MagentaTV One, MagentaTV Stick, MagentaTV Box Play or an Apple TV, you don't need an IGMP-Proxy at all. If you're using a Media Receiver 400, 401, 200, 201 or a MagentaTV Box, it isn't possible because udm-iptv uses pali/igmpproxy which doesn't support IGMPv3 on the downstream device and also no source specific multicast |
Thanks, yes my goal is to make this work with Media Receivers 400, 401, 200, 201. Do you mean it is currently not possible at all to watch Magenta TV with a UDM Pro? Or is there another way? It certainly sounded like it was working for @osterlitz |
It is possible, but not with this project. MagentaTV with MR 401,... require an igmp-proxy with IGMPv3 on the downstream interface and ssm. You can read in the documentation (https://github.com/pali/igmpproxy/blob/master/doc/igmpproxy.8.in) of pali/igmpproxy the following "Currently only IGMPv1 and v2 is supported on downstream interfaces.". If you use osterlitz's solution, the IGMP doesn't work flawlessly. The MR401,... can downgrade to IGMPv2 for a while but on some it will fail |
Thanks for your help :) Can you push me in the right direction how it is possible, if not with this project? I am happy to adapt another solution. Is there another project out there or a blog or something that describes how to achieve IGMPv3 for MagentaTV on a UDM Pro? Thanks in advance |
I achieved it with mcproxy/mcproxy because it implements IGMPv3 on the downstream interface and supports ssm. Mcproxy works perfectly as long as the ppp0 interface isn't dropped due to internet connection loss. In case this happens anyway I wrote a short script which restarts the mcproxy as soon as the if ppp0 is up again. However keep in mind that installing mcproxy requires you to build the mcproxy and a debian package for the mcproxy on your own |
Thanks, are you using mcproxy standalone or are you integrating it into udm-iptv somehow? I guess the latter would require touching some code? |
I use mcproxy stand-alone and I didn't need to modify any code from mcproxy. I just wrote code for my small bash script which restarts the mcproxy. However as I said the script just restarts the mcproxy when the internet connection fails and therefore you don't need it for the initial setup |
Hey there @jpatriarca |
SP, MOVISTARSorry if this is the wrong place to record this information and feel free to move it to a more suitable place. Please find below the configuration for Spanish IPTV provider Movistar, with the following caveats:
|
Not works... Can you help me please @dogstyx ? |
Hi @viriatusX, could you provide some details about your setup/configuration and at which point it is failing your you? |
Thank you for your quick response @dogstyx . I have been trying for many days. Unify added native IGMP and IPTV support in 7.4 but only the channels and the guide work for me. Nothing else. VOD; U7D and menu are not working. I created these 2 topics: https://bandaancha.eu/foros/udm-no-funciona-movistar-tv-1749815 I have a HUAWEI ONT (compatible with Movistar) + UDM SE Thanks! |
Sorry if this seems obvious, but are you using the udm-iptv package? I don't think the native IGMP/IPTV combo is going to get you all the way through... Yes, you should get rid of the Movistar router and use a a compatible ONT that sends the traffic to the UDM through different VLANs. It should work with the UDM SE (which is the same equipment that I have), although I'm still in Network 7.3.83. VOD and U7D is a different story though, that will require an extra step but you have to get basic IPTV working before. |
@dogstyx Okay :)! Now I have some doubts. Then I need to create a WAN2 on Port 8 with the static values of Movistar TV, and assign VLAN 2 Prior 4, no? (Like this image): If not, when I launch this script, What interface do I have to use? I am not sure if it is eth8 in my case. I need specify static IP, Mask, Gateway and DNS provide by HGU previously. IPTV_WAN_INTERFACE="eth8" Then, I need to create a new VLAN on UDM GUI to assign DHCP IPs for assign to decoder in their settings no? or this is taken care of by the script in: IPTV_LAN_INTERFACES="br3" In this configuration what do I have to put exactly? IPTV_WAN_STATIC_IP="XX.XX.XX.XX/9" And for the last, how do I correctly add static routes in the UDM. I don't know if I have it configured correctly. After that, if it works, we could move forward to make U7D, VOD, etc. work. I plan to document everything in a tutorial. There are a lot of people who are not able to set it up as well. |
Go through the documentation of this package, it was meant to handle different vlans through the same port, which is something the native IGMP/IPTV implementation won't do. You have to create a VLAN for the IPTV and a network for the Movistar decoder, and assign the decoder an IP address within that network. br3 is the interface of the network that I created, yours may be different, you need to check what's the name of the interface that you have created. The IPTV_WAN_STATIC_IP is the address that Movistar has assigned to your decoder. This is a private address so be careful not to share it in any forum. You will have to create the static routes manually or through a script, every time the UDM SE is rebooted. |
Thanks again @dogstyx Excuse my clumsiness... VLAN: 2 If everything is done from 1 port, in my case WAN1 with Pppoe data, where do I put these static values if not creating another WAN? Then I created a VLAN with an IP range: 192.168.100.1/24 (br3) In the specific script in IPTV_WAN_STATIC_IP="10.254.XX.XX/9", correct? And finally I connect the Movistar Decoder to another port of the UDM and assign the "br3" profile, right? And, How do I create the routes manually, for example in your case? ip route add 172.23.96.0/21 dev br3 proto static scope link metric 1 ? If you have Telegram I would appreciate help. It will be easier to understand ... thanks for everything. |
Ok @dogstyx , I made some progress!: I think I understand: IPTV_WAN_STATIC_IP="10.254.XX.XX/9" With this value, it already calculates correctly the netmask, gateway provided by Movistar. It does not require anything else. Now: i added static routes with: ip route add 172.23.96.0/21 via 10.128.0.1 dev iptv UPDATE: ALL IS WORKING NOW! with your command: iptables -t nat -A PREROUTING -i iptv -p udp --dst 10.254.XX.XX <-- (UNIQUE IP MOVISTAR TV) -j DNAT --to 192.168.100.163 <-- Local IP assigned Movistar decoder. Without compiling RTSP module or anything else. Is there a way to boot script so that these commands are executed when UDM is restarted? THANKS for all! |
Hi @viriatusX, glad to hear that it's working for you! The iptables rule that you mentioned will allow all the MPEG2/TS traffic from Movistar VOD servers to your decoder with two important caveats:
The RSTP modules solution is safer since it only opens the port required for each VOD request (this is an oversimplification but it gives you an idea), plus it works with more than one decoder because the (net filter) module knows which decoder originated the request and where the VOD content need to be served to. Going this route is harder because it requires you to download and patch the modules, which is not rocket science but it is a more tedious process. Allow me some time and I'll prepare some guidelines on how to do that. As far as I know It's a bit difficult to run a script at startup with the UDM PRO SE, but there are ways to overcome the need for a startup script. Again, I will include that information in the guidelines. I hope you enjoy your Movistar on the UDM PRO, I've been running this for several months and it has been solid as a rock. A shoutout to @fabianishere for doing this work for the community. |
Hi @dogstyx ! I would love to know how you have compiled those RSTP modules to make the method more secure 🙏🏼. I'll keep an eye out for when you reply to the GitHub on how to do it. Many thanks to @fabianishere and you for all the work. |
Hi again @viriatusX, you can find here a step by step guide for the full process of configuring udm-iptv for Movistar, including RTSP modules compilation and installation (that was the hardest part to figure out by far). Go through the process and if you have any specific question let me know. The guide is in Spanish given the fact that Movistar is a provider with a very specific configuration that may not be applicable elsewhere, but if there is enough interest (and Google Translate doesn't do the job) I might consider translating that to English. The only thing that I will ask in return is that if you post anything about this specific Movistar solution please link back to the guide (as I did with the original sources within the guide) :-) Enjoy your Movistar setup with the UDM Pro SE! |
WOOOOOOW!!! Incredible!! I am going to do it now. could you send me the two modules already correct? As it is a UDM SE, it would work the same. I'm goig to post your guide in my Telegram Groups. It's perfect. Thanks for your work @dogstyx 🙏🏼 |
We should document somewhere the configuration necessary for different IPTV providers, so users can re-use these settings.
The text was updated successfully, but these errors were encountered: