How can I set up VLAN on BPI-R2 in Openwrt 21.02

I used a BPI-R1 so far and was able to set up VLANS there. Now I have bought a BPI-R2 but have problems with the VLAN configuration.

In Luci im getting the message: “Switch switch0 has an unknown topology - the VLAN settings might not be accurate.”

in console: swconfig list -> empty list

To me it looks like the right hardware cannot be found. According to the image description, VLANS should be supported by this kernel version. Does anyone have a tip for me?

OpenWrt 21.02.0-rc1 r16046-59980f7aaf / LuCI openwrt-21.02 branch git-21.124.26172-1a59584 Kernel: 5.4.111

Thx Termina

excerpt from the network file
...
config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vid '1'
        option vlan '1'
        option ports '8t 4 0t'

config switch_vlan
        option device 'switch0'
        option vid '9'
        option vlan '105'
        option ports '8t 0t 3'

config switch_vlan
        option device 'switch0'
        option vid '2'
        option vlan '102'
        option ports '8t 0t'

config interface 'Management'
        option proto 'static'
        option netmask '255.255.255.0'
        option delegate '0'
        option ipaddr '192.168.5.253'
        option ifname 'lan3'

config interface 'LAN'
        option proto 'static'
        option netmask '255.255.255.0'
        option delegate '0'
        option ipaddr '192.168.3.253'
        option ifname 'lan1'
        option gateway '192.168.2.1'

I have not much knowledge about openwrt, but mt7530 driver is a dsa driver and imho cannot be used with swconfig tool.

You can define vlan with iproute2 tool which should be available in openwrt too

https://www.fw-web.de/dokuwiki/doku.php?id=en/bpi-r2/network/start#temporary1

Thanks for your answer, you are rigth. The support of swconfig was discontinued with Openwrt 21.x. DSA support is given. Unfortunately, I am not familiar with it :frowning:

iproute2 is not part of the openwrt image (maybe i cann install it afterwards but not sure).

But it seems that your link helps me. I have not yet understood::

  1. how can i set the VLAN configuration permanently
  2. how can i assign the correct VLAN ID to the interface

It seems i will need a /etc/network/interfaces file like this ?

auto lan3.60
iface lan3.60 inet static
  address 192.168.60.10
  netmask 255.255.255.0

/etc/network/interfaces is used by ifupdown package used in older debian based distributions. Imho openwrt uses (l)uci,but i don’t know it well…i guess you can test with ip and put commands in startup-script

Maybe this helps a bit

ok thx a lot, will do :slight_smile: