HOWTO: OpenWrt on the Raspberry Pi 4

Does anyone have an issue with USB ethernet Wan?
Sometimes I have internet but something is not and I have to restart the main router or play with OpenWRT (restart, interface reboot ).

I use Tplink ethernet USB and I installed the official image. But I have the same results with the community build system too.

Any help would be nice :slight_smile:

There were one or two occasions shortly after first setting up my Pi that the WAN interface (which was connected via the USB dongle) conked out on me. The problem seemed to clear up on its own after a while so I'm afraid I didn't do too much digging into possible causes.

If you encounter the issue again please consider starting a new thread and include whatever information you can, such as any error status from Network -> Interfaces -> Devices and any relevant log messages from Status -> System Log.

Thank you, after a few restarts and some settings changes, my issue is gone. Not sure what happened.

1 Like

Hi guys,

If I build my os from How can I make my SD card available in full size and be protected from a read-only filesystem?

ext4, or squashfs?

I just went to gparted from ubuntu. Did the job well.

Thank you @aporetic for the valuable time you spent making this tutorial which helped everyone and saved our time a lot. By the way are there any specific reasons that you mentioned only about the ext4 filesystem over SquashFS?

Great write-up!

I was wondering if anybody knows how to plug in a Raspbrry-Pi (with pi-hole running headless) into a USB port and have OpenWrt see it as an ethernet connection?

Looking around I've found how and done it with Windows (edit the config.txt ect) seen the scrips to use with Linux (Debian) but I figure there would be a package install in OpenWrt and I just cannot find it with search.

I'm really just using OpenWrt as a really good firewall from my apartment buildings wifi WAN on 2.4GHz using an Alfa AWUS036NH and my LAN using 5GHz on the AP Pi, to get as little interference as possible but of course the zero does not do 5GHz.

If you are talking about the asix 88179 USB3 Gigabit dongle, I have two of them and they work flawlessly on my 1GB Pi 4B, which has been running OpenWRT nearly non-stop for three years now, maybe more. I got it not long after it was introduced. I got the asix dongles not long after. I haven't been using the dongles permanently only for testing situations. But I never had any problems with them.

400Mbit indicates it might be running at USB2 speed, are you sure the dongle is the USB3 type? there are USB2 versions out there that max out at around 400Mbit, due to the USB2 speed limitation of 480 Mbits including overhead. USB3 has the blue spacer in the A-type connector.

1 Like

May I warn you that the onboard WIFI performance of the Pi 4B is not super, as it has a tiny onboard antenna without external connector. I've found it's better to use a USB WiFi dongle with a larger 3-5 DBi antenna for better signal quality / lower noise floor.

Yeah, it is weak but this is a travel router and I only need to cover one hotel room.

What I want to do is set up a headless pi-hole on a pi zero w, plug it into the Pi4 and have OpenWrt recognize it as an Ethernet port because I capture wi-fi with an alpha adapter on (of course) 2.4GHz on the WAN and firewall it with OpenWrt on the LAN @ 5GHz (which the zero will not do).

It is easy to find how to do this in windows but I was wondering if there is a pkg to install in OpenWrt already and the edits needed to the config file..

Finding how to do this in Linux is not impossible but would require me to gpart the sd card and expand the second file system to install all the components.
I cannot remember if I installed the EXT firmware anyway, and I do not want to play around with a working router when there may be something already done.

I, actually, came in today to start a new topic asking the community after trying to search for it but if you have seen something like this and could point to it I would much appreciate it.

Which speeds I can get using it as a openvpn client 256gcm with openwrt?

It won't be great. The RPi4 doesn't have any hardware acceleration for AES. Unless you're only needing it to run at speeds of 10s of Mbits/sec then you're better off looking at using wireguard.

1 Like

WG is superior in a number of other dimensions as well.

Hi very good guide
I intend to try open wrt with an RPI 4 2gb with which I am very confident about controlling it. I have questions regarding open wrt and the overall setup.

RPI 4 has 2 usb v3 connections are needed in order to plug SSD drives. One big for example as a storage space and perhaps a second for the firmware since it is considered as being able to be writable more times than the SD cards. (Logs for example)
Can we have the firmware in an SD card and logs in an other device?
Can i use an extender with a 1g ethernet instead of an access point? Extenders with WiFi 6 and mesh are cheaper than the related access points.
I need to understand completely some things and my questions might be very novice to some of you.

Thank you for your answers. I will try to provide a diagram of connected devices for this guide


Yes'ish. You can mount the SSD somewhere and use that space, but as most logs log to RAM by default, you'd have to check which of those can be diverted elsewhere easily.

I would not recommend using the argon one, as it does not power on the pi when power is restored unless you move the jumper inside to always on, which bypasses the power management in the case. The problem with that is that now the fan runs all the time, and there doesnt seem to be any software for openwrt than can control the fan on this case. (it is controlled over i2c, not normal gpio) The onboard wifi on the pi4 is garbage. Its only 1x1, ap mode doesnt reliabily function on AC, doesnt function at all on N, and has not means of an external antenna. It works ok on legacy mode (which nets you 72.2mbps phy rare at max) when being used as a portable router where its not heavily used. I use a panda pau0d for my wireless uplink using travelmate. It based on the mt7612u which can function perfectly as ap or client, but not both at once. which works ok. tried 23.05.2, 5ghz was broken on my usb adapter, so went back to 22.03.5

Hi everyone, and thank you for your answers
I tried to connect an RPi 4 with a modem, and manage it to work. But unfortunately it does not have internet access. From openwrt's web interface I cannot 'update lists' from software menu. Also diagnostics ping with openwrt web site is not connecting. I have no rule about blocking any device from internet in my modem setup. Also I haven't change anything in the setup apart from the changes referenced in this guide from start until 'maximizing performance' and finally made a restart.
I tried to ssh, but after typing

opkg update

it failed to connect
Any ideas?

It, eventually, synced the time and date.

This happens a lot with Pi4 builds. No one sets the time and date.
So it cannot use DNS servers.

Or they have a blackout that last a few hours and forget the Pi4 has no RTC

But unless you used the link below, you will be hunting down issues for a day or two:

Go there and get the firmware.
apply the option:
Customize installed packages and/or first boot script.

It will add a lot of stuff you need but not, necessarily, all the drivers for WiFi cards, so you need to add those scripts In the space between this (libgcc^^^^ libustream-wolfssl) they go in there where the carats are.
Leave a space on each end. (I forgot to add this yesterday: click request build. It will build the options into the firmware )Run your first boot and then run 'firstboot' and reboot. Otherwise it will cling to your last setup.

You have no need for an SSD drive:
The firmware is loaded into the RAM from the SD card and then the card does nothing.
I use a POS 8GB card because I do not have anything smaller