Vlan trunk with wan and lan traffic

Hi,

I have the following problem. In one of the rooms I have a TV with a set-top box, along with some other network devices. The set-top box requires a direct connection to the cable modem (WAN), while the other devices should be behind the Turris Omnia router in the local network (LAN). But unfortunately I have only one ethernet cable available.

Currently I work around this problem with a small switch before the router and a powerline adapter. But I would like to eliminate the powerline adapter from the setup. The idea is to install a small managed switch (TP-Link TL-SG108E) in the room and use VLAN’s to transport both wan and lan traffic over the same cable between the router and switch.

But how do I configure my Turris Omnia? I know how to configure VLAN’s on the internal Turris Omnia switch, but the WAN port is connected to the CPU, and not the switch. So I’m not sure how to do this.

The closest solution I found so far is the one described in this blog post (with same ISP and set-top box as mine):

This setup uses another managed switch. That’s fine because the 5 LAN ports of my Turris Omnia are not sufficient for my network, so I need an extra switch anyway. But it also occupies 4 ports of the switch because the mixing is done on the switch and not the router. I wonder if I can connect the cable modem directly to the router, and then run a single VLAN trunk (carrying both WAN and LAN traffic) to the main switch.

Jef

Luci -> Network -> Interfaces -> Interface X -> Physical settings -> ethX.X (e.g. eth1.5 for Vlan ID 5 at CPU Port eth1)

Can you explain with a bit more detail?

I have configured the Turris Omnia (4.0) as follows:

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option bridge_empty '1'
	option _turris_mode 'managed'
	option ipaddr '192.168.0.1'
	option ifname 'lan0 lan1 lan2 lan3 lan4.1'

config interface 'wan'
	option proto 'dhcp'
	option ipv6 '1'
	option type 'bridge'
	option ifname 'eth2 lan4.2'

config interface 'guest'
	option enabled '1'
	option type 'bridge'
	option proto 'static'
	option ipaddr '10.111.222.1'
	option netmask '255.255.255.0'
	option bridge_empty '1'
	option ifname 'lan4.3'

I created three vlans on of the lan ports (lan4): one for the LAN network (lan4.1), one for the guest network (lan4.3), and the last one is bridged to the WAN (lan4.2). The network cable connected to the lan4 port goes to the managed switch.

Is this the correct way to do this?