Support for RTL838x based managed switches

Switch Interface - not reachable by IPv6

One other thing I recognized earlier today, eventhough one could setup IPv6 for webui and ssh neither nor ICMP is reachable by IPv6 for tagged or untagged VLANs.

IPv6 from the switch outgoing is working.

ubus call system board
{
	"kernel": "5.15.158",
	"hostname": "Switch03",
	"system": "RTL8380",
	"model": "ZyXEL GS1900-8 Switch",
	"board_name": "zyxel,gs1900-8",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "23.05-SNAPSHOT",
		"revision": "r23903-cc0527b362",
		"target": "realtek/rtl838x",
		"description": "OpenWrt 23.05-SNAPSHOT r23903-cc0527b362"
	}
}
cat /etc/config/network

config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'

config device 'switch'
	option name 'switch'
	option type 'bridge'
	option macaddr 'xx:xx:xx:xx:xx:xx'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'
	list ports 'lan5'
	list ports 'lan6'
	list ports 'lan7'
	list ports 'lan8'

config device
	option name 'switch.1'
	option macaddr 'xx:xx:xx:xx:xx:xx'

config interface 'mgmt'
	option proto 'dhcp'
	option device 'switch.10'
	option force_link '1'

config bridge-vlan
	option device 'switch'
	option vlan '10'
	list ports 'lan1'
	list ports 'lan2:t'
	list ports 'lan3:t'
	list ports 'lan8:t'

config bridge-vlan
	option device 'switch'
	option vlan '20'
	list ports 'lan2:u*'
	list ports 'lan3:t'
	list ports 'lan6'
	list ports 'lan8:t'

config bridge-vlan
	option device 'switch'
	option vlan '50'
	option local '0'
	list ports 'lan3:t'
	list ports 'lan8:t'

config bridge-vlan
	option device 'switch'
	option vlan '70'
	option local '0'
	list ports 'lan3:t'
	list ports 'lan7:u*'
	list ports 'lan8:t'

config bridge-vlan
	option device 'switch'
	option vlan '81'
	option local '0'
	list ports 'lan5'
	list ports 'lan8:t'

config bridge-vlan
	option device 'switch'
	option vlan '82'
	option local '0'
	list ports 'lan4'
	list ports 'lan8:t'

config bridge-vlan
	option device 'switch'
	option vlan '90'
	option local '0'

config interface 'mgmt6'
	option proto 'dhcpv6'
	option device 'switch.10'
	option force_link '1'
	option reqaddress 'try'
	option reqprefix 'auto'

Firewall is configured, but

cat /etc/config/firewall

config defaults
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option synflood_protect '1'

config zone
	option name 'mgmt'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'
	list network 'mgmt'
	list network 'mgmt6'

config zone
	option name 'main'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'

Is this due to the error printed during boot and in the logs, when one restarts the IPv6 interface:

Sun Jun 23 12:33:34 2024 daemon.notice netifd: Interface 'mgmt6' is now down
Sun Jun 23 12:33:34 2024 kern.warn kernel: [68701.880891] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
Sun Jun 23 12:33:34 2024 kern.warn kernel: [68701.945081] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
Sun Jun 23 12:33:34 2024 kern.warn kernel: [68701.982306] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
Sun Jun 23 12:33:34 2024 kern.warn kernel: [68702.035520] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
Sun Jun 23 12:33:34 2024 kern.warn kernel: [68702.043276] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
Sun Jun 23 12:33:34 2024 kern.warn kernel: [68702.104779] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
Sun Jun 23 12:33:34 2024 kern.warn kernel: [68702.112803] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
Sun Jun 23 12:33:34 2024 kern.warn kernel: [68702.165062] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
Sun Jun 23 12:33:34 2024 daemon.notice netifd: Interface 'mgmt6' is setting up now
Sun Jun 23 12:33:38 2024 kern.warn kernel: [68705.663714] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
Sun Jun 23 12:33:38 2024 kern.warn kernel: [68705.671960] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
Sun Jun 23 12:33:38 2024 kern.warn kernel: [68705.683364] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
Sun Jun 23 12:33:38 2024 kern.warn kernel: [68705.694757] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
Sun Jun 23 12:33:38 2024 kern.warn kernel: [68705.702570] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
Sun Jun 23 12:33:38 2024 kern.warn kernel: [68705.714118] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
Sun Jun 23 12:33:38 2024 daemon.notice netifd: Interface 'mgmt6' is now up
Sun Jun 23 12:33:39 2024 kern.warn kernel: [68706.734472] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported
Sun Jun 23 12:33:40 2024 kern.warn kernel: [68707.694548] rtl83xx_fib_event: FIB_RULE ADD/DEL for IPv6 not supported

Is there any patch which I did not found, pending?

@janh is this related to your finding.

EDIT: This was unrelated to the switch and linked to independet problem.

