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#3879 - Incorrect switch config for TP-Link Archer C2 AC750 #8871

Open
openwrt-bot opened this issue Jun 15, 2021 · 5 comments
Open

FS#3879 - Incorrect switch config for TP-Link Archer C2 AC750 #8871

openwrt-bot opened this issue Jun 15, 2021 · 5 comments
Labels
flyspray release/21.02

Comments

@openwrt-bot
Copy link

@openwrt-bot openwrt-bot commented Jun 15, 2021

cybermaus:

Model TP-Link Archer C2 v1
Architecture MediaTek MT7620A ver:2 eco:5
Firmware Version OpenWrt 21.02.0-rc2 r16122-c2139eef27 / LuCI openwrt-21.02 branch git-21.148.49484-14511e5

The Archer C2 has a little unusual switch setup, in that the SoC itself only has an unused 100Mb switch and instead there is an extra RTL8367B chip. We can only assume TP-Link wanted to make this a 1Gb device, despite using a 100Mb SoC. (and indeed, the 1Gb ports is why I got this particular cheap device)

OpenWRT 19.07.7 handled this beautifully, as it simply did not show the switch0, neither in UCI nor in Luci, though the RTL8367B chip is labeled switch1 in stead of the more usual switch0

When clean upgrading (so removing and rebuilding all config) to 21.02.0-rc2 I noticed that the internal switch was now populated in UCI and displayed in Luci
The Archer C2 does work, switch1 is configured as expected, but the presence of switch0 seems to cause Luci to display an error "Switch switch0 has an unknown topology - the VLAN settings might not be accurate." and further prevents Luci from updating switch1 settings.

So the presence of switch0 in UCI is confusing and unneeded, and also prevents Luci from working.

Manually removing the switch0 section from /etc/config/network makes it all work again.

/etc/config/network as generated on 19.07.7 (only the switch section)
config switch
option name 'switch1'
option reset '1'
option enable_vlan '1'
option max_length '3'

config switch_vlan
option device 'switch1'
option vlan '1'
option ports '6t 1 2 3 4'

config switch_vlan
option device 'switch1'
option vlan '2'
option ports '6t 0'

/etc/config/network as generated on 21.02.0-rc2 (only the switch section)
config switch
option name 'switch0'
option reset '1'
option enable_vlan '0'

config switch
option name 'switch1'
option reset '1'
option enable_vlan '1'
option enable_vlan4k '1'
option max_length '3'

config switch_vlan
option device 'switch1'
option vlan '1'
option ports '6t 1 2 3 4'

config switch_vlan
option device 'switch1'
option vlan '2'
option ports '6t 0'

so to restate, after manually removing the extra switch0 from rc2, it all was normal again

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented Jun 15, 2021

cybermaus:

I retract my "manual remove switch0 makes it work"

It does make the Luci work. And the device continues to work. Until you reboot, all connections lost. Even using IPv6 link-local fe80 address. All I could do is 10 second reset. Tried several times and variants.

So maybe this is a bit more urgent. Still not very urgent, but not low-low.

So:
In v19, it all worked, with switch0 not visible in /etc/config/network
In v21, with switch0 visible in network, device works, but you cannot configure switch1
In v21, with switch0 removed from network, you can configure switch1, but after reboot switch0 does not pass through any of the RGMII traffic to switch1

My current workaround: leave switch0 in network, manually edit config for switch1

Thanks

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented Jan 2, 2022

luja:

Thank you for your solution.

I have the same problem with TP-Link Archer C2 AC750 on OpenWrt 21.02.1 here.
In the oroginal state there was switch0 and if one tries to change switch1 wan to tagged/untagged/off it is impossible to change it again. It will become off. Also if one tries to change it in
/etc/config/network

So this should be investigated and the lua for luci shall be fixed.

Removing the switch0 section in /etc/config/network helped me to get proper operation!

But I need to try to reboot, but do I want to reboot :-)

Priority should be high as it is a show stopper if you can not access your network via the internal vlan switch

Cheers

ludwig

@openwrt-bot
Copy link
Author

@openwrt-bot openwrt-bot commented Jan 2, 2022

luja:

So I played around with it and found that one needs to remove the switch0 config
in /etc/config/network
(thanks to cybermaus!)

and to disable vlan on switch0.

I hacked it in an ugly way as I modified /etc/init.d/network to configure switch0:

here in init_switch() I added:
swconfig dev switch0 set enable_vlan 0

Please look at the attached files they also contain some "history" of looking around.

To get a quick and dirty solution, upload my config
backup-Jade-2022-01-02.tar.gz from the archive
and go from there.

The root password is "toor" the wifi password is "rattensommer"
The IP address is 10.42.42.1

Have fun with this cheap router.

@aparcar aparcar added the release/21.02 label Feb 22, 2022
@znark
Copy link

@znark znark commented Jun 26, 2022

I can confirm that...

  1. When starting out with a clean “factory configuration”, LuCI still displays an incorrect and confusing VLAN setup for the built-in switches of the TP-Link Archer C2 AC750 on OpenWrt 21.02.3 r16554-1d4dea6d4f / LuCI openwrt-21.02 branch git-22.083.69138-0a0ce2a (openwrt-21.02.3-ramips-mt7620-tplink_archer-c2-v1-squashfs-sysupgrade.bin), and also pops up the warning message “Switch switch0 has an unknown topology - the VLAN settings might not be accurate” when you enter the switch configuration view.

  2. The situation seems to be caused by a needless configuration section in the image for the intermediate, internal switch0, which is an “implementation detail” that the end-users are not interested in (please see the switch topology diagram for this device in the wiki), and which therefore probably should not be visible in LuCI.

  3. The situation can be remedied by issuing the following commands in shell...

    uci delete network.@switch[0]
    uci commit
    reboot
    

    ...which remove the offending configuration for switch0.

This is the situation in /etc/config/network in the default configuration:

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

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

config switch_vlan
        option device 'switch1'
        option vlan '1'
        option ports '1 2 3 4 6t'

config switch_vlan
        option device 'switch1'
        option vlan '2'
        option ports '0 6t'

...and how it looks like in LuCI:

Screenshot 2022-06-25 at 22-58-59 OpenWrt - Switch - LuCI

This is the situation in /etc/config/network after the manual fix:

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

config switch_vlan
        option device 'switch1'
        option vlan '1'
        option ports '1 2 3 4 6t'

config switch_vlan
        option device 'switch1'
        option vlan '2'
        option ports '0 6t'

...and how it looks like in LuCI:

Screenshot 2022-06-26 at 14-50-07 OpenWrt - Switch - LuCI

At least for me, simply removing the offending configuration section for switch0 and rebooting seemed to do the trick with no ill effects. This is also how the 19.x release branch handled it – the default configuration in that release branch did not include a configuration section for switch0.

@DragonBluep
Copy link
Contributor

@DragonBluep DragonBluep commented Jun 26, 2022

ucidef_add_switch "switch0"
ucidef_add_switch_attr "switch0" "enable" "false"

@znark delete these two lines can solve the problem.

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

4 participants