IPTV Configuration with VLAN ID

I have updated the original post. You can see complete versions of network, igmpproxy, dhcp and firewall configs.

Is the "network" file complete? It does not contain the info I would expect, there is something I do not understand...

Yes it is complete, I copied all of it. What does it lack ?

I am connected to the Internet with this configuration right now. I just need to add the IPTV configuration.

In /etc/config/network, the wan ifname should be wan.100 to match the other router which was configured to use a VLAN for Internet. Something about the modem or ONT is different if it is letting you reach the Internet with untagged packets. This may also mean that IPTV packets will not get through on that interface.

Remove lan1 from the lan, so it can be the connection to the IPTV box. lan2 remains in lan.

Then create a bridge from wan.103 to lan1.103:

config interface 'iptv'
   option proto none
   option type bridge
   option ifname 'wan.103 lan1.103'

Since it is proto none, the IPTV packets will not interact with the OpenWrt routing, so you don't need a firewall zone etc, just define this bridge. If the DSA system is working properly, it won't even be a kernel bridge, it will be configured as hardware switching.

Make sure your powerline adapters can pass VLANs by connecting directly to the modem or ONT. Without the router involved, IPTV has to work. In other words modem-->powerline adapter<.....>powerline adapter-->IPTV box.

OK, my ISP does not require a VLAN ID for internet access so both 100 and none or 0 work fine. With this exact setup I used to have IPTV working. The only thing changed is the main router.

I removed lan1 from lan and added this new bridge interface. Now IPTV complains about DHCP timeout. I think when we removed lan1 from lan it has lost its internet connection. I can't even browse to the PLA's web UI which is on 192.168.1.2.

There are 6 steps displayed on the screen when my IPTV tries to connect to the internet and start streaming. Before this new bridge it would stop at step 4 which is due to the VLAN ID misconfiguration. I don't know which step does what exactly behind the scenes but now with this bridge config it stops at step 1 which is clearly DHCP as you can tell from the error message. Any other suggestions ?

Change the wan to wan.100 as it can be problematic to mix tagged and untagged on the same cable.

Of course when you removed the lan1 Ethernet port from the lan it is no longer useful for lan devices. You will need to connect all your lan devices through lan2 or to wifi. The new setup passes VLAN 103 from lan1 to wan. Thus the packets tagged 103 from the TV box go to the modem with a tag of 103, and enter the ISPs private TV network. Packets sent to lan1 with other tags or no tag will not pass at all.

OK done. I'm on wan.100 still have internet connection but IPTV is still saying DHCP timeout.

I understand that when I remove lan1 from lan I can't reach it via my laptop which is connected to the lan via lan2 over the air.

I think if I can resolve the DHCP problem I'm having atm it could work but right now I have that issue with proto none bridge config.

The proto none bridge should simply forward every packet tagged 103 over to the modem as a layer 2 switch. That would include DHCP requests. I suggest you try TV box connected directly to the modem.

The STB expects untagged frames, so tagged interface lan1.103 will not work.
To configure tagged and untagged VLANs properly on DSA, you should use bridge-vlan configuration in LuCI, which was merged to master branch less than a week ago.

But the LuCI support is not backported to 21.02 yet, so you have to manually configure it in /etc/config/network, or switch to snapshot version,

For manual configuration, remove both interface 'lan' and interface 'wan' sections from /etc/config/network, and add the following

config device
    option type 'bridge'
    option name 'switch'

config bridge-vlan
    option device 'switch'
    option vlan '1'
    option ports 'lan2:u*'

config bridge-vlan
    option device 'switch'
    option vlan '100'
    option ports 'wan:t'

config bridge-vlan
    option device 'switch'
    option vlan '103'
	option local '0'
    option ports 'wan:t lan1:u*'

config interface 'lan'
    option ifname 'switch.1'
    option type 'bridge'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option ip6assign '60'

config interface 'wan'
    option ifname 'switch.100'
    option proto 'pppoe'
    option username '*************'
    option password '*************'
    option ipv6 'auto'
    option macaddr '*************'
2 Likes

Unfortunately, this config causes loss of Internet connection. I'm going to lose it over this problem :slight_smile:

Does the STB work, at least?
And is the VLAN bridge set up properly? Install ip-bridge and run bridge vlan to list all VLANs.

1 Like

No, it did not work. Intermet connection might be lost due to the VLAN ID 100. Could you share the same config without any VLAN ID config for PPPoE ? I tried to do it myself but I failed :confused:

In VLAN 100 section

config bridge-vlan
    option device 'switch'
    option vlan '100'
    option ports 'wan:t'

Replace wan:t with wan:u*

2 Likes

OK great, thanks for that but we still have option vlan '100' there. Isn't it going to affect the configuration ? I need to remove it completely so there is no VLAN config for PPPoE. I'm trying to understand at the same time, instead of just copying and pasting so please bear with me :slight_smile:

Btw, my router doesn't have a switch menu under Network tab. Maybe that's why this didn't work ? I guess my router doesn't have the switch capabilities.

u* means "PVID and untagged" port, so it is only tagged internally, and referenced by switch.100.

You can take a look at this pull request

1 Like

That's it. Now I have both internet connection and STB feed.

Thank you so much for your help. I appreciate it! I wouldn't have known that switch feature existed and we can't even configure it from the UI but only from config files.

Edit: I think I'm having speed problems now. My connection is 200Mbps but now I only get 90Mbps.
This is what I have in system logs rebooting the router;

