using SBC as router with openwrt extending ethernet ports with VLANs... something powerful I realized recently

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
femispam
Posts: 8
Joined: Sun Apr 12, 2020 2:34 pm

using SBC as router with openwrt extending ethernet ports with VLANs... something powerful I realized recently

Post by femispam »

Hello,
I wanted to share and idea not directly related to dietpi but I guess of interest for people in this community.

I recently tested and proved myself a concept I had pending for many years, the applications of VLANs for extending the ethernet ports of a SBC

Using an SBC as a router (with openwrt installed on it) is much more powerful than most commercial routers to, for example handle way better VPN server, load balancing 2 internet connections, traffic analyzing, downloads, file server... endless options under openwrt, even docker... kindof dietpi...
But the biggest hardware obstacle is that most SBC have only 1 ethernet.
How to solve it? with VLANs and a managed switch supporting VLANs or another openwrt flashed commercial router acting as a managed switch (easy to set up).

The hardware connection is easy: The only ethernet in the SBC to one ethernet in the managed switch, in my case both run openwrt and its very easy to set up once you get the concept.

I will provide more detailed information hopefully tomorrow, I have to go now.

I hope this idea is helpful to someone
ristokoo
Posts: 4
Joined: Fri Feb 14, 2020 9:19 am

Re: using SBC as router with openwrt extending ethernet ports with VLANs... something powerful I realized recently

Post by ristokoo »

femispam wrote: Tue Apr 14, 2020 12:02 am I hope this idea is helpful to someone
Sounds interesting. I have two routers running OpenWRT and two Pi3s lying around. Maybe I could do something fun or even useful with them ;)

Looking forward to further information!
mail2rst
Posts: 51
Joined: Fri Apr 13, 2018 4:53 pm

Re: using SBC as router with openwrt extending ethernet ports with VLANs... something powerful I realized recently

Post by mail2rst »

There is interesting SBC hardware available for this purpose " NanoPi R2S"


https://www.friendlyarm.com/index.php?r ... uct_id=282
femispam
Posts: 8
Joined: Sun Apr 12, 2020 2:34 pm

Re: using SBC as router with openwrt extending ethernet ports with VLANs... something powerful I realized recently

Post by femispam »

ristokoo wrote: Tue Apr 14, 2020 5:14 pm
Sounds interesting. I have two routers running OpenWRT and two Pi3s lying around. Maybe I could do something fun or even useful with them ;)

Looking forward to further information!
Totally. Here you have more info.
mail2rst wrote: Tue Apr 14, 2020 8:08 pm There is interesting SBC hardware available for this purpose " NanoPi R2S"

https://www.friendlyarm.com/index.php?r ... uct_id=282
Wow that's a cool tiny quite powerful board, and very cheap! 22 USD or 25 case included. Thanks for sharing! It did not exist in friendlyarm catalog when I was up to date...
Add a usb wifi supported by openwrt and you have also AP functionality (or wireless client if that fits your needs better).
And if 2 ethernet ports are not enough they can be increased with the method shown here.

Back to the VLANs thing here there is more info.

Some links:

concept https://en.wikipedia.org/wiki/Virtual_LAN
Most routers use VLANs functionality to "detach" one port from the switch and being able to "attach" it to WAN interface: https://openwrt.org/docs/guide-user/net ... l_switches
similar use case: https://forum.openwrt.org/t/using-route ... itch/14448
extensive info, maybe confusing: https://openwrt.org/docs/guide-user/net ... ged_switch

In my case I'm using an old Buffalo router (WZR-HP-G300NH, Gigabit) with 3 VLANs:
  1. for WAN (DHCP client, using LAN 4 port of the switch)
  2. for my LAN (192.168.7.X using LAN 3 port)
  3. for the neighbors LAN (192.168.1.X using LAN 2).
LAN 1 port is for the trunk, the only ethernet cable between SBC and the managed switch.

With Luci (the web interface of openwrt) I have the following setup for the router acting as managed switch
Menu Network -> Switch

Code: Select all

VLAN ID			CPU (eth0)	LAN 1		LAN 2		LAN 3		LAN 4
102			tagged		tagged		untagged	off		off
103			tagged		tagged		off		untagged	off
104			tagged		tagged		off		off		untagged
I also use the buffalo as an AP

Then in the SBC, under menu Network -> Interfaces more interfaces can be added and attached to vlans, in the example eth0.104 for WAN

With this info I guess it's not enough to understand how VLANs work but I hope you see the possibilities, let's say being able to carry different networks through a single cable at the same time.
trendy
Posts: 119
Joined: Tue Feb 25, 2020 2:54 pm

Re: using SBC as router with openwrt extending ethernet ports with VLANs... something powerful I realized recently

Post by trendy »

NanoPi R2S looks good, had I known its existence a month ago I would prefer it over the RPi4 for internet router at home with OpenWrt.
Might as well buy one just for fun.
DIYprojectz
Posts: 1
Joined: Thu Apr 16, 2020 3:48 am

Re: using SBC as router with openwrt extending ethernet ports with VLANs... something powerful I realized recently

Post by DIYprojectz »

@femispam I was going to implement this, but ended up just picking a 802.11ax consumer wireless router instead.

I was planning to use Rock Pi 4 (though any other RK3399 board with PCIe would do, e.g. RockPro64 or NanoPi M4v2) with 4-port RTL8811 PCIe network adapter, for 1x WAN + 4x LAN ports with VLAN tagging and all. OpenWRT doesn't support any of these boards; I was going to run Armbian and build on top of that.

Hope you'll find this information useful.
femispam
Posts: 8
Joined: Sun Apr 12, 2020 2:34 pm

Re: using SBC as router with openwrt extending ethernet ports with VLANs... something powerful I realized recently

Post by femispam »

DIYprojectz wrote: Thu Apr 16, 2020 3:56 am @femispam I was going to implement this, but ended up just picking a 802.11ax consumer wireless router instead.

I was planning to use Rock Pi 4 (though any other RK3399 board with PCIe would do, e.g. RockPro64 or NanoPi M4v2) with 4-port RTL8811 PCIe network adapter, for 1x WAN + 4x LAN ports with VLAN tagging and all. OpenWRT doesn't support any of these boards; I was going to run Armbian and build on top of that.

Hope you'll find this information useful.
sound like a good option (with a pcie adapter I guess) but only if openwrt would be supported, thanks for the idea.

I have the setup mentioned now working but I am also considering a new router because of the faster generation wifi
Post Reply