DSA with multiple WAN VLAN priorities

Hello there,

I've recently upgraded my Linksys WRT1900ACS from OpenWrt 19.07 to 21.02.3. I've had to rewrite my /etc/config/network to work with the new DSA configuration and I've got most of what I need working, except for IPTV.

My ISP requires that internet traffic be sent over 802.1q VLAN 10 priority 0, and that IPTV is over VLAN 20, priority 4. The IPTV set-top box is plugged into lan1.

In OpenWrt 19.07, I've accomplished this by:

  • Defining eth1.21, connected to swconfig port 3 (DSA = lan1)
  • Defining eth0.20, connected to swconfig port 4 (DSA = wan)
  • Defining a bridge for eth0.20 and 1.21
  • Using ip link set link eth0.20 dev eth0 type vlan egress-qos-map 0:4 1:4 2:4 3:4 4:4 5:4 6:4 7:4 as a hotplug.d/iface script that runs on ifup.

The idea is to take the traffic from the set-top box, add the 802.1q header (VLAN 20, priority 4), and send the packet onwards to the ISP. This set up works well. Internet works correctly, and IPTV works correctly as well.

In OpenWrt 21.02, after porting the equivalent configuration (internet configuration omitted for brevity):

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

config bridge-vlan
        option device 'br-lan'
        option vlan '21'
        list ports 'lan1'

config device
        option name 'br-iptv'
        option type 'bridge'
        list ports 'wan.20'
        list ports 'br-lan.21'

and using the same ip link set link wan.20 dev wan type vlan egress-qos-map 0:4 1:4 2:4 3:4 4:4 5:4 6:4 7:4 command, I notice several things:

  1. When I try to perform a DHCP configuration of br-iptv, the configuration as described does not receive any DHCP responses. According to tcpdump, capturing wan and filtering by vlan 20 shows the correct 802.1q field: priority 4 and VLAN 20. However, the priority field doesn't seem to be properly set when the ethernet frame is sent over the wire (which can explain why I don't get any DHCP response). I get a DHCP response immediately when I configure:
config device
	option name 'wan.20'
	option type '8021q'
	option vid '20'
	option ifname 'wan'
	list egress_qos_mapping '0:4'

in place of using ip link. However, this now causes my normal internet access to break (presumably because it is now set to VLAN 10, priority 4 for the internet-facing VLAN 10). No other internet traffic is then possible, all packets are dropped on my ISP side.

Regardless which way I set the egress_qos_mapping, the VLAN configuration seems correct:

# cat /proc/net/vlan/wan.10 /proc/net/vlan/wan.20
wan.10  VID: 10  REORDER_HDR: 1  dev->priv_flags: 1121
         total frames received         7368
          total bytes received      7803993
      Broadcast/Multicast Rcvd            0

      total frames transmitted         3856
       total bytes transmitted       628469
Device: wan
INGRESS priority mappings: 0:0  1:0  2:0  3:0  4:0  5:0  6:0 7:0
 EGRESS priority mappings:
wan.20  VID: 20  REORDER_HDR: 1  dev->priv_flags: 1221
         total frames received            3
          total bytes received          706
      Broadcast/Multicast Rcvd            1

      total frames transmitted           10
       total bytes transmitted         1520
Device: wan
INGRESS priority mappings: 0:0  1:0  2:0  3:0  4:0  5:0  6:0 7:0
 EGRESS priority mappings: 0:4

Does setting the egress_qos_mapping apply to all VLANs in the hardware switch? This doesn't seem to be the behaviour from 19.07.

  1. tcpdump-ing both br-iptv and wan.20 at the same time when powering on the IPTV set-top box shows the correct DHCP configuration packets being sent by the set-top box, and it shows up in the br-iptv dump. However wan.20 never sees the packet. I can confirm this by temporary breaking my internet access (in point 1) and rebooting the set-top box, but it still does not obtain any IP address from my ISP.

Am I misconfiguring something, or has DSA fundamentally changed what is possible in terms of the network setup? Any guidance would be much appreciated.

Thanks!

I think that you need to add the vlan number here like: "ip link set link wan.20 dev wan type vlan xx egress"

br Matti

/tmp#  ip link set link wan.20 dev wan type vlan 20 egress-qos-map 0:4 1:4 2:4 3:4 4:4 5:4 6:4 7:4
vlan: unknown command "20"?

Think that's needed when defining the new vlan, but in this case the vlan has already been created.

1 Like

Took me a long while to figure it out, but less is more. This command worked as expected:

ip link set wan.20 type vlan egress 0:4

(ignore the dev, the device has already been created.) I'm not sure what changed since.