The driver doesn't implement offloading of IPv6 routes and prints this message instead (I think the hardware doesn't support it anyway). The message probably shouldn't be a warning, though.

Accessing the device via IPv6 works without any issue here while running an image built from main branch with the two commits reverted.

Please can maintainers for the realtek targets review the PR https://github.com/openwrt/openwrt/pull/15763 to add hpe-1920-48g and let us know how it looks?
Thanks.

Callout to hpe-1920-48g owners, specifically the PoE version please chime in one the github PR to get official support for the switch.

I am curious as what switch chips are used in the new 2.5gbit switches, such as this: https://www.amazon.com/dp/B0CQ4F2813/ref=olp-opf-redir?aod=1&th=1

Dare I hope there is OpenWrt support for these?

Probably this Collecting Information for RTL8372 based Switches

1 Like

All the cheap 4 * 2.5G + 2 * 10G that I've seen so far are indeed based around the RTL8372. They are also available in 8 * 2.5G + 1 * 10G variants.

There are lots of different models sold under different brands for as low as $25-30 for an unmanaged unit when on sale.

The 5 * 2.5G + 2 * 10G can often use the RTL9301, and are therefore more expensive.

Any news on the 5x 10G and 8x 10G switches with RTL9303? Would like to move away from the old Infiniband switch but need a minimum of 10Gb for home lab storage really.

Help needed: can anyone who runs switch with Luci test a luci patch which enables config of link bonding?

The PR looks good - just needs verifying.

To verify: install luci, and scp to the device replacing network.js and interfaces.js.

Replies here or on the PR OK, just @ me

sounds similar to what I had already observed a few weeks ago with my D-Link DGS-1210-16 (rtl838x) and my Zyxel XGS1250-12 (rtl930x):

Does anyone know if it already been addressed in latest master?
I am happy to test it on my two switches.

No, there haven't been any changes yet. I think a good idea for now would be to test which one of the two commits (or possibly both) is the issue.

It's nice to see that proper support for bonding configuration is being worked on. However, it doesn't really make sense to test this on a Realtek switch at the moment, because the implementation in the driver is still broken.

3 Likes

I just received a DGS-1210-10MP and wanted to flash OpenWRT on it right away. I've chosen this device on basis of the Table of Hardware. But as I checked the hardware revision I noted that it is F3, which is not listed on the TOH.

For the other devices on this series (DGS-1210-10P, DGS-1210-28, DGS-1210-28MP and DGS-1210-52) the Wiki states that F1, F2 or newer work.

Is there a restriction to the F1 revision for the DGS-1210-MP or is it just that nobody tested and reported something for the higher hardware revisions?

Is there a high probability that OpenWRT also runs on the F3 revision?

The F3 has not been tested and reported. You could look a the D-Link support site to see if their firmware releases are the same for the F3 version as previous versions. You can also try booting the image via tftboot and ensuring that everything seems to function properly before running the sysupgrade step.

Hey guys, small OT, as you are always testing switches if you have aggregation configured can you give a try to this PR?

So we can collect some feedbacks.

This is configuring the (undocumented/lacking documentation) netifd bonding capability to configure the bonding (a device instead of a protocol). For example in this way you can use the bond interface in a bridge.

The netifd bonding capability is present sice commit 5ba9744.

Couple of posts above it's mentioned that bonding is broken on realtek switches

I've gotten my hands on one. Building now.

2 Likes

what could be the alternative way to installing openwrt on tl-st2210p v3.20 ? i still have issue with them bricking when trying to trick to install openwrt. bootloader refuse to accept openwrt as it did before and never recover after that short to ground that we do.

can i write to flash directly? (which offset should i write to?) i can desolder chip and write with ch341a or something.

and is there any news about tl-st1008f support?

i have no clue what is going on but it is still broken for me.
openwrt works but bootloader is crapping itself.

so i desoldered soic16 chip and got fresh dump from it.

➜  ~ binwalk tl-sg2210p.bin | head

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
309220        0x4B7E4         Copyright string: "Copyright (c) "
331580        0x50F3C         CRC32 polynomial table, little endian
358368        0x577E0         JFFS2 filesystem, big endian
1048576       0x100000        uImage header, header size: 64 bytes, header CRC: 0xA28A1905, created: 2024-03-22 22:09:42, image size: 3236431 bytes, Data Address: 0x80100000, Entry Point: 0x80100000, data CRC: 0xFF411830, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: gzip, image name: "MIPS OpenWrt Linux-5.15.150"
1048640       0x100040        gzip compressed data, maximum compression, last modified: 1970-01-01 00:00:00 (null date)
4325376       0x420000        Squashfs filesystem, little endian, version 4.0, compression:xz, size: 2808396 bytes, 1149 inodes, blocksize: 262144 bytes, created: 2024-03-22 22:09:42
7381085       0x70A05D        LZMA compressed data, properties: 0x5D, dictionary size: 131072 bytes, uncompressed size: 131072 bytes

