VLAN Setup question

Hi folks. I wonder if it is possible to do the following. I attached a picture that explains what I want to do. I have a PC that is connected to my main router. A wifi router is connected to the main router. I would like the PC to talk to machines in the wifi routers 192.168.0.x lan segment directly and not forward every connection to every device. I did not have any luck so far setting up vlans in order for this to work.

P.S. Both routers use latest openwrt and they come with dsa support. On main router the ports are named eth1-4 on the wifi router they are named lan1-4. Maybe someone has done this before and can give me an example of how I have to set this up. I could also attach the PC directly to ETH3 if this makes a difference.

It is possible, but it is not such a trivial task.

Example:
VLAN 1 - main router lan interface
VLAN 10 - wifi router lan interface
VLAN 2 - wifi router wan interface

Main router

#/etc/config/network

option type 'bridge'
        option name 'br-lan'
	    list ports 'eth1'
	    list ports 'eth2'
	    list ports 'eth3'
	    list ports 'eth4'

config bridge-vlan
        option device 'br-lan'
        option vlan '1'
        list ports 'eth1'
	    list ports 'eth2'
	    list ports 'eth4'

config bridge-vlan
        option device 'br-lan'
        option vlan '10'
        list ports 'eth1:t'
	    list ports 'eth3'
	
config interface 'lan'
        option proto 'static'
        option device 'br-lan.1'
	    ...

config interface 'wifirouter'
        option proto 'none'
        option device 'br-lan.10'

config interface 'wan'
        option device 'eth0'
	    ...

Wifi router

#/etc/config/network

option type 'bridge'
        option name 'br-lan'
	    list ports 'lan1'
	    list ports 'lan2'
	    list ports 'lan3'
	    list ports 'lan4'
	    list ports 'wan'

config bridge-vlan
        option device 'br-lan'
        option vlan '10'
        list ports 'lan1'
	    list ports 'lan2'
	    list ports 'lan3'
	    list ports 'lan4'
	    list ports 'wan:t'

config bridge-vlan
        option device 'br-lan'
        option vlan '2'
        list ports 'wan'
	
config interface 'lan'
        option proto 'static'
        option device 'br-lan.10'
	    ...

config interface 'wan'
        option proto 'static'
        option device 'br-lan.2'
	    ...

With this configuration, the PC should be connected directly to the wifi router's lan.

1 Like

Thanks mate, this worked right away :clap:

1 Like

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