Can a router be replaced by an SBC (RPi) + a switch?

Hello,

It feels weird to begin straight with the topic just after the greetings. Hence this paragraph.

Situation

In our home, we use the modem/router/switch (gateway?) given by our ISP (FTTH, +0,9Gb/s best throughput). It comes with four 1Gb/s LAN ports and of course one WAN port connected to the ONT.

We can't use WiFi and always let it off, except when we need to use our printer. Also, we are 6 at home, and we have an Android TV box, and I want to host services on a dedicated device.

Issues

(most to least important)

  1. Ethernet cables stay on the floor as we need to move them and sharing them is annoying. It would be fixed if everyone had one just for him so we could make a definitive installation.

  2. The printer only has a USB B port, and turning the WiFi on then off just to use it is annoying. We want to be able to print from our phones even outside the network.

  3. I'm testing services with a YunoHost server on my desktop computer, installed Coturn and tried to open the required port range on the router, but got this message:

You can't use the following ports:

  • 1287/tcp
  • 1288/tcp
  • 1290-1339/tcp
  • 2427/udp
  • 5060/both
  • 35500-35599/udp
  • 68/udp
  • 8254/udp
  • 64035-65535/both

So I just use an other port range. At the end there's no issue but changing the router has been on my mind for some time. Custom softwares like OpenWRT aren't compatible with our current one (NB6V-FXC-r0) and neither the other model the ISP gave us after installing FTTH (NB6VAC-FXC-r1).

Considerations

(most to least important)

  1. WiFi is out of the question.

  2. For the modem/router/switch, the server and a new TV box the budget is 265$ (250€), and if it is particularly appealing it can go up to 315$ (300€). I will very probably buy a new TV Box and use a Raspberry Pi 4 4Gb (65€;68$) for this purpose.

  3. I can't just buy things then it just doesn't work at all. I'm here not to go in a direction that will lead me there. It must be why the Raspberry Pi is more reassuring to me. At least if things don't work out we'll have one TV Box/print server and a versatile little computer (+ a switch).

  4. I don't want to split the Internet throughput, especially for the server. For LAN either, I want to keep 1Gb/s when transferring files from one device to another.

My research

I was occasionnally searching for routers with one WAN port and eight 1Gb/s LAN ports, but quickly drowned in the choices and questions as I always do when searching on the Web for something to buy. And above all, it's expensive, too expensive. Surely because no home use that much ports.

Yesterday, I searched the Web for a Raspberry Pi in order to create a print server, and at the same time use it as a TV Box, as it's in the same location and would be a waste to use it just for that. Of course it's out of stock, so I searched for other options, but they were less reassuring and generally more expensive. Except the Odroid-XU4 (53$) but 2Gb of ram isn't enough for this use (playing videos up to 2K from the network essentially, and I want a margin for smoothness and to keep it a while). Edit: Odroid M-1, but it's too much for the use now and better suited to be a server

On the way I found the RPi Compute Module 4, which can be plugged to some motherboard, like this one that has two 1Gb/s ethernet port.

Searched for switches too, which are much cheaper than routers and found this TP Link (manageable version). But as it's not a router, I don't know at all if it would work if installed as in the drawings below. It appears you can create a VLAN to do that: a diagram ; one person doing it in a video. All my knowledge about networks comes from the PowerCert Animated Videos channel.

Questions

  1. Can a switch connected to a modem/router be able to provide Internet connection to other connected devices like in the diagrams? If yes are there speed or link issue compared to a router?

not my preferred way, we have one cable less and no OpenWRT

Diagram above: not my preferred way, we have one cable less and no OpenWRT

  1. Can the RPi CM 4 combined with a 2 eth ports motherboard be able to work as a modem/router when between the ONT and a switch?

  1. At the same time, can the RPi CM 4 run the services I want to host? Will there be noticeable issues? I suppose maintenance would be more problematic but I can manage.

Do some of the things you read seem unreasonable to you? It could be an issue if bad assumptions remain.

I would really appreciate an outside view. I am asking for help.
Redirect me where you feel the topic is more appropriate.

Issues:

  1. Noted, not related to the router + switch itself?
  2. You can in thoeory use p910nd however this only works if your printer doesn't need a firmware to boot up. There are other requirements and it wont work if you have two users trying to print at the same time