Fri Mar 26 13:59:44 2021 daemon.info dnsmasq-dhcp[3175]: DHCPDISCOVER(br-lan) 192.168.1.195 *************
Fri Mar 26 13:59:44 2021 daemon.info dnsmasq-dhcp[3175]: DHCPOFFER(br-lan) 192.168.1.196 *************
Fri Mar 26 13:59:44 2021 daemon.debug dnsmasq[3175]: listening on wlan0(#13): *************%wlan0 port 53
Fri Mar 26 13:59:44 2021 daemon.info dnsmasq-dhcp[3175]: DHCPREQUEST(br-lan) 192.168.1.171 *************
Fri Mar 26 13:59:44 2021 daemon.info dnsmasq-dhcp[3175]: DHCPACK(br-lan) 192.168.1.171 *************
Fri Mar 26 13:59:45 2021 kern.info kernel: [   31.450890] mt7530 mdio-bus:1f lan2: Link is Up - 1Gbps/Full - flow control rx/tx
Fri Mar 26 13:59:45 2021 kern.info kernel: [   31.458473] switch: port 1(lan2) entered blocking state
Fri Mar 26 13:59:45 2021 kern.info kernel: [   31.463704] switch: port 1(lan2) entered forwarding state
Fri Mar 26 13:59:45 2021 daemon.notice netifd: Network device 'lan2' link is up
Fri Mar 26 13:59:47 2021 daemon.notice netifd: Network device 'lan2' link is down
Fri Mar 26 13:59:47 2021 kern.info kernel: [   33.498908] mt7530 mdio-bus:1f lan2: Link is Down
Fri Mar 26 13:59:47 2021 kern.info kernel: [   33.503767] switch: port 1(lan2) entered disabled state
Fri Mar 26 13:59:50 2021 kern.info kernel: [   36.570893] mt7530 mdio-bus:1f lan2: Link is Up - 1Gbps/Full - flow control rx/tx
Fri Mar 26 13:59:50 2021 kern.info kernel: [   36.578476] switch: port 1(lan2) entered blocking state
Fri Mar 26 13:59:50 2021 kern.info kernel: [   36.583705] switch: port 1(lan2) entered forwarding state
Fri Mar 26 13:59:50 2021 daemon.notice netifd: Network device 'lan2' link is up
Fri Mar 26 13:59:51 2021 kern.info kernel: [   37.594736] mt7530 mdio-bus:1f lan2: Link is Down
Fri Mar 26 13:59:51 2021 kern.info kernel: [   37.599582] switch: port 1(lan2) entered disabled state
Fri Mar 26 13:59:51 2021 daemon.notice netifd: Network device 'lan2' link is down
Fri Mar 26 13:59:57 2021 kern.info kernel: [   43.738891] mt7530 mdio-bus:1f lan2: Link is Up - 1Gbps/Full - flow control rx/tx
Fri Mar 26 13:59:57 2021 kern.info kernel: [   43.746462] switch: port 1(lan2) entered blocking state
Fri Mar 26 13:59:57 2021 kern.info kernel: [   43.751685] switch: port 1(lan2) entered forwarding state
Fri Mar 26 13:59:57 2021 daemon.notice netifd: Network device 'lan2' link is up
Fri Mar 26 13:59:58 2021 kern.info kernel: [   44.762734] mt7530 mdio-bus:1f lan2: Link is Down
Fri Mar 26 13:59:58 2021 kern.info kernel: [   44.767581] switch: port 1(lan2) entered disabled state
Fri Mar 26 13:59:58 2021 daemon.notice netifd: Network device 'lan2' link is down
Fri Mar 26 14:00:01 2021 kern.info kernel: [   47.834890] mt7530 mdio-bus:1f lan2: Link is Up - 1Gbps/Full - flow control rx/tx
Fri Mar 26 14:00:01 2021 kern.info kernel: [   47.842460] switch: port 1(lan2) entered blocking state
Fri Mar 26 14:00:01 2021 kern.info kernel: [   47.847685] switch: port 1(lan2) entered forwarding state
Fri Mar 26 14:00:01 2021 daemon.notice netifd: Network device 'lan2' link is up
Fri Mar 26 14:00:02 2021 kern.info kernel: [   48.858745] mt7530 mdio-bus:1f lan2: Link is Down
Fri Mar 26 14:00:02 2021 kern.info kernel: [   48.863592] switch: port 1(lan2) entered disabled state
Fri Mar 26 14:00:02 2021 daemon.notice netifd: Network device 'lan2' link is down
Fri Mar 26 14:00:05 2021 kern.info kernel: [   51.930977] mt7530 mdio-bus:1f lan2: Link is Up - 100Mbps/Full - flow control rx/tx
Fri Mar 26 14:00:05 2021 kern.info kernel: [   51.938693] switch: port 1(lan2) entered blocking state
Fri Mar 26 14:00:05 2021 kern.info kernel: [   51.943935] switch: port 1(lan2) entered forwarding state
Fri Mar 26 14:00:05 2021 daemon.notice netifd: Network device 'lan2' link is up

lan2 enters blocking state and it decreases the link speed from 1Gbps/Full to 100Mbps/Full. That's probably why but I don't know why it enters blocking state.

That may indicate a faulty or loose cable.

1 Like

Yeah, I guess you are right. I connected all the cables tightly and rebooted. Now I don't have any problems even when IPTV is on.

Again, thank you for your efforts.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.