OpenWRT on D-Link DGS-1210-10 (not "P" or "PM")

Hi! I have the D-Link DGS-1210-10 version of this switch, which to my understanding differs from the D-Link DGS-1210-10P and D-Link DGS-1210-10MP by not supporting PoE (as per this and this). It is HW version F1 and currently runs stock firmware version 6.20.007.
I would like to install OpenWRT on it, however Table of Hardware and Firmware Selector list the 10P and 10MP versions only (and other models with more ports). All forum topics I came across with deal with the 10P version too.
Can I still install the 10P/10MP OpenWRT version on my switch? Has anyone done this? If not, I am willing to try, as long as I know I can revert back to stock - which I'm not sure I can do.

General answer: no

However… rtl838x has been rather uniform so far, and models with- and without PoE often only differ in regards to the PoE specifics and the second serial port used for the communications, which makes this situation easier than on most other targets - but that doesn't make it safe to just flash it!
If you have serial console access, you can a) gather a full bootlog of the OEM firmware (to confirm the partition offsets) and b) tftpboot an OpenWrt initramfs image, no flashing or touching the installed systems involved. Only if a) matches the current definition for the DGS-1210-10P and b) actually boots up correctly and successfully enables the switch ports (try them, all of them, check that their labelling is correct), then you can work on a dedicated image for your router (which is rather trivial).

Do not try to flash anything, unless you have a working serial console connection and can successfully tftpboot an image! There is no recovery without serial console access, so even small issues will brick your device.

You need at least in the dts remove everything unique to PoE models like mode button, poe status led and poe max led, don’t think you have the act led either…
Then comes the question if you have the port expander since you don’t have the leds and button?
And remove the realtek-poe package.

Are you referring to something like this? If yes, I think I can try it... Not sure I can do the next steps with dedicated image and what @flygarn12 is describing, but I guess one step at a time...

1 Like

Yes.
But if your DGS-1210-10 is anything like my DGS-1210-16 rev G1, there might be two minor obstacles to get around, the holes are solder filled and getting to the bottom of the PCB for soldering involves disassembling the whole switch (the heatsinks are screwed to the bottom of the case, through the mainboard). Both issues are obviously solvable, but not exactly convenient.

This isn't rocket science, but neither a walk in the park - and if you aren't confident about what you're doing (3.3V), then don't.

...and depending on the currently installed OEM firmware version, you might be facing additional obstacles (so don't take this as an opportunity to upgrade that now!)

I wouldn’t be surprised if this turns out as a mix between the -16 general hardware dts with -10p/mp port setup.

On top of serial, you need to learn how to install and run initramfs images, a tftp server and have a router that can setup and run the u-boot network.

I will attempt the tftpboot but probably on the weekend as I want to have a few hours to focus on this.
Do you think I might have better chances with the OpenWRT image for the 1210-20 model, without the "P", which is available? Potentially it might be closer to mine, not having any of the PoE components...

I think you need to combine the dts setup from both. The general hardware setup from the -20 (16 eth+4sfp) and port setup from the -10p/mp (8 eth+2sfp) and the Realtek 8381 SoC model is probably the same on all 10 port devices, the 20port probably have the 8382 SoC.

1 Like

I have a 1210-10 and a 1210-20.

I would say Yolo, just use the right of the two ROM storage and flash Openwrt :sunglasses:

Iirc you can choose the "next boot" image from the vendor web GUI.

But yes having a serial helps in general a lot. Just make sure you make yourself familiar with the two different boot options and the serial before.
With a friend's device we just f...edup the serial connectors and broke it beyond repair and just flashed Openwrt over the stock image :person_shrugging:
Iirc the only issue was you have to have a look that the firmware actually supports it.

Don't take my advice to serious if you are afraid of bricking your device otherwise just give it a try :wink:

Actually, that was another question I wanted to ask - yes, I can choose where to flash - image id1 or id2, and also which one will be bootable upon restart. So, if I flash OpenWRT (either the -10P or -20 model, or one that I hypothetically come up with following all advise so far) to the inactive image id2, switch to it, boot from it and it fails - is there a sure way to revert the "next boot image" setting back to the stock ROM in image id1? Will serial help me with that?
If yes, this will be the way to go, it seems...

this should be covered in the wiki how to boot the other flash storage but as long as the openwrt boots you can use the devise and flash Openwrt again if needed. I never had a reason to boot the vendor is again.
Just in case, remember that these devices can only be used as manged switches. Routing performance is lower then your basement floor.

You can only flash OpenWrt to image 1. There is a way to boot from image 2 by issuing some commands in U-Boot (so you need serial for that).

Where have you found that this is a dual boot device?

The device is indeed dual boot. I have the option to select which image to boot - currently it's image id2:

So suppose I flash OpenWRT (either -10p or -20) to the inactive image id1. I see three options here:

  1. OpenWRT fails to flash. To me this will mean I will have to work on creating a custom image, as @slh and @flygarn12 explained above. But my switch will still be booting stock firmware from image id2, as I wouldn't have changed this.
  2. OpenWRT flashes successfully, I change boot image from id2 to id1 and it fails to boot OpenWRT. My question here is can I (and how) change the boot image back to id2. Is this something that can be done in uboot? I will also need this option if I ever get to testing my custom images.
  3. OpenWRT flashes successfully, I change boot image from id2 to id1 and it boots OpenWRT fine. I understand this is very unlikely, but my question here again is can I change the boot id back to id2 from OpenWRT this time.

Flashing really shouldn't be on the table, before you have serial console access and runtime tested an initramfs image via tftpboot. Apart from that, OpenWrt can currently only use the first partition, so you can only flash to that.

Be happy that you didn't upgrade the OEM firmware to 6.30.x yet (and don't!), as that promises 'encrypted' firmware images, which might close the door for OpenWrt (or might not, no one has dissected that so far).

Again, if you don't have serial console access - and use it for your first steps, you are playing Russian roulette with four bullets in the chamber.

2 Likes

If he/she knows the revision and firmware version we can have a lookup. But I bet chances are high it will just flash fine and boot fine. No roulette involved.

https://forum.openwrt.org/t/support-for-rtl838x-based-managed-switches

https://svanheule.net/switches/

Ok, if you want to try your wings in development feel free to roll the dice with your dual boot.

If you want to know how it works in real life, I have linked to some literature so feel free to read my links above.

If you want a working lifeline in this project, get a working serial connection to this device.

That's fully understood @slh and I agree. As mention above, I cannot work on the switch before the weekend anyway and my first steps will be, in this order:

  1. Set up serial access and confirm working
  2. Confirm I can switch between image ids from uboot - I think I found exactly how to do this here, thanks @flygarn12 for pointing me to it
  3. Try tftpboot (same link)

But at the same time I do want to know all my options and plan ahead for everything, hence all questions about flashing. For example, I am concerned about @_bernd's comments about poor performance. Depending on how bad it is, this might be a deal breaker for me. My desired outcome of this effort is to be able to use this switch as a home router with WAN to LAN routing/NAT and possibly VPN, but I am understanding this might not be worth it from performance point of view, even if I manage to make everything work.

1 Like

It can handle a luci web interface. Routing and firewall, about 15Mbit/s.
VPN…that one you can probably forget.

This is a business class switch, nothing more nothing less.
Business doesn’t have routers in switches.