• Stars
    star
    423
  • Rank 102,544 (Top 3 %)
  • Language
    Shell
  • License
    GNU General Publi...
  • Created about 3 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Helper tool for configuring routed IPTV on the UniFi Dream Machine (Pro)

IPTV on UniFi OS

This document describes how to set up IPTV on UniFi routing devices based on UniFi OS, such as the UniFi Dream Machine (UDM) or the UniFi Dream Router (UDR). These instructions have been tested with the IPTV network from KPN (ISP in the Netherlands). However, the general approach should be applicable for other ISPs as well.

For getting IPTV to work on the legacy UniFi Security Gateway, please refer to the following guide.

Contents

  1. Global Design
  2. Prerequisites
  3. Setting up Internet Connection
  4. Configuring Internal LAN
  5. Configuring Helper Tool
  6. Troubleshooting and Known Issues

Global Design

        Fiber
          |
    +----------+
    | FTTH NTU |
    +----------+
          |
      VLAN4 - IPTV
      VLAN6 - Internet
          |
      +--------+
      | Router |  - Ubiquiti UniFi device
      +--------+
          |
         LAN
          |
      +--------+
      | Switch |  - Ubiquiti UniFi Switch (Optional)
      +--------+
       |  |  |
       |  |  +-----------------------------+
       |  |                                |
       |  +-----------------+              |
       |                    |              |
+--------------+       +---------+      +-----+
| IPTV Decoder |       | WiFi AP |      | ... |
+--------------+       +---------+      +-----+
  - KPN IPTV
  - Netflix

Prerequisites

Make sure you check the following prerequisites before trying the other steps:

  1. The kernel on your UniFi device must support multicast routing in order to support IPTV. Please upgrade to the latest firmware.
  2. The switches in-between the IPTV decoder and the UniFi device should have IGMP snooping enabled. They do not need to be from Ubiquiti necessarily.
  3. The FTTP NTU (or any other type of modem) of your ISP must be connected to one of the WAN ports of your UniFi device.

Setting up Internet Connection

The first step is to set up your internet connection to your ISP with the UniFi device acting as modem, instead of some intermediate device. These steps might differ per ISP, so please check the requirements for your ISP.

Below, we describe the steps for KPN. Feel free to update this document with the steps necessary for your provider.

KPN

If you are a customer of KPN, you can set up the WAN connection as follows:

  1. In your UniFi Dashboard, go to Settings > Internet.
  2. Select the WAN port that is connected to the FTTP NTU.
  3. Enable VLAN ID and set it to 6 for KPN.
  4. Set IPv4 Connection to PPPoE.
  5. For KPN, Username should be set to internet.
  6. For KPN, Password should be set to internet.

Configuring Internal LAN

To operate correctly, the IPTV decoders on the internal LAN possibly require additional DHCP options. You can add these DHCP options as follows:

  1. In your UniFi Dashboard, go to Settings > Networks.
  2. Select the LAN network on which IPTV will be used. We recommend creating a separate LAN network for IPTV traffic if possible in order to reduce interference of other devices on the network.
  3. Enable Advanced Configuration > IGMP Snooping, so IPTV traffic is only sent to devices that should receive it.

Configuring Helper Tool

Next, we will use the udm-iptv package to get IPTV working on your LAN. This package uses igmpproxy to route multicast IPTV traffic between WAN and LAN.

Installation

SSH into your machine and execute the commands below in UniFi OS (not in UbiOS).

sh -c "$(curl https://raw.githubusercontent.com/fabianishere/udm-iptv/master/install.sh -sSf)"

This script will install the udm-iptv package onto your device. The installation process supports various pre-defined configuration profiles for popular IPTV providers. Below is a list of supported IPTV providers:

Provider Country Supported
KPN NL Yes
XS4ALL NL Yes
Tweak NL Yes
Solcon NL Yes
Telekom DE Manual configuration necessary
MagentaTV DE Manual configuration necessary
Swisscom CH Yes
Init7 CH Yes
MEO PT Yes
BT GB Yes
Vivo SP BR Yes - Tested with GPON TP-Link TX-6610
Vivo GVT BR Yes - Manual configuration necessary
Telenor NO Yes
PostTV LU Manual configuration necessary

If your ISP is not supported, you may select the Custom profile, which allows you manually configure the package to your needs. We appreciate if you share the configuration so others can also benefit. See the profiles directory for examples of existing configuration profiles.

The package installs a service that is started during the boot process of your UniFi device and that will set up the applications necessary to route IPTV traffic. After installation, the service is automatically started.

If you experience any issues while setting up the service, please visit the Troubleshooting section.

Installation across Firmware Updates