Considerations:

  1. Ok?
  2. I would suggest a RockPro64, dual port Intel NIC (such as Supermicro AOC-PG-I2+ or Fujitsu D3035-A11, use eBay or similar) however there are still some issue with OpenWrt so you'll need to use another distro which will probably be in your interest anyway (see below). I'm not sure what exactly you're looking for regarding a "TV Box", nVidia Shield is a very solid choice if you want Android etc, Allwinner H6 and LibreELEC or Amlogic S905X and CoreELEC works well in general and are cheap however most streaming service wont work on these platforms. As far as switches goes you need to make up your mind about VLANs, I would recommend you getting one that's capable of VLAN (ie "smart switch") however they are a bit more expensive and you don't state how many ports you need. In general I'd say that Zyxel makes pretty good ones if you need one that "just works" such as the GS19XX-series and does VLAN otherwise pretty much anything goes.
  3. Almost any quad (or more) ARM64/AArch64 platform will handle that fine in terms of raw power however there might be driver limitations etc you need to take into considerations

As far as print server goes, this pretty much depends on your current printer and how much time you want to spend tinkering about it. On mobile devices outside your network I'm not sure if there's even a good way to set it up as you'd need some kind of cloud printing service. Unfortunately Google Cloud Print has reached EoL which you could've used. You need to do more research on that topic but something you might want to look up is

Questions:

  1. Yes and there will no likely be any change of speed
  2. Yes, however keep in mind hardware limitations and interface bandwidth
  3. What services? Do you have generic knowledge of Unix/Linus distros and/or BSD? If not this is probably going to be a very overwhelming project overall. Depending on your knowledge I would highly recommend a distro that doesn't target devices with very limited processing power and space. For this kind of hardware, setup and potential software requirements I recommend either a normal Linux distro or something like FreeBSD as it will save time in the end (larger package repositories, upgrade paths etc). I think your best bet regarding current printer is to have a look at CUPS and IPP-emulation which probably ticks most of your boxes and is should be compatible with most printers.

You can use the CM4 if you want but you probably at least want hardware crypto acceration and a 2x PCIe bus.

just be aware that buying a rpi device is a very rare opportunity these days - see real time stocks at rpilocator.com - or spent 3/4x the real price and buy from opportunists (not recommended)

Hey,

