

IPTV router
On my IPTV Recording page, I have put some information about connecting a linux htpc directly to the fiber modem to watch and record IPTV. Another solution that I already had in my mind for the last months is to use a small linux router, which can share the iptv link to the original Amino STB *and* a linux htpc. When I was thinking about this in the last months, I figures that in this setup it would even be possible to use a windows based htpc, because you don’t need to spoof the dhcp request on the windows host anymore. So on this page I’ve put some information together how to setup such a linux router. See also my blog article about the maximum amount of streams.
Software and Hardware
I’m using the the dd-wrt distribution for this. For the hardware I first tried the PC Engines WRAP board. I still had one of these laying around. Although dd-wrt does not officially support the WRAP, It did boot and everything worked, but when viewing 3 iptv streams at once, all streams were stuttering. The load of the linux router went up to 5 or 6, so it clearly couldn’t handle this amount of traffic with it’s 260MHz CPU. Then i switches over to the successor of the WRAP: The PC Engines ALIX board. Specifically the alix2d3. I also had one of these laying around. This with it’s 500MHz CPU it has more power to handle the mbit’s of data we’re going to send through.
Brand | Type | Working | Load | Comments |
---|---|---|---|---|
PC Engines | wrap1e203 | Partly | 10%@1 HD stream | Can not handle more than 2 streams |
PC Engines | alix2d3 | yes | 1%@1 HD stream, 19%@5 HD streams | No load problems |
I assume any other router that’s fully supported by dd-wrt will also work, as long as the CPU is strong enough to handle all the iptv streams you’re going to use. If you tried this setup with an other dd-wrt supported router, please tell me and I will add your information here as well.
Installing dd-wrt
For the Alix, installing dd-wrt is quite simple. You go to the dd-wrt router database. Search for Alix. There should only be one result. Click on the resultset. At this writing it recommended me version v24 PreSP2 [Beta] Build 13064. I downloaded the DD-WRT X86 Public Serial: Console image. After downloading the image can be copied with dd (under linux) directly to a compactflash card. You must use a compactflash card with a minimum size of 32MByte.
Place the compactflashcard into the alix. I also attached a null-modem cable to the serialport of the Alix so I can monitor the boot progress (serial settings 15200n8). Then I gave the Alix some power and watch it boot on the serial console. After booting, I attached my notebook with a network cable to the second network port eth1 (the one in the middle). We are going to use the eth0 as WAN connection to the iptv network. My notebook received a 192.168.1.x address through DHCP from the linux router.
Configuring dd-wrt
All configuration options we need to do, can be done in the webgui of dd-wrt. Open http://192.168.1.1 in the browser of your notebook to open the dd-wrt webgui. At first dd-wrt will ask you to enter a new loginname and password to secure the dd-wrt admin environment. Please change this to something you can also remember, or write this information down somewhere. When you are in the admin environment follow the next steps to configure the dd-wrt router to use it as a iptv router.
Click on gray tab Setup (below the dd-wrt logo). In the WAN Connection Type box, change the Connection Type to Automatic Configuration – DHCP. Click on the Apply Settings button below on the page.
Wait until the page is done refreshing, and click on the blue tab MAC Address Clone. Enable the MAC Clone and change the Clone WAN MAC to the MAC address of your Amino STB. It is printed on top on a sticker of your SetTopBox and it will probably start with 000202. Click on the Apply Settings button below on the page.
When the dd-wrt router is done applying these new settings, click on the blue tab Networking. Half way on the page there is a Port Setup box. Make sure that the WAN Port Assignment is set to eth0. If you have not applied the settings from the previous pages, you will probably see a config setting Network Configuration eth0. If this is true, change this setting for eth0 from Default to Unbridged. To be safe, click on the Apply Settings button below on the page.
When the dd-wrt router is ready, click on the gray tab Services. In the DHCP Client box, enter the value Aminoaminet130fisys in the box behind Set Vendorclass. This will make sure that the dhcp server of the IPTV network will see the DHCP request as if it was an Amino device, and return a correct IP-address. A bit lower on the page you will see the DNSMasq box. In this box enter the following value in the memo field below Additional DNSMasq Options:
dhcp-option=43,08:10:68:74:74:70:3a:2f:2f:77:2e:7a:74:36:2e:6e:6c:2f:10:10:45:75:72:6f:70:65:2f:41:6d:73:74:65:72:64:61:6d
This configuration setting will send back the dhcp option 43 (Vendor Encapsulated Information) inside the DHCP Offer from the dd-wrt router to the Amino STB. The hex-values hold the following information:
http://w.zt6.nl/ Europe/Amsterdam
This information is used by the Amino STB. The first line is the url opened by the STB, which should be a webpage including the menu of the STB. This menu holds links to the iptv streams. Click on the Apply Settings button below on the page.
After the page is done reloading, click on the gray tab Security. On this page you will see the box named Block WAN Requests. Uncheck the checkbox in front of Filter Multicast. This setting will now allow multicast traphic to flow from the WAN side (IPTV network) to the STB. The linux router will use an igmp proxy for this. Click on the Apply Settings button below on the page.
Testing connectivity
After changing all the settings mentioned above, it maybe wise to reboot the router. Go the the gray tab Services and click in the button Reboot Router on the bottom of the page. Then connect a networkcable from the fiber modem directly into the first networkport (eth0) of the linux router. For the Alix, this is the network port on the right side (next to the usb ports), when looking at the back of the router. After the router is rebooted, your iptv router should be ready to use.
First check on the web interface of the dd-wrt router if it has a successful connection to the IPTV network. Click on the gray tab Status, then click on the blue tab WAN. It should look something like this (at least when you use the IPTV service of fiber Internet provider XMS):
Connection Type:Automatic Configuration - DHCP IP Address: 10.252.16x.xxx Subnet Mask: 255.255.252.0 Gateway: 10.252.160.1 DNS 1: 82.139.121.131 DNS 2: 82.139.121.194
When this looks correct, then attach the STB to the thirth networkport eth2 (the networkport on the left side, looking from the back of the Alix). Apply some power to the STB after you connected it to the IPTV router and your tv. Then the STB should start (give it a minute or 2) and you can watch TV on the STB.
Remarks in usage
Because the STB is now connected through a linux router and not directly the firmware upgrade will not work. During the firmware upgrade the STB is doing a DHCP request with a different vendor class. This difference DHCP vendor class will return a slightly difference vendor encapsulated options back in the DHCP Offer. This time it will not hold a webpage with a menu for the STB, but a multicast address, which is be used by the STB to download the new firmware. Because the DHCP request to the IPTV network in the setup bescribed above is not done by the STB but by the router, and we have set the vendorclass on the router to Aminoaminet130fisys, this firmware upgrade will not work. If you really need an firmware upgrade, then connect the STB directly to the fiber modem, do the firmare upgrade, and then reattach it to the dd-wrt router.
The extra services like ‘Uitzending gemist’ also don’t work. I’m not sure (yet) why they don’t work, so I’ll try to figure that out some time and see if I can fix this.
Connecting a Linux htpc
When you have the IPTV with the STB running, you can attach a linux htpc, and use the STB and linux htpc at the same time. This gives you the opportunity to place the htpc in the living room, and use the STB in the bedroom, and be able to watch all your digital tv channels on both places without any conflicts. Because the dd-wrt router takes care of the most important parts of connecting to the IPTV network, the setup on a pc is easy.
A htpc must also keep it’s connection with the real internet, so my setup on my htpc involves two network cards. The first networkcard (eth0) is connected to a switch in my private network. This private network is using a 10.84.100.x/24 ip range and a dhcp server is running on a Asus router. This asus router is connected to the internet port of the fiber modem. The eth0 of the htpc is setup to use dhcp. The second networkcard (eth1) is setup with an static ip-address 192.168.1.2/24 and connected to the dd-wrt router. Make sure you don’t use any MAC address spoofing (as I showed on my IPTV Recording page), because this will give MAC conflicts between your linux htpc and your STB.
You need some extra static routes to send the traffic for the IPTV network to your dd-wrt router instead of your default gateway (internet router). For the IPTV service of fiber Internet provider XMS you need the following static routes:
Network | Destination |
---|---|
10.252.160.0/22 | gw 192.168.1.1 |
82.139.121.0/24 | gw 192.168.1.1 |
224.0.0.0/4 | dev eth1 |
Because the Linux htpc is using the DNS servers from my internet router, it will not be able to resolve any hostnames used on the IPTV. For this I’ve added some hostnames to the /etc/hosts file:
82.139.121.132 w.zt6.nl
After this, you can setup mythtv to use the iptv recorder, based on a m3u file. and you should be able to record up to 5 IPTV streams. Please take care. These maximum of 5 iptv streams are some kind of maximum from the IPTV network. When you are watching one stream on the STB, you can only watch or record a maxmimum of 4 streams on your htpc.
Connecting a Windows htpc
The first step is: Stop using windows, and install Linux on your htpc… (just kidding 🙂
Connecting a windows htpc directly with the IPTV network is a lot more difficult then connecting a linux htpc. The bigest issue is that the DHCP request must have a specific Amino Vendor class. This can’t be done in Windows, because this Vendor class is hardcoded into a dll file. With the dd-wrt setup I described above, you don’t have this problem anymore, which makes it possible to Windows as a htpc. I’m not using a windows htpc, but I can give some information here for the ones who do have a windows htpc.
When you are using the same setup as with my linux htpc, then make sure you have two network cards in your htpc. Connect the first one to your private network, which has a router to internet, and connect the second one to the dd-wrt router. Set the first networkcard to use DHCP to get an ip-address from your internet router and setup the second networkcard with a static ip-address. You could use the ip-address 192.168.1.2 with netmask 255.255.255.0. If you need to setup more htpc systems, use an ip-address between 192.168.1.3 and 192.168.1.99. This is because the dd-wrt router is using 192.168.1.100 til 192.168.1.150 for DHCP clients.
Setup the following static routes on the second networkcard:
Network | Netmask | Gateway |
---|---|---|
10.252.160.0 | 255.255.252.0 | 192.168.1.1 |
82.139.121.0 | 255.255.255.0 | 192.168.1.1 |
224.0.0.0 | 240.0.0.0 | 192.168.1.1 |
Then add the following lines to the file c:windowssystem32driversetchosts
82.139.121.132 w.zt6.nl
This should all be enough to be able to watch iptv streams on your windows htpc. If you have any questions, remarks, success or failure stories, please comment below!
Hi Robert,
tnx for sharing! Great manual!:p
To keep internet on the windows htpc its important to delete the 0.0.0.0 route to the iptv router.
route delete 0.0.0.0 MASK 0.0.0.0 [IP ADRESS IPTV-router]
Used an ASUS WL-500W with DD-WRT and successfully managed to grab the streams on my laptop using VLC. Grabbing 1 HD stream results in a 6% load for the router. I’ll do some more testing this weekend and will connect my HTPC to the router. I don’t have my Amino box yet so for the MAC address I took the router’s MAC and changed the first few bytes to 000202 leaving the others as they were. This seems to work without any problem.
Hi Scrappy Doo!
i also tried my ASUS WL-500W. unfortunately my ASUS WL-500W route 1 HD stream with 80% CPU load. so a second hd stream is not working for my asus router. Now i´m using an alix board and that works great up to 5 HD streams 😉
Bas,
Maybe you have an older Asus WL-500W with a slower CPU?
I don’t know if they use faster hardware after some time, while keeping the same productcode?
It’s surely a big difference 6% cpu load or 80% cpuload, both with an asus wl-500w
I’ll test multiple streams this weekend, but most likely will end up modifying the DHCP request from my HTPC and send the streams further using my TV Server. That way I can stream everything on my current LAN and I won’t need an extra router.
When using the router you can use the STB and your htpc.
With some extra tweaks, you can also do some fancy things with the STB 🙂
See http://twitter.com/exarv/status/14974941780
I know I can use both HTPC and STB when using the router, but I don’t like switching between both. The thing I like about my HTPC is that it allows me to both watch TV/Radio and watch content available on my home network (movies/pictures/music/etc). I doubt the STB is capable of doing anything my HTPC can not do.
When using the router, you can place the htpc in the living room, and the STB in the bedroom, and have all iptv streams on both locations. When your htpc can stream the files from the home network onto the network behind the router (with vlc for example) and you use the router to ‘enhance’ the current STB menu, you could have all your movies/music available on the network available on your STB as well. Main advantage with using a router is that you could use both and place them on 2 locations in your house.
Great tutorial.
It works fine for me.
Did you already find out how to get ‘Uitzending gemist’ get to work ?
Strange part is that the ‘brievenbus’ works.
Also the STB doen’t get the correct time.
How can I the router to ‘enhance’ the STB menu ?
No, I haven’t looked at the ‘Uitzending gemist’ part yet. It’s again very busy at work.
Enhanching the menu of the STB is a bit tricky. I’ve added an option to the dns server of the router,
so when the stb requests the menu file, the dsn will return the ip-address of the mythtv linux server.
On the linux server I’m running apache, which delivers a slightly changed index.xhtml,
But besides the index.xhtml you also have to setup all other files normally delivered by w.zt6.nl on the mythtv linux server.
Does somebody know, if its works on a WRT160N with the SP1 firmware?
Because all the time i go to the step “WAN Port Assignment” the router will crash
Please check the dd-wrt router database http://www.dd-wrt.com/site/support/router-database if your WRT160N is supported by dd-wrt.
It looks that Revision 1.0/1.1 is supported by SP1, but a preSP2 is recommended. Revision 2.0 is not supported. And Revision 3.0 is only supported by PreSP2.
I’ve Got the 1.0 router. Previously i tried dual WAN with the preSP2 build 14311, but got the same problems as the SP1 firmware.
I checked out the dd-wrt site, and dual wan with SP1 is supported.
Isn’t it possible to connect the linux router with your internet connection also. So you only need 1 network card in your HTPC. When your HTPC request iptv the router will send it to WAN1 and when it is a internet request it will send it to WAN2. I’m also trying to get this working (thanx for your great tutorials) but i don’t want to lay a second cable from router to HTPC, because i have to wreck mij floor (cables were laid before floor was laid over them….
That’s certainly the next step and just last week I already took that step 🙂
I’ve change the whole setup in my house. I now have one router with 2 WAN connections. One to internet and one to IPTV. The Amino STB and my mythtv pc are connected to the internal network, and the router decides if packages go to internet or to the IPTV network. I’m using Vyatta for this in stead of dd-wrt. But I had to hack a few scripts and files in vyatta to make it work. When I have a bit more time, I will make a tutorial for this as well, but because I had to hack a few things in Vyatta, it will not be an easy tutorial. But when it’s working it is working very nicely. Together with an extra perl proxy script I’ve been able to even get the ‘uitzending gemist’, ‘tv-guide’ and ‘rabobank tv’ working on the amino STB.
So keep an eye on this site (or my twitter) to see this new tutorial.
can you email the extra proxy script you’ve add to get even the ‘uitzending gemist’?
you need more than just the proxy script, also a few firewall rules must be changed.
I don’t know dd-wrt good enough how to do this, but in Vyatta I had to add a bit more changes to get everything (dhcp and iptv) working
I will try to post all this info in the next weeks.
Hi there, greetings from Iceland.
I have a similar setup here, IPTV over fiber and amino STB. I am trying to set up an IPTV router with vyatta (in vmware)
So far I have been able to get IP address , but thats about it. Are you willing to share some info on this ?
[…] the correct setup to receive multicast streams through udpxy (there are several good installation instructions on the […]
Is ‘Dual WAN’ Possible on the Netgear WNDR3700 ?
If so can anyone give me some pointers on configuration?
If not can anyone recommend a reliable router (preferable with ddwrt and or vpn support)
I don’t believe it is, for dual wan you would need VLANs which i don’t believe right now dd-wrt supports with that unit. With a decent broadcom unit you could do it, a refurbished linksys wrt320n is $40-45 right now. Pretty much any broadcom unit that supports VLANs should work with this…
http://www.dd-wrt.com/wiki/index.php/Dual_WAN_with_failover
These are tested units known to work with VLANs & dd-wrt.
http://www.dd-wrt.com/wiki/index.php/VLAN_Support
You don’t need any VLAN’s if you change the setup. I have replaced dd-wrt on the Alix with Vyatta.
The vyatta is now my internet router. eth0 is connected to the first port of the fiber modem (internet), eth1 is connected to the second port on the fiber router (iptv) an eth2 is connected to a switch, which is my internal network.
The only thing that gave me a few problems, was my access point, which was bridged into the local network. Because the switches in my local network are not multicast aware, All iptv traphic is send to all switches and machines inside the local network. Also through wireless. This gave some problems, because when mythtv was recording a HD stream, my access point was also sending 12 mbit/sec of data to all wireless devices (notebook, mobile phone). I’ve changes the access point into routing mode, so the wireless network is now on a different subnet then the internal (wired) network.
I’ll post some kind of howto about how I’ve setup everything on Vyatta in a few weeks hopefully, when I have a bit more time.
To get everything working (including interactive parts on the Amino through Vyatta), there are also a few changes needed in the vyatta scripts, so it’s not that easy as with dd-wrt.
Thanks for the reply. I could use Vyatta, but prefer DD-WRT. I saw it’s also possible to get Dual WAN working on the WNDR3700 with OpenWRT via the VLAN method. How come this is working with OpenWRT but not with DD-WRT?
That is something you would have to ask the devs of either firmware, i have seen people say that its possible on openwrt, but when i ask them to post confirmation or pics, they fade away, so really, untill i see it for myself, i don’t think it works yet.
Setup VLAN on WNDR3700 works fine with OpenWrt.
See my code below:
network …
# lan (vlan1)
config ‘interface’ ‘lan’
option ‘ifname’ ‘eth0.1’
option ‘type’ ‘bridge’
option ‘proto’ ‘static’
option ‘ipaddr’ ‘10.0.1.1’
option ‘netmask’ ‘255.255.255.0’
# dmz (vlan2)
config ‘interface’ ‘dmz’
option ‘ifname’ ‘eth0.2’
option ‘proto’ ‘static’
option ‘ipaddr’ ‘10.0.2.1’
option ‘netmask’ ‘255.255.255.0’
# switch ports 1-3 –> vlan1 (lan)
config ‘switch_vlan’
option ‘device’ ‘rtl8366s’
option ‘vlan’ ‘1’
option ‘ports’ ‘1 2 3 5t’
# switch port 0 (4 on box) –> vlan2 (wan only)
config ‘switch_vlan’
option ‘device’ ‘rtl8366s’
option ‘vlan’ ‘2’
option ‘ports’ ‘0 5t’
firewall …
# Reject traffic from DMZ
config ‘zone’
option ‘name’ ‘dmz’
option ‘input’ ‘REJECT’
option ‘output’ ‘ACCEPT’
option ‘forward’ ‘REJECT’
# Allow DMZ to use the router as a DNS server
config ‘rule’
option ‘src’ ‘dmz’
option ‘proto’ ‘tcpudp’
option ‘dest_port’ ’53’
option ‘target’ ‘ACCEPT’
# Allow the DMZ to use the router as DHCP server
config ‘rule’
option ‘src’ ‘dmz’
option ‘proto’ ‘udp’
option ‘dest_port’ ’67’
option ‘target’ ‘ACCEPT’
# Allow the DMZ to access the internet
config ‘forwarding’
option ‘src’ ‘dmz’
option ‘dest’ ‘wan’
# Allow the LAN to access the DMZ
config ‘forwarding’
option ‘src’ ‘lan’
option ‘dest’ ‘dmz’
Hello robert,
Any news on ‘ uitzending gemist’ and epg? Thanks to your tutorial i have my ip tv router working. Only epg and uizending gemist Will not work
Bas,
A few months back I had all the interactive stuff on the amino STB working. On the router I placed a pel script (aproxy with a few modifications). But that is not working anymore, so I have to dig into it again (when I have a bit more time). The idea was, that when a interactive stream is opened from the STB I’m forwarding this connection to a local port on the router. Behind this local port is a perl script, which opens the connection to the original ip-address. Then the perl script monitors the contens of the stream from the amino stb to the iptv network, and replaces the internal ip-adress of the amino stb by the external ip-address. Also the content-length in the steam must be updated accordingly. I also changed the config of the router to forward all incoming connections from the iptv network to the amino stb. (The interactive stuff opens a connection from the iptv network to the amino, and the amino sends its ip address inside the data when requesting the stream. Thats why this is not working very easily with NAT.)
What version of the WNDR3700: v1, v2 (both Atheros) or v3 (Broadcom)?
Hi Guys,
After a few months i decide to undust my Alix board and try to make it work again… I follow every step in the manual, the amino is connecting, no errors, but i got no image… when i look at the guide at the setopbox, i can see the channels but no guide information. Are there any changes?