OpenWrt on RP4B as a Home Firewall

Hello all.

I'm running into some issues setting up a Raspberry Pi 4B (RP4) as a firewall. My intention is to place it in between my modem (AT&T, bog standard POS) and my managed switch (TP-Link model TL-SG1024DE). I would like to avoid mirroring traffic and instead set it up physically between the two points, with all traffic from the RP4's ethernet port (eth0) bridged to a USB3 adapter (eth1) and exposed to the switch. This would (in theory) allow me to set filtering on a number of criteria for packets sent between the two ports (eth0 and eth1) and my only limitation would be the theoretical throughput of both physical devices and the processing capabilities of the RP4.

I've tried a variety of options and followed a number of great tutorials (many on this excellent forum!) to do something similar, however, I haven't come across anything that spells out exactly what I'm after and, after hours of trying - and failing - to make it work, am starting to believe there is a reason for this.

Therefor, my question is thus: is it possible to set up my RP4 using OpenWRT to pass all traffic from the RP4's ethernet port to a USB3 port with an ethernet cable plugged into my switch? And, if so, what are the settings I need to focus on in order to achieve this goal? (If anyone knows of a tutorial or guide, I would be forever in your debt!)

Thank you (kind soul) for trudging through my admittedly awkward explanation and I sincerely hope someone has advice and/or an answer!

Hi @trevor9

I must first commit that I'm a total noob too on OpenWrt...
I have set up a PineA64 with the same intention. It acts as a "standard" router (double NAT). So yes, it's possible. From a short overlook, I see there is only snapshot for RPi4, means if you like to have a GUI, you have to install luci on your own over "ssh".

On first configuration maybe that helps:
https://stuff.purdon.ca/?page_id=370

Maybe you should come up with detailed questions where people can help more...

Such as?

Which ones?

What reason?

Yes, it's a fairly standard setup. The only real issue is whether your modem supports bridging or if you have to work around a double NAT scenario.

The short answer is "yes." I've been running an RPi4 for several months. Here is where I would start:

  • Download the 21.02-RC1 image for the RPi4. This includes LUCI and you can add packages whenever you like (unlike the snapshot images)
  • Figure out how to connect to your RPi4 after flashing the image
  • Download the required drivers for your usb ethernet adapter
  • Configure the RPi4 with the usb ethernet dongle as the WAN and the internal ethernet adapter as the LAN

Let us know how it goes. There are also community builds you can look at that include usb adapter drivers and other packages in one image.

There are also lots of existing posts in the forum on setting us a RPi4.
https://forum.openwrt.org/t/rpi4-step-by-step-set-up-please-help/75184/8

1 Like