Issues

  1. "not related to the router + switch itself?": I'm not sure what you refer to
  • If you refer to our router and switch, we have only one device which does both. I wrote "modem/router/switch" because I don't know the exact name of the device that does all that (I'll write "our router" now). So: the fact that the cables are a mess is just related to the fact that there is not enough LAN ports on our router.
  • If you refer to my situation where I say we can't use WiFi: it is not related to the router. It is about a health issue of a parent. I don't expand on it unless curiosity arised.
  1. "p910nd": We manually power the printer on and off so booting it up isn't an issue. But it is far from our router which means I'd have to buy a long USB cable, unless I set up the print server on the *ELEC TV Box and link it to the printer (a very unlikely to happen setup obviously, we couldn't call that tinkering anymore). For printing outside the network I recently accountered Savapage which seems really big looking at the doc and all the features it claims to offer. To print from Android there is an Android CUPS app to test out. I think I will have to spend a lot of time working on this print server anyway. We have a Canon Pixma MG4250.

Considerations

  1. I wrote why no WiFi above.
  2. a. "RockPro64": indeed, a PCIe x4 SBC. $10-15 on eBay for the Supermicro NIC, but I live in France so $30 because of shipping. I might as well go with the Intel PRO/1000 PT $35 and free shipping (but it's bigger).
    b. Regarding the "TV box" (it's called that isn't it?) I currently have a S905W (X96 Mini) and it has a lot of lag and video playing issues. But as it's on Android TV I will install an *ELEC firmware and see if it suits the use before replacing it (I don't use paid streaming services). I know Nvidia Shield is the go-to choice, I'll probably get it if *ELEC isn't good and the shipping costs don't eat the whole budget.
    c. "Switches & VLANs": I need 8 free LAN ports (7 if the server is also the router). I don't know if there's a difference between "manageable" and "smart" switch, this TP Link is said manageable and the price is maybe too low to be a reliable product. I'll reconsider the budget if needed to focus on durable and reliable products, like the Zyxel G1900-8 in the model series you proposed.

Questions

  1. Happy to read that there's no issue with VLAN capable switches.
  2. "check hardware limitations and interface bandwith": As @maurer mentioned, RPi is a luxury now, and I didn't acknowledge its hardware limitations you mentioned.
  3. I have knowledge of UNIX distros, but I'm reading UNIX for People to really hit the basics. FreeBSD is really appealing and adequate for a server use. Pastebin link to a list of services I intend to setup below.

Does the CM4 have a bottleneck issue because of its only PCIe 1x bus, in this config?

I didn't know about crypto acceleration. Does "ARMv8 Cryptography Extensions" means The Rockship RK3399 has cryptography acceleration?

Is 4Gb of RAM enough for an ideal FreeBSD setup running the services in the pastebin below?

PASTEBIN

Current configurations

Server/Router:

Switch:

TV Box:

  • Nvidia Shield (150€)
  • Our current one (X96 Mini)

It's a lot less expensive than I thought (190€ with RockPro64 + Zyxel and without the Shield) but at least it includes the extra not-planned fees.

In your original post you wrote:
"Ethernet cables stay on the floor as we need to move them and sharing them is annoying. It would be fixed if everyone had one just for him so we could make a definitive installation." I don't see how that is related to the hardware at all :slight_smile:

The Intel PRO/1000 PT is a very old NIC (controller, released back in 2005) and there have been reports of compatibility issues with older NICs/controllers ( see https://wiki.pine64.org/wiki/ROCKPro64_Hardware_Accessory_Compatibility and https://wiki.freebsd.org/arm/RockChip#Tested_PCIe_devices_on_RockPro64 ) ,
https://www.ebay.fr/itm/144267450115 this from .de and slightly below 30 EUR incl shipping for example.

The S905W SoC is a bit slower than the S905X but if you can utilize hardware acceleration it works surprisingly well for what it is. It will probably have issues upscaling SD content however. I have S905X box myself running CoreELEC =)

While I guess the TP-Link switch "work" at least I personally would spend a few bucks more getting something a bit more proven and better supported by the manufacturer. You can also run OpenWrt on the Zyxel GS1900-series (not 1920) but I've not seen any value doing so yet personally.

The SeeedStudio board doesn't use PCIe for networking at all, the internal phy should be fine while the secondary (LAN7800) hangs off USB3 and I no idea how well the driver is supported and performs on any platform (OS).

Crypto extensions will help quite a bit for offloading the CPU, especially when doing SSL/TLS which usually uses AES for example so in your case anything web related would make use of it.

Regarding your list I think it might be a bit overwhelming for a 4Gb device irregardless of arch (tbh I would guess that 8Gb is a bit low too) but if you know the memory requirements for each component on Linux they're going to be pretty much the same on FreeBSD.

Some of the listed applications are next to impossible to package irregardless of OS which is why they're offered as a docker image. Docker isn't supported by FreeBSD (there are other similar mechanisms in place) and given the sheer list I would recommend you to offload at least some of it to a second box.

There also worth considering how much you want to run on a single box (some have very strong opinions about it especially on a firewall) but Seafile, Aria2 + some frontend, Gerbera (I would recommend using NFS or SMB (Samba) unless you have "dumb" clients however), Radicale, Syncthing and Wireguard would at least perform decently well unless there are huge amount of files / data we're talking about. You might be cable to squeeze in something more but I would suggest not putting all of these on the router itself as it would most likely bog it down too much. Some of the mentioned software is already packages (www.freshports.org) so that makes things a bit easier. Some applications you've listed are also desktop apps?

Best regards,
Daniel

Yes, it's related to the number of people, not the hardware. But somehow I still want to say it's "related to" the hardware (and us), and that it's "caused" by the number of people. I asked and I'm the only one to think this way in the end. Nevermind it's my understanding issue.

The Fujitsu NIC it will be then.

I will stick to the S905W.

I put the TP-Link in the previous post but the Zyxel was already my choice, for the same reasons you mentionned. And I won't replace by OpenWrt either, as I don't intend to do anything but what is in order to make the network work.

Ok for the SeeedStudio board.

Ok for Crypto extensions.


The list was initially made for another purpose.
Realistically, my list looks like this (I should have done that from the start):

  • Remote access to a directory (ftp/NFS/SMB or any system(s) that integrates best with Linux/Windows/Android file explorers, I don't think a web interface is needed. Needs to be accessible from WAN)
  • Downloads (Aria2 seems to do it all)
  • Media library (Jellyfin or UniversalMediaServer ; I'll have to test UMS I don't really like Jellyfin. It's mainly for the TV Box, and optionally for use on the web, metadata auto-detection and download is great but not necessary)
  • Browser sync(bookmarks/exts) (Firefox Sync Server or just floccus, my bookmarks are now a whole db)
  • Notes (I don't know there's too many options so I'll see, and maybe GitJournal or similar alone is fine, it's to sync my phone's notes)
  • Passwords (Vaultwarden >> running fine but maybe KeeWeb later, or just sync the keepass db file(s))
  • Contacts (Baïkal >> I'm running that but I just need to sync my contacts, anything else is fine)
  • Docs editing (Collabora or OnlyOffice or Etherpad) I don't know, it's not for me

The rest isn't a necessity, it comes if there's some room, or just not at all.
If software alternatives exist for it, I'll stay with FreeBSD. Otherwise I'll go Debian as it's well supported. I know very little/nothing about Docker, and feel like it's a bad idea to use it when you can do without it and know what you're doing.

There are no desktop apps in my lists, even if some have a corresponding desktop app.


Too bad there's no RockPro64 8Gb, I'll search some more RAM device. Even if I run everything in the most minimal way I think it will be tough at some times. As you wrote, I'll have to offload if I want to add anything more than what is on the list at the top.

Just learned about Gerbera.

Many thanks for your involvement

If you want to access for WAN you'll need to do tunneling, like using Wireguard, OpenVPN, IPSec etc. This will require 3rd party software on all devices unless you're going for IPSec but that is a bit of a pain to setup and doesn't work well behind NAT. On top of that a client (at least on Android) which is aware of whatever protocol you decide to use (VLC for instance can do SMB/NFS on its own). You will probably end up with separate solutions based on OS.

Aria2 will do, I personally like qbittorrent(-nox) if you're going to use bittorrent however aria2 supports more protocols than just bittorrent.

Just use NFS(v3), it'll work just fine if you're on Core/LibreELEC and its very lightweight.

I've also been looking for something regarding notes, there are a few clever solutions using WebDAV which might be worth looking into.

Firefox Sync is unmaintained/abandoned and depends on Python 2.7 which is deprecated so I wouldn't recommend that solution. I have no idea of Mozilla have released a replacement.

CalDAV is the way to go, there are at least one open source/free client on F-Droid and there are a few servers/daemons available.

OnlyOffice is available as a port, no idea how well it performans etc

  • I already tested Wireguard, it works very well and the Android application provides a kernel module option to replace the default VPN backend for rooted devices (I won't root any other device than mine but it's nice to use). I would ideally avoid a VPN when an other option work.
    As for the protocol, SFTP was already set up on my test server and I can easily connect to it outside my network, but good luck to find a good and simple Android client. There's FTPS too, but requires more open ports and I don't know its advantages.

  • I like qbittorrent too, but I think I will also use direct downloads

  • I just know NFS from its name and just read the Kodi Wiki page about it, it looks just fine.

  • Yes I didn't go deep in the WebDAV area for notes, I'll search later.

  • I tested Firefox Sync even if it's unmaintained, it works but unreliably and you still have to get a Firefox account. They have a replacement, just no easy way to deploy it as the documentation is not meant for self-hosting. I will go with floccus, even if it's only for bookmarks (my main need).

  • I use Davx5 on Android and Baïkal server side, works but if there's lighter than Baïkal I'll go there.

Lastly: I knew I forgot something simple hardware wise: I already have a 1TB SATA HDD but wonder how I will power it and link it. Should I buy a different and specific power supply from the RockPro64? And is USB-C port a bottleneck?

SFTP and FTPS (I guess that's TLS/SSL) isn't something you want to use in practice even though it "works".

I would assume that Radicale is a bit lighter than Baïkal but I would be wrong :slight_smile:

2.5 or 3.5"?

I'm not sure what PSU you're looking at, I've been using these for my setups and they work fine.

USB-C bottleneck? Compared to?

Yes that's TLS/SSL (FTPS/SFTP) and I can see why it's better not to use in practice.

3.5" (Seagate ST1000DM003)

I'll see tomorrow but if we have a PSU it must be the one that shut the whole house down the moment I plugged it. Probably there's a SATA to USB convertor next to that as well.

No my question didn't make sense. Just some nonsense moment there.

A 3.5" HDD needs external power and (preferably) housing as no computer, SBC etc will provide 12V over USB. I'm not sure if its worth spending money on that HDD given the size and possibly age however you can get something like this https://www.amazon.fr/UGREEN-Disque-Adaptateur-Pouces-Supporte/dp/B07S8MQVRZ which will also power a 3.5" (using a PSU which isn't supplied) HDD but there's no casing or such. You can later on replace it lets say https://www.amazon.fr/Disque-SanDisk-Vitesse-Lecture-SDSSDH3-1T00-G25/dp/B071KGRXRG/ and also get rid of the external PSU and since the SSD is already encapsulated you don't really need to get a case for it.

Tbh 2 things appeal me with HDD: the price and the fact (couldn't verify that anywhere) that it's still readable at its end of life, so I could always access the media in it. Anyway I would still realistically need an SSD and its power consumption may balance its initial cost.

The best of both worlds:
I will buy an SSD and do regular shifting of unused stuff to the HDD. I'll plug it just for this occasions.
For this I'll go to what you linked, will figure out later how much space I'll choose for SSD.

1 Like