KPN Routed IPTV on an Ubiquiti EdgeRouter Lite - Lessons Learned

Written by Pim on Monday March 28, 2016 - Comment - Permalink
Categories: technology, howto - Tags: KPN, IPTV, Ubiquiti, EdgeRouter

In February 2016, I moved from Ziggo to KPN Fiber because of the higher upload speed and because fiber was available in my new home.
I don't like the experiabox which is installed by default so I ordered an Ubiquiti EdgeRouter Lite.
The Ubiquiti EdgeRouter Lite is capable of routing 500/500 Mbit connections and has many more advanced features.

I found a very good HOWTO at Kriegsman.io how to configure the Ubiquiti EdgeRouter with KPN Fiber.
Unfortunately, not all configuration mentioned at that blog is best practice and possibly causes IPTV malfunction.

Add a second NAT translation to 10.16.0.0/16

Because the KPN IPTV platform is working on 213.75.112.0/21 and 10.16.0.0/16 so both subnets should be added to your NAT configuration.

nat {
    rule 5000 {
        description IPTV
        destination {
            address 10.16.0.0/16
        }
        log disable
        outbound-interface eth0.4
        protocol all
        source {
        }
        type masquerade
    }
    rule 5001 {
        description IPTV
        destination {
            address 213.75.112.0/21
        }
        log disable
        outbound-interface eth0.4
        protocol all
        source {
        }
        type masquerade
    }
}

Check your static IP (error code 561)

If your IPTV decoder doesn't start but returns an error code 561, it can't connect to the KPN IPTV platform. This can have two reasons:

  1. There is a rogue DHCP server on your network
  2. Your static IP configuration is wrong

To check if there is a rogue DHCP server on your network, use this tool provided by Microsoft: http://blog.mir.net/2014/10/rogue-dhcp-server-detection-free-tool.html
In my case, there wasn't a rogue DHCP server on my network, it was a wrong static IP configuration.

To check if the static IP binds to an interface, open the EdgeRouter web interface, go to 'Routing' and check if the static route you defined is bound to your IPTV VLAN interface (eth0.4 in my configuration). If not, you can be 100 % sure the static IP configuration is wrong.

Resolve this by running the following commands in your EdgeRouter:

sudo su
r_ip=$(show dhcp client leases | grep router | awk '{ print $3 }');
iptv_static=$(echo "set protocols static route 213.75.112.0/21 next-hop $r_ip")
echo -e "$iptv_static"
exit

This will return a command you can run in the EdgeRouter configure mode. Don't forget to remove the old static IP route!

Black screen

The IPTV decoder is booting up, the EPG is available, but the screen stays black? Probably the IGMP-proxy isn't doing its job.

Kriegman.io defines the IGMP proxy as following:

protocols {
    igmp-proxy {
        interface eth0.4 {
            alt-subnet 0.0.0.0/0
            role upstream
            threshold 1
        }
        interface eth1 {
            alt-subnet 0.0.0.0/0
            role downstream
            threshold 1
        }
    }
}

This is WRONG because the upstream interface should define the IPTV subnets and the downstream shouldn't define any subnet.
The corrected one:

protocols {
    igmp-proxy {
        interface eth0.4 {
            alt-subnet 10.16.12.0/16
            alt-subnet 213.75.0.0/16
            role upstream
            threshold 1
        }
        interface eth1 {
            role downstream
            threshold 1
        }
    }
}

And my IPTV was working again! :-)

If you are in trouble with your Ubiquiti IPTV configuration, contact me on e-mail or send me a tweet on Twitter!


comments powered by Disqus