Converting to DSA

Some OpenWrt 21.02 (and newer) devices use DSA for configuring network interfaces. If you are upgrading your router to a firmware version that uses DSA, you will need to do the following:

(Note: There is a companion DSA Mini-Tutorial article that you can review.)

This page is a Work In Process. If you can contribute your knowledge, we would be pleased for the help.

Gather all of the switchport interfaces (wan, lan1, lan2, etc.) in one bridge interface. Remove them from other bridges if they exist.

Back with swconfig we had CPU ports, eth0/eth1, to tag the CPU in a VLAN (i.e. eth0.2 or eth1.2 for VLAN ID 2).

With DSA, we just create a subinterface of the bridge interface (i.e. br0.2) to get the router (CPU) involved in that VLAN.

If you specify br0.2 as the “Device” on Network → Interfaces section, OpenWrt will automatically create a subinterface of br0 with VLAN ID 2.

Here is a comparison of VLAN configuration on swconfig and DSA.

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '0 1 2 3 5t'
	option vid '1'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '4 6t'
	option vid '2'

config device
	option type 'bridge'
	option name 'br0'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'
	list ports 'wan'

config bridge-vlan
	option device 'br0'
	option vlan '1'
	list ports 'lan1:u*'
	list ports 'lan2:u*'
	list ports 'lan3:u*'
	list ports 'lan4:u*'

config bridge-vlan
	option device 'br0'
	option vlan '2'
	list ports 'wan:u*'

Local option will automatically assign the specified VLAN ID on the bridge interface for local traffic. So the router can use a subinterface to be involved in that VLAN.

If you don't want to tag the router for a VLAN on DSA, you can disable this option and run service network restart for this change to take effect.

Disclaimer: LuCI calls PVID: Primary VLAN ID. This is incorrect and it should be renamed as Port VLAN ID.

Untagged Traffic: Traffic between devices where there's no VLAN ID in the frames. Computers, printers, etc. send and receive untagged traffic by default.

Ingress: Traffic coming in to the switch through a switch port

  • PVID: Switch will assign the specified VLAN ID to the untagged traffic coming in to the switch through the specified port.

Egress: Traffic going out of the switch through a switch port

  • Egress untagged: Switch will forward the specified VLAN ID traffic going out of the switch through the specified port as untagged.

To be able to transmit and receive packets on the same VLAN (default way of swconfig), have the PVID and egress untagged on the same VLAN ID for a port.

Back with swconfig, we couldn't directly assign wireless interfaces to VLANs. So we had to bridge wireless with an already VLAN configured ethX.X interface.

With DSA, this is not the case anymore.

Go to Network → Wireless and choose the network that wireless interfaces should attach to.

Wireless interfaces will automatically be included in the bridge and belong in the correct VLAN.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2021/09/17 10:33
  • by arinc9