Please remember to make a backup of your configuration before a firmware update. Currently, your configuration and installation might or might not persist across firmware updates depending on the type of upgrade (see #120).

Configuration

You can modify the configuration of the service interactively as follows:

udm-iptv configure

See below for a reference of the available options to configure:

Option Description
IPTV_WAN_INTERFACE Interface on which IPTV traffic enters the router
IPTV_WAN_RANGES IP ranges from which the IPTV traffic originates (separated by spaces)
IPTV_WAN_VLAN ID of VLAN which carries IPTV traffic (use 0 if no VLAN is used)
IPTV_WAN_DHCP Boolean to indicate whether DHCP is enabled on the IPTV WAN (VLAN) interface
IPTV_WAN_DHCP_OPTIONS DHCP options to send when requesting an IP address
IPTV_WAN_STATIC_IP Static IP address to assign to the IPTV WAN (VLAN) interface (if DHCP is disabled)
IPTV_WAN_MAC Custom MAC address to assign to the IPTV WAN VLAN interface
IPTV_LAN_INTERFACES Interfaces on which IPTV should be made available
IPTV_IGMPPROXY_DEBUG Enable debugging for igmpproxy

The configuration is written to /etc/udm-iptv.conf (within UniFi OS).

Upgrading

Use the following command to upgrade udm-iptv:

udm-iptv upgrade

If that command does not exist, please re-run the installation script.

Removal

To fully remove an udm-iptv installation from your UniFi device, run the follow command:

udm-iptv uninstall

Troubleshooting

Below is a non-exhaustive list of issues that might occur while getting IPTV to run on your UniFi device, as well as troubleshooting steps. Please check these instructions before opening a discussion.

  1. Check if your IPTV receiver is on the right VLAN
    Your IPTV receiver might not be VLAN to which the IPTV traffic is forwarded.
  2. Check if IPTV traffic is forwarded to the right VLAN
    Make sure that you have configured IPTV_LAN_INTERFACES correctly to forward to right interfaces (e.g., br4 for VLAN 4).
  3. Check if your kernel supports multicast routing
    If MRT_INIT failed; Errno(92): Protocol not available appears in diagnostics, your kernel does not support multicast routing.
  4. Check if your issue has been reported already
    Use the GitHub search functionality to check if your issue has already been reported before.

Getting Help or Reporting an Issue

If your issues persist, you may seek help on our Discussions page. Please keep GitHub Issues only for bugs or feature requests related to the project (no configuration-related issues).

When opening a discussion or reporting an issue, please share the name of your ISP as well as the diagnostics reported by our diagnostic tool:

udm-iptv diagnose

Contributing

Questions, suggestions and contributions are welcome and appreciated! You can contribute in various meaningful ways:

  • Report a bug through GitHub issues.
  • Contribute improvements to the documentation (e.g., configuration for other ISPs).
  • Help answer questions on our Discussions page.

License

The code is released under the GPLv2 license. See COPYING.txt.

More Repositories

1

pam_reattach

Reattach to the user's GUI session on macOS during authentication (for Touch ID support in tmux)
C
683
star
2

brainfuck

Brainfuck interpreter written in C
C
535
star
3

pve-edge-kernel

Newer Linux kernels for Proxmox VE 7
Shell
370
star
4

udm-kernel-tools

Tools for bootstrapping custom kernels on the UniFi Dream Machine
Shell
327
star
5

udm-kernel

Custom Linux kernels for the UniFi Dream Machine
C
128
star
6

boot2flappy

Flappy Bird as bootable UEFI executable
Assembly
62
star
7

kotlin-plugin-generated

A Kotlin compiler plugin that annotates Kotlin-generated methods for improved coverage reports
Kotlin
35
star
8

brainfuck-java

Interpreter for the original Brainfuck language and its derivatives written in Java.
Java
31
star
9

booklab

Visually recognize the books on your shelf!
Kotlin
23
star
10

udm-unlock

Unlock write-protected disks on the UniFi Dream Machine Pro
C
20
star
11

kexec-mod

Kexec as loadable kernel module for Linux ARM64 kernels
C
16
star
12

jsamp

Library for the Grand Theft Auto San Andreas Multiplayer query mechanism written in Java.
Java
6
star
13

broccoli

A modern vision on the 90's game Log!cal
Java
5
star
14

formula-andy

Formula One Manager written in Java
Java
5
star
15

ktor-oauth2

OAuth2 authorization framework for Ktor
Kotlin
5
star
16

traceur

Raytracing engine written in C++
C++
5
star
17

shadevolution

Genetic Programming for Shader Simplification
Python
4
star
18

hugetable

Re-implementation of Google BigTable in Scala
Scala
4
star
19

logging.js

Lightweight logging library for Node.js based on the java.util.logging library.
JavaScript
4
star
20

nitrogen

Lightweight web framework written in PHP
PHP
4
star
21

sas

Simple streaming audio server in C
C
4
star
22

kaffee

Kaffee is a software project management tool similar to Maven and is written in Coffeescript.
CoffeeScript
4
star
23

edx

Solutions for online courses
F#
4
star
24

slf4n

Simple logging facade for NodeJS allowing the end user to choose the desired logging framework at deployment time.
JavaScript
3
star
25

iconsync

A tool to sync your icon theme on macOS
Swift
3
star
26

udm-shims

Shims for the proprietary kernel modules on the UniFi Dream Machine (Pro)
C
3
star
27

homebrew-personal

Personal Homebrew recipes that are not (yet) available in the official Homebrew repositories
Ruby
3
star
28

trufflephp

GraalVM implementation of the PHP language (WIP)
Kotlin
2
star
29

olympiad

Solutions for the problems of the Dutch Olympiad of Informatics.
Python
2
star
30

vdom.js

Rebuilding React from scratch
JavaScript
2
star
31

kmbridge

In-kernel IGMP Proxy for Linux (WIP)
C
1
star
32

glimpse

Small OpenGL wrapper for modern C++
C++
1
star
33

fastauction

Auctions with Budget Constraints
Kotlin
1
star