How to build a Router with a Raspberry Pi and managed Switch VLANs with OpenWrt

preview_player
Показать описание
We will use a Raspberry Pi and a managed Switch in order to extend the Pi's Ethernet Port to a LAN and WAN Port using VLANs with OpenWrt. This will effectively turn the Pi into a Router with a WAN port and multiple LAN ports. I will be using a Netgear GS308E Switch (ASIN: B07PDHVZNS), but you could use the following switches as well:

Zyxel GS1200 (recommended): ASIN B0798PKGFQ (8 Port) or B08K2KKK86 (5 Port)
Netgear GS305E: ASIN B07PHNTV45
TP-Link TL-SG108E: ASIN B00JKB63D8, 5 Ports (TL-SG105E): ASIN B00A128S24

0:00 How to add Ethernet to the Pi
1:20 Installing OpenWrt
3:31 Log into OpenWrt/LuCI
4:04 Choosing the Switch
5:05 Configuring the Switch
8:46 Configuring the Pi
10:27 Connection Test
11:02 Configuration Recap
12:07 About Security
13:40 About Performance
15:01 Adding a USB Ethernet Adapter
16:21 Some Finetuning
19:31 About Wi-Fi on the Pi
20:22 Final remarks

Рекомендации по теме
Комментарии
Автор

Hello Marc, I hope you are well.

It is December 2023, and I can find no evidence of your presence here or on any of your other public media sites since May 2023. In this video you announced that you were planning on follow up videos.

I am one of many who have learned much from your work and I hope you will return.

Bob

BobCollins
Автор

Missing your tutorials and explanations - by far the best on YouTube. I really hope you start making them again!

Roger_Hardwick
Автор

I hope this message finds you well! I stumbled upon your channel recently and I have to say, your videos are truly informative and insightful. Your dedication to sharing knowledge and creating such valuable content is evident in every video.

I noticed it's been a while since your last upload, and I just wanted to drop by and express how much I've enjoyed your content. Your videos have made a real difference for me, and I'm sure for many others as well.

Life can get busy, and I completely understand if you've had other priorities recently. But I just wanted to send some positive energy your way and let you know that your work is appreciated and missed. Your unique perspective and expertise have been incredibly helpful, and I genuinely hope to see more of your wonderful videos in the future.

Take care, and looking forward to whatever you have in store next!

ksenyxths
Автор

With cost of Raspberry Pis now, it might just be cheaper to buy Cisco hardware and pay for professional installation and maintenance 😂

SensSword
Автор

Hi @onemarcfifty hope you're doing ok. Haven't seen you for a while. Take care. ;) Hi from Puerto Rico!

IsmaelLa
Автор

Hi, just here to express my gratitude for your work and tell that it's the most useful channel on YouTube for home network setup ever. All your videos are pure gold. The way you explain the material is just perfect. Please do continue, we need more of this. Hope you are well! Take care.

FedorTroitsky
Автор

Hope all is well with you Marc. You've taught me a lot.

foobarturkey
Автор

Thank you Marc for another useful and nice video regarding the OpenWrt with Rasberry Pi. I am using Pi4 based OpnWrt router for at least the last one and a half years and I am fully satisfied with the outcome. With my setup the Pi4 is not only acting as a router rather it acts as a security gateway too by including AdGuard Home, BanIP, and many more. Earlier I used the router on stick setup with a layer 2 switch as you are presenting in the video and later I am convinced with the idea of not exposing the switch to the WAN and now using a USB3 ethernet adaptor to give a clear separation to the WAN and LAN.

I recommended this to one of my friends in England in 2021 and now most of my friends and families in Europe using this setup. This makes me learn a lot about the OpenWrt on Pi4 because I am getting some questions from them from time to time.

By the way, I am using the Pi router behind the Fritz!Box at the moment with the combination of the U6 mesh access points. Some of my friends use the Pi4 as a gateway for the fibre modems for DG Germany, KPN Holland, and Deutsche Telekom.

Pi itself is not a good access point as you mentioned but it can act as a router with true ethernet, enough power, and capacity in conjunction with other wifi mesh systems like Unifi, tp-Link Asus, or any other wifi systems.

One of my colleagues is not convinced with the USB3 ethernet adaptor idea and he bought a Pi4 computer module and the DFRobort router board with two ethernets on-board. We ran several tests and we are getting the same throughput with the SQM and packet steering. But the only notable difference is that the Pi4 with USB3 ethernet is getting 5°C warmer and uses 7-10% more processing power than the DFRobort router board.

I am looking forward to your PBX server setup with OpenWrt. Keep it up Marc, I learned a lot from your videos. Thank you again.

goppinaththurairajah
Автор

Sir, i have a question.Please Answer.
i am using openwrt 22.03.5 on tp link archer c60.

it has only 8mb flash memory. after Installing openwrt only 840kb space left.

now i have noticed, if i reboot the router from luci storage space reduces.

if this continues i may run out of space near future.
is it normal?

mobiletechbangla
Автор

There are mini x86 systems with 4 to 5 LAN ports from China.
They are much better suited as routers than a Raspberry PI with only one 1GB port.
The LAN ports support 2.5 GB each and the x86 CPU is faster.

jensschroder
Автор

is it possible to use openwrt router as the managed switch for this purpose?

ZhafirHisham
Автор

One caution using an inexpensive managed switch (including the Netgear) is their firmware does not allow you to limit the Admin web control to a specific vLan, so I have found it leaking over my WAN vLan. I did find modern D-Link managed switches had this option.

timrobertson
Автор

I used Rpie 4b as router more than 3 years. Here is my experience: first of all forgot about wifi it is unusable at all, only if your house has not walls at all. Second point you will anyway will need second USB type 3 to Ethernet adapter. The third thing you will need nice gigabit manage switch. If you have all of this Rpie may the best router you can by for its price! I have 2 Gbit links for wan and 7 vlans for lab and it perform all of this very well! So my suggestion is to use it if you really want to have nice performance but have no a lot of budget. Also do not forget to enable HW flow offloading in Network->Firewall settings tab admin also you will need to enable Packet steering in the Network->Interfaces->Global network options. It will increase network performance dramatically!

tareeck
Автор

Hello Marc, Can you please do a video on how to do VLANs from OpenWRT to ProxMox VMs & LXCs with Zyxel GS1200.

StaRipper
Автор

Nice tutorial. I set this up as a Proxmox container using the single NIC based on your video. It works great except it won't issue a DHCP address to my laptop. If I hard code the IP on the laptop it works perfectly to connect to the OpenWRt web server on the LAN interface. I just can't get DHCP to work on subinterface. Anyone else have this problem?

andrewhigginbotham
Автор

Make video about how to do vlan from OpenWRT with managed switch please, I've been struggling to configure it 😥

zaidanraufabidin
Автор

If you're building a router, then you'll need something with, at least, dual NICs... One for the WAN interface. I wouldn't trust my network to VLAN. It's possible to circumvent that.

TheChadXperience
Автор

Good tip on the zyxel managed switch - saving that to my amazon list

qcsupport
Автор

Perfect timing. I was just pondering my next step in my migration to vlans on my network. I had a spare RPi but no managed switch.
I was about to click BUY on a managed switch when I realised I could probably reuse my old WNDR3700 openWRT router. I assume I could just use the GB switch ports for this - without the wifi.

johnscamera
Автор

Please give FreeSWITCH a try before making any Asterisk videos. I've been running it for 14 years, but would love to see what you can do with it.

skyblaster