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 · 1 comment
Open

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

openwrt-bot opened this issue Oct 16, 2021 · 1 comment
Labels
flyspray release/21.02

Comments

@openwrt-bot
Copy link

@openwrt-bot openwrt-bot commented Oct 16, 2021

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 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 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray release/21.02
Projects
None yet
Development

No branches or pull requests

3 participants