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.