Setting up a Raspberry Pi with 2 Network Interfaces as a simple router
jeffgeerling.com
jeffgeerling.com
Also interesting are the NanoPi R2S and R4S at https://www.friendlyarm.com
Especially those by PCEngines are designed for that job; I've used their Wrap boards in the past as firewalls with PfSense and they were rock solid.
No affiliation with any of them, just a satisfied customer.
Big fan.
https://teklager.se/en/knowledge-base/apu2-1-gigabit-through...
For me, I've discovered the excellent Supermicro X10SLM+-F motherboard. I've bought them off eBay for as little as $145 with 32 gigs of ECC RAM and a 4-core Xeon E3-1220v3 included. Every one I've grabbed runs flawlessly. That board uses around 25w at idle with the BMC running, and can host more than just a pfSense VM. You still have to supply a case and a high quality PSU (don't skimp here!), but those don't have to break the bank.
(If you want to run your router in a VM and pass the LAN controllers through to it, I can recommend the X10SLM+-LN4F, which adds two more gigabit ports. Pricing should be similar.)
If I had to do this on a tighter budget, I have tried OpenWRT on an Rpi4 and it was definitely workable. Didn't have a few features I was looking for, and I was already running a Supermicro anyway for other workloads, so I went back to using a pfSense VM, but YMMV.
[1]https://openwrt.org/toh/views/toh_single-board-computers
[2]https://www.friendlyarm.com/index.php?route=product/category...
personally I'd way rather have a system that boots a good Debian rather than openwrt, & the espressobin will fair many times better/be much easier than many of these openwrt-centric alternatives. and it will happily run openwrt too. this line of chips from Marvell has done a good job over the years keeping good upstream/mainline kernel & u-boot support. whereas openwrt often good es out of itcs way with out of tree patches to support all kinds of difficult hardware environments.
My suggestion wasn't a debian vs OpenWrt one, But rather a 'If you like OpenWrt, then you got SBC options too'.
Anyone know of any?
https://openwrt.org/toh/views/toh_lte_modem_supported
It looks like this table is neither current nor complete though. And there's a different table of OpenWRT compatible devices that have a battery as well.
> [The Amarok (GL-X1200) Industrial IoT Gateway has] 2x SIM card slots for 2x 4G LTE modems (probably miniPCI-E so maybe upgradeable to 5G later), external antenna connectors for the LTE modems, MicroSD, #OpenWRT: https://store.gl-inet.com/collections/4g-smart-router/produc...
The Turris Omnia also has 4G LTE SIM card support (and LXC in their OpenWRT build). https://openwrt.org/toh/turris/turris_omnia
There's also a [Dockerized] x86 build of OpenWRT that probably also supports Mini PCI-E modules for 4G LTE, LoRa, and 5G. Route metrics determine which [gateway] route is tried first.
From "How much total throughput can your wi-fi router really provide?" https://news.ycombinator.com/item?id=26596395 :
> In 2021, most routers - even with OpenWRT and hardware-offloading - cannot actually push 1 Gigabit over wired Ethernet, though the port spec does say 1000 Mbps
I had to do this as part of my testing of two new Compute Module 4-based router boards, both of which may make some decent low-cost and tiny Gigabit routers / firewalls / VPN appliances, depending on your needs.
Thanks for the reply as it totally inspired me to build my own router like it's 2003 =)
Did you get 750-800 out of the box with a Pi4 and USB ethernet? Asking because mine was around 300 and needed some manual tweaking (see also https://news.ycombinator.com/item?id=27231705)
Here's an article on how to install OpenWRT on that (not that you can't just use any distro really, slap ntopng on top for stats and Jeff's your uncle).
for example, many of my machines are on a private vlan that cannot get out (except through a proxy). This is one of the most effective ways of managing your devices since this means by default you will have to opt-in to talk to the internet.
I had 300-400Mbit/s out of the box and got it up to ~900 with the right set up.
I wish all SBCs can have two network interfaces, then wifi/bluetooth, a RTC and a Watchdog and eMMC and FCC and housing. CSI and DSI and HDMI etc can be optional.
I'm working on a project recently and the main bottleneck I'm seeing is that all eth0 interrupts go to a single core, and that core gets swamped with interrupts until it can't handle them anymore and ksoftirqd maxes out at 100% usage on a single core.
This seriously hurts the throughput. I know with RSS I would be able to distribute the eth0 hardware interrupts into 4 queues, with each queue being balanced by irqbalance onto it's own core.
However, in all my searching it appears that the Raspberry Pi hardware/driver is not capable of receive side scaling, and can only put eth0 interrupts into a single queue.
I would love to be told otherwise, if anyone else has found a workaround for this.
Capabilities: [b0] MSI-X: Enable+ Count=4 Masked- sudo ethtool -x eth0
Cannot get RX ring count: Operation not supported
I might have to add a NanoPi to my collectionSo I had all the participants in the workshop connect to this free wifi network at the beginning, because it was available and it was free internet while you were there.
Then at some point during the workshop I had them all visit like facebook without https (you could still do that then) and they were greeted by a poem instead.
This was a workshop on how to protect yourself in daily online life. So the basic tricks like use https, check your browser, bla bla.
Now with VRF-lite in the kernel, it's super simple to route all traffic through a VPN, just put your WAN iface in one VRF and the OVPN/WG interface and your LAN interface in another one, masquerade outgoing traffic on the VPN interface and call it a day. Ofc you need to connect to a VPN provider you trust. TorrentFreak might be a good resource to find reliable ones (the ones that protect ThePirateBay for example).
I'm probably just gonna buy a teeny x86 board, ARM for computers is still weird and incompatible here and there (why is there a raspian when there's already debian, why is there a Manjaro version per popular ARM device while there's only one for x86_64 and one for x86 on the CISC side).
https://www.seeedstudio.com/Rapberry-Pi-CM4-Dual-GbE-Carrier...
DHCPSsrver=yes
in the eth1.network file. Address=10.99.98.1/24 to pick the pool. IPMasquerade=yes will make it forward too. Done. In a standard, understandable, uniform way. Unlike picking & choosing some random daemons to serve random jobs, unlike hacking up some random iptables script you've duck taped together.
I love love love that we're making videos to show people the basics of compute. Adore it. But wow this is souch less ad-hoc & souch more orderly & easier with systemd.