Hello, I am trying to tag the wifi of my openwrt to use the vlan20 of my sophos (the vlan20 works with my computer). I created an interface with a bridge but it doesn't work (I haven't created wifi yet)
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd8e:d4be:e343::/48'
config interface 'lan'
option proto 'dhcp'
option device 'eth0.1'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '0t 2 3 4 5 1'
option vid '1'
config device
option type '8021q'
option ifname 'eth0.1'
option vid '20'
option name 'eth0.1.20'
config device
option type 'bridge'
option name 'vlan20'
list ports 'eth0.1.20'
config bridge-vlan
option device 'vlan20'
option vlan '20'
list ports 'eth0.1.20:t'
config interface 'VLAN20'
option proto 'dhcp'
option device 'vlan20'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0t'
option vid '20'
I put wan port with lan. Where is my error for the vlan20?
There are some obvious errors in your configuration.
eth0 is the physical interface name
eth0.1 - vlan 1
eth0.20 - vlan 20
eth0.1.20 - something totally wrong
To create vlan 20 with the corresponding bridge interface, you need the following:
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0t 2t' #Change the tagged port of your choice
option vid '20'
config device
option type 'bridge'
option name 'vlan20'
list ports 'eth0.20'
config interface 'VLAN20'
option proto 'dhcp'
option device 'vlan20'
Everything else is unnecessary, wrong or not supported by your device.
This means that the untagged frames will be treated as members of VLAN1. It shouldn't be a problem in your case, but better don't mix tagged and untagged frames on the same port.
If you need port 2 to be a member of both VLANs, set the tagging for VLAN1 too (you should also reconfigure the upstream device).
That really doesn't matter since the WAN port is just another port of the switch it works identically to the four LAN ports.
pavelgl has an excellent point that you need to know if the Sophos is actually making tagged packets. If you can connect your PC directly to it and have it work without setting any VLAN in the PC, it must be sending untagged packets.