and written openwrt there

dd if=openwrt-23.05.3-realtek-rtl838x-tplink_sg2210p-v3-squashfs-sysupgrade.bin of=tl-sg2210p.bin obs=1 seek=$((0x100000)) conv=notrunc

at the offset that original firmware started. then restored it to the chip.
i have had w25q256jv chip.

root@OpenWrt:~# head /etc/board.json
{
        "model": {
                "id": "tplink,sg2210p-v3",
                "name": "TP-Link SG2210P v3"
        },
        "bridge": {
                "name": "switch",
                "macaddr": "1c:61:b4:fc:92:42"
        },
        "network": {
root@OpenWrt:~# uname -a
Linux OpenWrt 5.15.150 #0 Fri Mar 22 22:09:42 2024 mips GNU/Linux
root@OpenWrt:~# uptime
 22:15:14 up 5 min,  load average: 0.02, 0.25, 0.15
root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 000e0000 00010000 "u-boot"
mtd1: 00020000 00010000 "u-boot-env"
mtd2: 01a00000 00010000 "firmware"
mtd3: 00320000 00010000 "kernel"
mtd4: 016e0000 00010000 "rootfs"
mtd5: 01430000 00010000 "rootfs_data"
mtd6: 00400000 00010000 "usrappfs"
mtd7: 00100000 00010000 "para"
root@OpenWrt:~#
root@OpenWrt:~# cat /proc/cpuinfo
system type             : RTL8380
machine                 : TP-Link SG2210P v3
processor               : 0
cpu model               : MIPS 4KEc V7.0
BogoMIPS                : 498.89
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 2, address/irw mask: [0x0fff, 0x0fff]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16
Options implemented     : tlb 4kex 4k_cache 32fpr prefetch mcheck ejtag llsc dc_aliases perf_cntr_intr_bit mm_full
shadow register sets    : 1
kscratch registers      : 0
package                 : 0
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available

it boots and seem to work. it takes a while blinking with front led.

➜  ~ scp -O openwrt-23.05.3-realtek-rtl838x-tplink_sg2210p-v3-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/
openwrt-23.05.3-realtek-rtl838x-tplink_sg2210p-v3-squashfs-sysupgrade.bin                                                                        100% 6144KB   2.9MB/s   00:02
➜  ~ ssh 192.168.1.1 -l root


BusyBox v1.36.1 (2024-03-22 22:09:42 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 23.05.3, r23809-234f1a2efa
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~# sysupgrade /tmp/
.uci/                                                                      resolv.conf
.ujailnoafile                                                              resolv.conf.d/
TZ                                                                         root/
board.json                                                                 run/
etc/                                                                       shm/
lock/                                                                      state/
log/                                                                       sysinfo/
luci-indexcache.82e3de27.json                                              tmp/
openwrt-23.05.3-realtek-rtl838x-tplink_sg2210p-v3-squashfs-sysupgrade.bin
root@OpenWrt:~# sysupgrade /tmp/openwrt-23.05.3-realtek-rtl838x-tplink_sg2210p-v3-squashfs-sysupgrade.bin
Fri Mar 22 22:23:25 UTC 2024 upgrade: Saving config files...
Fri Mar 22 22:23:25 UTC 2024 upgrade: Commencing upgrade. Closing all shell sessions.
Command failed: Connection failed
root@OpenWrt:~# Connection to 192.168.1.1 closed by remote host.
Connection to 192.168.1.1 closed.

sysupgrade also works. takes a while to boot with blinking status led but it comes up as expected.

i haven't tested everything but it seem to be okay.

imho it is also tremendously easier to desolder soic16 chip, write firmware there and solder back than risk shorting chip and soldering 0201. don't know why i didn't do it earlier

maybe we can compare bootloader dump from my device with bootloader from someone else device? maybe there is some difference?

all my tl-sg2210p was purchased locally in Vietnam (official distribution)

Is there a PR to test for RTL93xx? I see some staging branches mentioned back in May 2023 but can't locate the current state of work on those targets.

Zyxel XGS1250-12 is supported and on RTL930x:
https://openwrt.org/toh/hwdata/zyxel/zyxel_xgs1250-12

Yes, it's a 91xx but the only one and a more expensive model limited to only 4x 10Gb ports tho.
Nothing on 93xx recently, but I saw plenty of talk 12+ months ago about other models which look cheaper and more versatile. Sorry to whine, happy to test but can't follow what the progress was so far.

On another note - if there's any realtek maintainers here please check out this PR to add the 48 port HPE 83xx models.

I'd be happy to move onto testing some 93xx models if there's interest in building out that target afterwards.

Not clear if the work to add new targets is paused pending the migration to kernel 6.6 or something else such as life getting in the way.