Interactive television with OpenWrt (Telenet Digicorder or Proximus decoder behind your own router)
tl;dr:
use a VLAN to link the WAN port with the LAN port the set-top box is attached to.
My tv set-top box (Telenet Digicorder in Belgium) needs an external IP address. Without it, you’re missing certain functions, such as browsing the program guide further than two days, or planning recordings over the web. The Digicorder only gets an external IP address when it’s connected to the modem/router my ISP (Telenet) installs.
If you use your own router with DHCP enabled, you run into troubles. Everywhere on Belgian forums you will find that I should buy Powerline adapters to keep a direct line between the Digicorder and the Telenet router. Or I should drop the (silly) idea to have my own router… But where’s the fun in that?
My home network
For personal reasons (guest wifi, VPN, etc.), I like having my own router connected to the Telenet router, with DHCP enabled for a different subnet. The router I use is a Linksys WRT1900AC with OpenWrt. In my apartment, the Telenet modem/router is installed in a storage room. My NAS (a noisy old pc) is also located there. That’s why I installed the WRT1900AC there as well. The WRT1900AC WAN port is connected to a port on the Telenet router. One of the LAN ports is connected to the NAS, another to a cable in the wall that arrives behind the television. At the television location, there are several devices that need LAN and/or WAN connectivity: the A/V receiver (LAN), Playstation 4 (LAN), Raspberry Pi with OpenElec (LAN) and then the Digicorder (LAN+WAN!). I use a TP-Link TL-WR1043nd (v1) as a switch to distribute internet at the television location.
I admit that my setup is more complex than the average Telenet customer’s setup, so first I will explain how to have the Digicorder behind just one router (other than the one provided by Telenet), then with the extra switch.
How NOT to do it
Telenet doesn’t use IPTV, so my initial attempts to use igmpproxy with OpenWrt were a waste of time. I also don’t want to use Powerlink or pull extra wires through the wall, that would be the easy way out.
Digicorder behind one router
Let’s just start with what most people would do: installing a personal router behind the Telenet router and attach the Digicorder.
You need to create a VLAN (Virtual LAN) to link the port the Digicorder is attached to with the WAN port. How your current switch setup looks, depends on the router/switch you have. In the WRT1900AC, there are already two VLANs. If you’re not sure about the port numbers, look up your router in the OpenWrt wiki.
These are the ports for the WRT1900AC, taken from the WRT1900AC OpenWrt wiki at the time of writing:
The standard switch setup is this:
Which looks like this in /etc/config/network:
config switch_vlan option device 'switch0' option vlan '1' option vid '1' option ports '0 1 2 3 5' config switch_vlan option device 'switch0' option vlan '2' option vid '2' option ports '4 6'
The cable towards the Digicorder is attached to port 3, so we remove it from VLAN 1 and add it to VLAN 2:
/etc/config/network:
config switch_vlan option device 'switch0' option vlan '1' option vid '1' option ports '0 1 2 5' config switch_vlan option device 'switch0' option vlan '2' option vid '2' option ports '3 4 6'
No further customization is required! Tagging isn’t needed because each port belongs to just one VLAN. The firewall rules are still fine. Port 3 belongs to the WAN zone now.
Digicorder behind a router and a switch
Now let’s add an OpenWrt switch to provide internet to the other devices at the Digicorder’s location.
On the WRT1900AC, port 3 (cable going to the TL-WR1043nd) will be used for both LAN and WAN traffic, so the port will be added to both VLANs and tagging needs to be enabled:
/etc/config/network on the WRT1900AC:
config switch_vlan option device 'switch0' option vlan '1' option vid '1' option ports '0 1 2 3t 5' config switch_vlan option device 'switch0' option vlan '2' option vid '2' option ports '3t 4 6'
The TL-WR1043nd will be used as a switch, so the DHCP server is disabled. I also won’t need the WAN port anymore, so port 0 will be added to VLAN 1. Port 1 is used for the Digicorder. Port 0 is the cable from the WRT1900AC and it needs to be tagged (because it is tagged when it leaves the WRT1900AC on port 3).
/etc/config/network on the TL-WR1043nd:
config switch_vlan option device 'switch0' option vlan '1' option ports '0t 2 3 4 5t' config switch_vlan option device 'switch0' option vlan '2' option ports '0t 1 5t'
So the Digicorder is in a separate VLAN with the cable coming from the WRT1900AC.
I removed the WAN interface and added a second LAN interface. LAN is attached to eth0.1 (VLAN 1) and LAN2 to eth0.2 (VLAN 2). Notice that I removed the wifi network, but feel free to leave it. Both interfaces are configured to be DHCP clients. LAN will get its IP from the WRT1900AC and LAN2 will get it from the Telenet router.
Both LAN and LAN2 are in the same firewall zone. The WAN firewall zone is still there but is unused.
At this point the Digicorder gets an IP address from the Telenet router and an external IP! The only thing left to do is to enable masquerading in the WRT1900AC for the LAN zone. Only then you are able to login into the TL-WR1043nd for configuration:
That’s it!
Note 18/10/2018:
This works exactly the same with a Proximus decoder. Don’t be fooled (like I was) by the fact that IPTV works via VLAN 30. That’s only from the Bbox towards Proximus. I used VLAN 2 just fine.
I changed the local IP subnet for the Bbox to 192.168.0.x. My own router still works with 192.168.1.x. The decoder will get an IP address from the Bbox (e.g. 192.168.0.64) after setting up as described above. The only difference is that on the WRT1900ac, the WAN interface (on eth1) now connects to Proximus via PPPoE instead of being a DHCP client when used for Telenet.
Interesting setup, but kinda overkill, for most ppl here adding a simple unmanaged switch to split the LAN connection from the telenet modem into a direct line to the digicorder, and into the WAN side of a 2nd router. It avoids having to add extra cables and can work with POE / wifi bridges / … and can work with fairly cheapo unmanaged switches instead of (more expensive) managed ones.
Well, I don’t see how adding a switch is simpler than using the exising hardware… The whole point was using what I had without having to run extra cables. Also don’t forget that there’s other hardware (mediacenter, PS4…) near the digicorder, that needs to be part of the same vlan as the NAS near the router. So an unmanaged switch wouldn’t have worked anyway.
Hallo,
ik heb uw manier gevolgd om mijn digibox achter een router en switch interactief te krijgen. Maar geen succes.
Ik heb dezelfde switch als jij met openwrt erop.
De router die ik heb is een asus. Openwrt is er wel voor maar wifi not supported dus staat er een andere custom firmware op.
Alles ingesteld als u maar toch krijg ik door de switch geen ip.
De kabel van de asus router rechtstreeks op mijn pc geeft wel een ip door.
Mag ik vragen welke modem van telenet jij hebt? Misschien is dat het probleem wel.
Ook op de switch stel je beide lans in als dhcp clients. Moet ik in openwrt iets speciaals nog instellen hiervoor of enkel het protocol wijzigen van de lan’ naar dhcp client?
Trouwens de modem die ik heb is de Wireless modem 3.0(docsis).
Great post. Very interesting.
I have the same router Linksys WRT1900AC but still using cable-TV (VOO).
Now that I want to move to Proximus T (to be still installed), I am facing exactly the sae question as I have a single Ethernet cable going from y office to the living room (where I will thus have a mix of LAN traffic and IPTV traffic, as in your case).
I was considering to buy two managed switch to avoid passing a second Ethernet cable. However, I noticed there was a VLAN option in the Linksys router menu: so I wonder if a single managed switch would work if I figure how to use the router own limited VLAN options. But I don’t move to OpenWRT firmware for the WRT1900AC: I am still relying on the Linksys commercial firmware for the router and I would like to keep it as such as far as it works well.
Here is the Linksys cryptic documentation about the VLAN menu option
https://www.linksys.com/us/support-article?articleNum=205502
Questions:
– in the case you describe: do I get it right that you must put two distinct short internet cables between the bbox and the WRT1900AC router: one on “port 4” (for the IPTV traffic once untagged), and any other port for the LAN PPOE traffic?
– But if the router is used (as you indicated), in my case where I have the standard firmware, do you understand how the Linksys menu entry for configuring VLAN is meant to work: it is a bit unclear for me.
– Maybe it would be better two purchase two managed switches and let the router completely unaware of the IPTV traffic, dedicating its power to the LAN traffic only…
(sorry for the few typos – the forum doesn’t allow to edit a post afterward)
Finally, I decided to order to managed switches instead (so that the router is completely unaware of IPTV traffic, also taken into account that the VLAN options aren’t well documented by Linksys: moreover, I found two very cheap Zyxel ones online for best than 50 euros (for the two).
Hi,
Sorry for my late response.
Did you get it working with the managed switches?
Hi: I bought two managed switches and the telco technician cam today to activate the TV.
I did manage to get two distinct VLAN passed through the singleEthernet cable thanks to the manage switches. Great suggestion.
However, I am facing a problem: when I connect my LAN router to the model (using Ethernet/PPOE), the managed witch detects a “loop” and block the port… probably because the switch is connected a the same time to the model through two channels:
1/ the port that I directly connected to the MODEM for dedicated TV traffic and which is only sharing a (V)LAN with the TV decoder
2/ …but the same modem is also indirectly connected through on a port of my LAN router for the Internet traffic….
Hence I cannot get yet my “Internet-connected LAN” through the cable… It only works when my router is disconnected from the modeM…
I am thinking on how to address that: there must be a solution…
Hi Niek,
I’m trying to get the “Digicorder behind a router and a switch”-setup working with a EA6500+DDwrt and a Cisco SG200.
Unfortunately there is no openWRT for the EA6500, and DDwrt only allows command-based VLAN-config with all functionalities. The SG200 is not accessible via any command-line, making it hard to define whether there are any CPU-ports that might need modification.
Anyway, I changed the default on my EA6500 from
root@DD-WRT:~# nvram show | grep vlan.*ports | sort
size: 35303 bytes (226841 left)
vlan1ports=0 1 2 3 8*
vlan2ports=4 8
root@DD-WRT:~# nvram show | grep port.*vlans | sort
size: 35303 bytes (226841 left)
port0vlans=2
port1vlans=1
port2vlans=1
port3vlans=1
port4vlans=1
port5vlans=1 2 16
to :
root@DD-WRT:~# nvram show | grep vlan.*ports | sort
size: 35182 bytes (226962 left)
vlan1ports=0 1t 2 3 8*
vlan2ports=1t 4 8
root@DD-WRT:~# nvram show | grep port.*vlans | sort
size: 35182 bytes (226962 left)
port0vlans=2
port1vlans=1 2
port2vlans=1
port3vlans=1
port4vlans=1
port5vlans=1 2 16
On the SG200 I have port 1 (where EA6500 is connected) tagged in both VLANs 1 & 2, port 2 is connected with the digicorder.
The digicorder is not connecting, but if I connect my laptop to that port I get a 192.168.0.x-address. The LAN-ports (VLAN1) are all wel, I can access NAS, PS,….
Any suggestions are much appreciated !
Hi,
I don’t have experience with DD-WRT unfortunately.
You must be close, because you get an IP address from the Telenet router on the port you want to connect the digicorder to.
Possibly you need to change some firewall rules?
Hi,
I have the same linksys router. My question is, where you change these settings?
Situation:
Telenet router in basement.
Powerline in basement and living.
Linksys connected with powerline in living.
Digicorder connected with Linksys.
No internet on digicorder.
If i put the digicorder straight in the powerline, connection.
Also yelo works on all devices.
So I need to fix the VLAN? Where to start?
Thank you in advance.
You are in the situation that I describe as “digicorder behind one router”.
Just move the port that goes towards your digicorder to the same VLAN as the port where your powerline comes in. You can do that using the Luci webinterface of the router, or via /etc/config/network over ssh for example.
Thank you but that is like Chinese for me. Its possible to do with the app of linksys?
I have an option :
“switch 1 port”
Options:
– name new rule
– external port
– internal port
– select ip adress ~ search aparaat
– protocol
Just I dont know what to put as external or internal port.
Only smartphone and tablets in the home. No pc or laptop.
Thanks in advance again.
Hiya, if you connect the port that gives 2 ip’s (one internal one external) to a switch, what do other devices get as ip? Or do i need to have a managed switch for that?
Atm i’m working with a switch between the router and the modem to split both up. But i want to have a solution so i can use that one cable of the digibox for other devices aswell (smarttv/ps4/..)
Thanks!
Yes, you’d have to use a managed switch, because the port that goes from the swith to the Digicorder needs to be tagged.
Hello,
Thank you for this tutorial! It works perfectly!
Well, almost….
My Digibox gets nice his 10.xxx IP, but does not get an InHome IP…. And I don’t know why.
Do you get an inhome IP? Technically, I still do not see how it is possible to get an Inhome IP….
Also, can you explain the very last part about the masquerading. I do not know why that is needed. It seems to work all perfectly without the masquerading rule.
Thank you very much for your help!
Hi Arnout,
Thanks for your question.
As shown in one of my pictures, my Digicorder gets two IP’s from the Telenet router: 10.x.x.x and 192.168.0.x.
It does not get one from my own router (192.168.1.x), which is normal.
If you get the 10.x one, that means you’ve setup your own router correctly.
It’s weird you’re not getting the second one.
Are you able to reach your Digicorder using the Yelo TV app?
As for IP masquerading, this was needed to be able to reach the configuration page of the second router I installed (Telenet router – Router 1 (WRT1900AC) – Router 2 (TL-WR1043) – Digicorder).
More info here: https://wiki.openwrt.org/doc/uci/firewall#masquerading_on_lan
Good luck!
Hello,
Thanks for the reply.
In the Settings interface on my digibox I only see the 10.x.x.x address, but I am able to ‘swipe’ programs from my Yelo app to the digibox and to see my recordings etc.
So, everything seems to work.
After further reading, it seems that the 192.x.x.x address is only used to stream DLNA content from other home devices to the digibox, which is not something I need.
Can you maybe confirm that I am correct on that one?
Everything else seem to work perfectly, so once again, thank you for your guide. This really helped me out a lot!
A.
The main reason why I did this was to be able to use my own router together with the Yelo app and a program schedule longer than 3 days.
If that works, then you’re set!
Still not sure why you only get one IP address but you’re right, I’m not using it either.