Monday, February 16, 2015

Astro IPTV (Maxis FTTH) on OpenWRT

Updated on 5 July 2015:

The configuration still crashes the PPPoE on my router. With more research I’ve changed it to something that works (again).

Updated on 1 July 2015:

I’ve revisited the procedures and updated it with working configuration.

Due to the lack of (and misleading) information on the Internet, after hours of fiddling with my OpenWRT router (TM’s DIR-615 with OpenWRT flashed), I finally got Astro IPTV flawlessly working on my setup, and the Thompson router fully retired.

First thing’s first – if you have VoIP, it’s bad news for you – because my setup doesn’t have one – you’ll have to look elsewhere for your VoIP part.

Special Thanks

My success is partly due to the stumbling of this article related to configuring a Mikrotik router for Astro IPTV: https://rizvanrp.com/2014/09/re-implementing-astro-maxis-iptv/

To understand how everything works, refer to the above article.

Additional Packages

Go to the software section the your OpenWRT interface and install the following packages (if not already installed)

  • igmpproxy
  • kmod-bridge

Use this mirror if the one you’re using is down:

http://bo.mirror.garr.it/pub/1/openwrt/

Tip: How to obtain the packages if your OpenWRT is not even connected to the net – piggyback your Thompson router by temporarily setting your OpenWRT router’s WAN configuration to DHCP client, and connect a cable from any of Thompson’s port into your OpenWRT WAN port.

VLAN Configuration

On my router, Port 4 is the WAN port, yours might be Port 0 - VLANs are tagged on this,with your personal VLAN (usually ID 1) disabled.

As usual, CPU has all VLANs tagged, while normal ports have VLAN 1 untagged, other VLANs disabled.

Configuration summarizes to: 621 for PPPoE, 823 for IPTV.

 

PPPoE/WAN Configuration

Configure your WAN interface. Your username can be obtained from the Thompson router configuration page, the password is the number before the @, add ‘1’ at the back (e.g. 12345@public.maxis.com.my, password would be 123451)

Let the WAN interface sit on eth0.621

 

IPTV Configuration

Add a new interface, name it “IPTV” or something, set it as DHCP client sitting on eth0.823.

For the firewall configuration, create a new rule for this interface. Then head over to the created firewall configuration, set it to something like what’s shown below.

image

Additional firewall to accept IGMP multicasts from the VLAN 823 and forward UDP video data from VLAN 823 to our LAN.

image

Configuring IGMP Multicasting

Make sure IGMPProxy is disabled in the System > Startup section.

SSH login into your router (root account, your admin panel password), edit /etc/config/igmpproxy using vim.

Make sure it looks something like this:

   1:  config igmpproxy
   2:          option quickleave 1
   3:   
   4:  config phyint
   5:          option network eth0.823
   6:          option direction upstream
   7:          list altnet 172.17.90.1/32
   8:   
   9:  config phyint
  10:          option network br-lan
  11:          option direction downstream
  12:   
  13:  config phyint
  14:          option network pppoe-wan
  15:          option direction disabled
  16:   
  17:  config phyint
  18:          option network lo
  19:          option direction disabled







Check /sys/devices/virtual/net/br-lan/bridge/multicast_snooping make sure the file contains ‘1’ (without quotes) so that the traffic will not flood your wireless network if you’re using br-lan.


Enable snooping in your LAN network, edit /etc/config/network so the portion looks something like this:


   1:  config interface 'lan'
   2:          option ifname 'eth0.1'
   3:          option type 'bridge'
   4:          option proto 'static'
   5:          option netmask '255.255.255.0'
   6:          option macaddr 'xx:xx:xx:xx:xx:xx'
   7:          option ipaddr '192.168.0.1'
   8:          option gateway '192.168.0.1'
   9:          option igmp_snooping '1'



 


Finally, to fix the issue with powercycling the modem and router together causing igmpproxy to fail (because eth0.823 is up slower than igmpproxy) – we add a hotplug hook.


So ‘vim /etc/hotplug.d/iface/99-igmpproxy’ to create a script under the iface hotplug directory:


   1:  #!/bin/sh
   2:   
   3:  logger -t DEBUG "hotplug igmpproxy: device '$DEVICE' action '$ACTION'"
   4:   
   5:  [ "$DEVICE" = "eth0.823" ] && [ "$ACTION" = "ifdown" ] && /etc/init.d/igmpproxy stop
   6:  [ "$DEVICE" = "eth0.823" ] && [ "$ACTION" = "ifup" ] && /etc/init.d/igmpproxy start





Remember interface/device names corresponding to your own setup.


Finalize


Apply all settings and power cycle your router. Plug your IPTV cable into any port of your router (except WAN port, of course), and cable from Port 2 of your modem/DTU to the WAN port of your router.


Wait for it to fully boot and connected to the net, then power cycle your Astro STB.


Pray everything works (it should) on your STB – make sure program guides, time and all the features are available.

7 comments:

  1. bro,

    the subnet 172.0.0.0/8 is your LAN subnet or IPTV subnet?

    ReplyDelete
    Replies
    1. This is one of the IPTV upstream subnets sniffed. If you don't get the right subnet. igmpproxy will complain about invalid upstreams source not from valid subnets.

      Delete
  2. I tried both 172.0.0.0/8 and also using my local subnet but it's not working. The IPTV Box says everything is connected, I can get the EPG but video stream is not coming thru.

    ReplyDelete
    Replies
    1. Best to check your logs for clues. I've stopped using this solution as Maxis/Astro did something to their network that crashes my ethernet drivers if I use it with igmpproxy.

      Now I just bridge a port with VLAN 823 to receive the stream, occasionally (and initially) need to let the STB download the program guide and channel list from local LAN (through a normal port).

      Delete
    2. I've just updated the tutorial with latest working configuration.

      Delete
    3. This is what I'm running on my system. Btw, I'm using pfsense / no longer openwrt.

      quickleave
      phyint em1_vlan823 upstream ratelimit 0 threshold 1 <--- IPTV Physical Interface
      altnet 224.0.0.0/4
      altnet 239.0.0.0/8
      altnet 10.0.0.0/8
      altnet 172.16.0.0/14

      phyint em0 downstream ratelimit 0 threshold 1 <---- LAN Interface
      altnet 192.168.xx.xx/32 <----- This is IP for Astro IPTV BOX

      Delete
    4. Your altnet is not configured to the correct upstream I guess.

      altnet 172.17.90.1/32

      This entry is enough for my case. You need to get the logs for igmpproxy if your area somehow has different servers.

      Remember to allow inbound multicast packets in em1_vlan823 and forwarding of UDP traffic from em1_vlan823 to em0.

      I've updated my guide with settings that works flawlessly on my setup (the settings last time somehow failed after a few weeks).

      Delete