VLANs IDs above 15 not passed

I am unable to configure VLAN IDs above 15 on a Mi 4C running latest OpenWrt 22.03.3 r20028-43d71ad93e. SWCONFIG shows the switch can do 4096 without further params but it just won't work. VLANs below ID 15 work fine.

Why would SWCONFIG show 4096 but any IDs above 15 will not work with OpenWRT?

VLAN 1:
        ports: 1t 4t 6t
VLAN 3:
        ports: 1t 4t 6t
VLAN 5:
        ports: 1t 4t 6t
VLAN 100:
        ports: 1t 4t 6t
VLAN 200:
        ports: 1t 4t 6t
root@AP42:/etc/config# swconfig dev switch0 help
switch0: rt305x(rt305x-esw), ports: 7 (cpu @ 6), vlans: 4096
     --switch
        Attribute 1 (int): enable_vlan (VLAN mode (1:enabled))
        Attribute 2 (int): alternate_vlan_disable (Use en_vlan instead of doubletag to disable VLAN mode)
        Attribute 3 (int): bc_storm_protect (Global broadcast storm protection (0:Disable, 1:64 blocks, 2:96 blocks, 3:128 blocks))

You can use Port VLAN IDs up to 4095 but your device probably does not have 4096 entries for the VLAN table.
Use some thing like this for VLAN ID 100

config switch_vlan
        option device 'switch0'
        option vlan '3'
        option vid '100'
1 Like

This appears to be a bug in swconfig, as the 305x is definitely hardware limited to 16 vlans.

Use the workaround that @tomtom said. The "vlan" parameter needs to be unique and between 1 and 15, as it is the index into the switch's hardware table of VLANs. The "vid" parameter is the number that will appear in the 802.1Q Ethernet tags.

thanks. I did a search on your solution and understand now that on smaller devices you might need to set the VID in the switches VLAN table if VLANs go higher than a certain number.

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