Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#4087 - Cannot use vlan 1 tagged with DSA in WRT1900ACS v2 #9066

Open
openwrt-bot opened this issue Oct 16, 2021 · 2 comments
Open

FS#4087 - Cannot use vlan 1 tagged with DSA in WRT1900ACS v2 #9066

openwrt-bot opened this issue Oct 16, 2021 · 2 comments
Labels
flyspray release/21.02 pull request/issue targeted (also) for OpenWrt 21.02 release

Comments

@openwrt-bot
Copy link

luizluca:

Hello,

No matter what I change, I cannot create a wan.1 interface. Any other vlan id works:

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

config interface 'lan'
option device 'br-lan'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.1.4'
option gateway '192.168.1.1'

config interface 'lan6'
option proto 'dhcpv6'
option device 'br-lan'
option reqaddress 'try'
option reqprefix 'auto'

config device
option name 'br-guest'
option type 'bridge'
list ports 'wan.3'

config interface 'guest'
option proto 'none'
option device 'br-guest'

config device
option type '8021q'
option ifname 'wan'
option vid '3'
option name 'wan.3'

config device
option type '8021q'
option ifname 'wan'
option vid '2'
option name 'wan.2'

config interface 'test'
option proto 'none'
option device 'wan.1'

config device
option type '8021q'
option ifname 'wan'
option vid '1'
option name 'wan.1'

I want to add wan.1 to br-lan but the virtual device (wan.1) is never created. I created a test interface just to try to bring it up alone, but nothing made wan.1 appears.

I also tried ip-full and it also failed:

root@ap4:/etc/config# ip link add link wan name wan.1 type vlan id 2
root@ap4:/etc/config# ip link add link wan name wan.1 type vlan id 1
RTNETLINK answers: Not supported

Why vlan 1 is prohibit?

@aparcar aparcar added the release/21.02 pull request/issue targeted (also) for OpenWrt 21.02 release label Feb 22, 2022
luizluca referenced this issue Apr 2, 2022
…d remove hack

Backport patch
  8b6836d82470 ("net: dsa: mv88e6xxx: keep the pvid at 0 when VLAN-unaware")
from 5.15.

Keeping the pvid at 0 when VLAN-unaware makes it possible to drop the
hack introduced in commit 920eaab ("kernel: DSA roaming fix for
Marvell mv88e6xxx"). Dropping the hack makes it possible to use VLAN
interfaces with VID 1 on DSA ports without problems with FDB.

Signed-off-by: Marek Behún <kabel@kernel.org>
@luizluca
Copy link
Contributor

luizluca commented Apr 2, 2022

#9530 did solve part of this issue. However, I still cannot add the wan.1 interface if any untagged port is added to a bridge. It might still be considering them as vlan 1.

# ip link add link wan name wan.1 type vlan id 1
[  707.030709] mv88e6085 f1072004.mdio-mii:00: p4: hw VLAN 1 already used by port 1 in br-lan

If I remove all lan ports from br-lan, I can create wan.1. However, netifd still does not take from there and wan.1 is left untouched, not included to br-lan on reload.

There is a hack that can workaround it. First I add the wan.1 before any network is up (abusing uci-defaults).

/etc/uci-defaults/hack-wan.1.sh:
#!/bin/sh
ip link add link wan name wan.1 type vlan id 1
ip link set dev wan.1 up
# Do not remove this!
exit 1

And I manually add wan.1 to br-lan on ifup.

/etc/hotplug.d/iface/30-hack-lan_wan.1:
#!/bin/sh
[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0
[ "$INTERFACE" = lan ] || exit 0
logger -t 'HACK: manually add wan.1 to br-lan'
brctl addif br-lan wan.1

@john-tho
Copy link
Contributor

john-tho commented Sep 8, 2022

Hi Luiz,

I saw this issue referenced in your email, and recently ran into something somewhat similar where a port vlan would not function in a bridge. I got around that by building a vlan filtering aware bridge, and using vlan of that bridge as members of another bridge.
I wanted to see if a similar setup helped with this issue, but could not reproduce this on a recent snapshot r20461+34-f1b5ed3143.

I am using an mt7621 device: no marvell switch.
I have not tested functionality, only that devices are configured as expected.

Hopefully either a netifd update has fixed this, or we know it is hardware specific?

My config changes

  • lan1->lan5
  • lan ipaddr .4->.1
  • no lan gateway
  • added wan.1 to br-lan ports

Repro. /etc/config/network

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'
	list ports 'lan5'
	list ports 'wan.1'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '192.168.1.1'

config interface 'lan6'
	option proto 'dhcpv6'
	option device 'br-lan'
	option reqaddress 'try'
	option reqprefix 'auto'

config device
	option name 'br-guest'
	option type 'bridge'
	list ports 'wan.3'

config interface 'guest'
	option proto 'none'
	option device 'br-guest'

config device
	option type '8021q'
	option ifname 'wan'
	option vid '3'
	option name 'wan.3'

config device
	option type '8021q'
	option ifname 'wan'
	option vid '2'
	option name 'wan.2'

config interface 'test'
	option proto 'none'
	option device 'wan.1'

config device
	option type '8021q'
	option ifname 'wan'
	option vid '1'
	option name 'wan.1'

Also configured as expected when removing everything after the br-guest interface section.

For me, network appears to come up as intended: wan.1 is created, and added to the lan bridge:

brctl show
bridge name     bridge id               STP enabled     interfaces
br-lan          7fff.9654e70b9c71       no              lan4
                                                        lan2
                                                        wan.1
                                                        lan5
                                                        lan3
br-guest                7fff.9654e70b9c71       no              wan.3


ip l | sed -E 's/(([0-9a-f]{2}):){3}/aa:aa:aa:/'
1: lo: <LOOPBACK> mtu 65536 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/loopback aa:aa:aa:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether aa:aa:aa:0b:9c:71 brd ff:ff:ff:ff:ff:ff
3: sfp: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether aa:aa:aa:0d:b7:71 brd ff:ff:ff:ff:ff:ff
4: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether aa:aa:aa:0b:9c:71 brd ff:ff:ff:ff:ff:ff
5: lan2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP mode DEFAULT group default qlen 1000
    link/ether aa:aa:aa:0b:9c:71 brd ff:ff:ff:ff:ff:ff
6: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
    link/ether aa:aa:aa:0b:9c:71 brd ff:ff:ff:ff:ff:ff
7: lan4@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
    link/ether aa:aa:aa:0b:9c:71 brd ff:ff:ff:ff:ff:ff
8: lan5@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
    link/ether aa:aa:aa:0b:9c:71 brd ff:ff:ff:ff:ff:ff
44: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether aa:aa:aa:0b:9c:71 brd ff:ff:ff:ff:ff:ff
45: wan.1@wan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP mode DEFAULT group default qlen 1000
    link/ether aa:aa:aa:0b:9c:71 brd ff:ff:ff:ff:ff:ff
46: br-guest: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether aa:aa:aa:0b:9c:71 brd ff:ff:ff:ff:ff:ff
47: wan.3@wan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-guest state UP mode DEFAULT group default qlen 1000
    link/ether aa:aa:aa:0b:9c:71 brd ff:ff:ff:ff:ff:ff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray release/21.02 pull request/issue targeted (also) for OpenWrt 21.02 release
Projects
None yet
Development

No branches or pull requests

4 participants