HOWTO: OpenWrt on the Raspberry Pi 4

Once my NanoPi R4S shows up I thought it might be cool to do a roundup comparing the Pi, the R4S, and maybe a Belkin RT3200 as well. Let me know if you'd be interested in that and I'll see what I can do. :slight_smile:

4 Likes

hi @aporétique very good tutorial

for more conventional reasons and to have a decent wifi I tested the RT3200 in optical fiber which gave me very good results, with irq balance and packet steering enabled

Summary

Capture d’écran 2022-01-16 à 21.55.16
Capture d’écran 2022-01-16 à 21.55.04



1 Like

Thanks so much for sharing this! The RT3200/E8450 is definitely a terrific option (shoutout to @daniel for all of his hard work) and there's no contest if you need the onboard radios. If you get a chance I'd love to see what sort of numbers your setup can push with SQM enabled.

1 Like

You welcome :wink: i'm on vdsl2 for the moment but if i remember max sqm is about 500 500

I has fiber on 2 month now :fire:

1 Like

We in Europe (Sweden) now after 20years welcome you in the US to the normal every day standard in the big league of internet😃

2 Likes

A post was split to a new topic: Add OpenFlow to OpenWrt on Raspberry Pi

I am using the Raspberry Pi 3 as a portable router and have to say that the onboard Wifi works great. I use it as an access point and never had any trouble. Ok, I never looked at it's speed, but stable it is.

I wonder if the reduced bandwidth with SQM enabled is due to the WAN interface being USB3 based. DFRobot now makes a carrier board for the Raspberry Pi 4 Compute Module that removes the USB3 controller and instead utilizes the Compute Module’s PCIe lane for connecting a second Gigabit Ethernet controller to the CPU. A Raspberry Pi 4 Compute Module installed into this carrier board should be able to provide better throughout with SQM enabled. DFRobot also has a plastic case for this carrier board.

This is the only carrier board I have found so far that has a second Gigabit Ethernet controller connected via the PCIe lane rather than via the USB3 controller. Other carrier boards with a second Gigabit Ethernet port utilize the USB3 controller, which is the same thing as plugging a USB3 Gigabit Ethernet dongle in the Raspberry Pi 4b’s USB3 port.

1 Like

Great guide! I'm getting 750mbit down with SQM enabled!

An important note to make is: do not use ASIX based ethernet dongle. I started this with a ASIX dongle, but I was limited to 400mbit and the driver kept crashing every few hours, replaced it with a RTL dongle, and I'm getting much higher speeds

1 Like

when I initially read OP, I scanned for subject matter... (comprehensive, touches most bases, not too much bias)

reading a second time i'm in awe of just how well written it actually is... irregardless of subject matter

irqbalance has to be enabled in config. Otherwise it won't start automatically.

4 Likes

Thank yo for putting together this great tutorial.

There is one step that was missing and it would be really helpful for newcomers like myself:

During this step, you also need to navigate to the "Firewall Settings" tab, and assign "WAN" as the firewall zone.

Seemed super obvious on hindsight but I thought this setting was under Firewall Settings and it took a lot of reading to finally get here.

I also needed a restart to get everything to work after setting up the firewall zone. Probably a restart for the firewall service would do. Not sure if this should be mentioned in this guide or I tripped up on some error.

1 Like

I found a weird problem with IRQBalance's install script:

under /etc/rc.d

K10S90irqbalance -> ../init.d/S90irqbalance
S90irqbalance -> ../init.d/S90irqbalance

That is incorrect. They should be pointing to /etc/init.d/irqbalance

So I need to run

root@OpenWrt:/etc/rc.d# rm S90irqbalance 
root@OpenWrt:/etc/rc.d# rm K10S90irqbalance 
root@OpenWrt:/etc/rc.d# ln -s ../init.d/irqbalance S90irqbalance 
root@OpenWrt:/etc/rc.d# ln -s ../init.d/irqbalance K10S90irqbalance

This issue would cause IRQBalance to not load if the OpenWRT is rebooted.

No, OpenWrt doesn’t write logs if you don’t set it up to do so. It only saves them in RAM and they are lost at reboot.

1 Like

Thanks for pointing this out! This was not necessary in my setup (not sure why?) but I'll add a note to double-check that setting after configuring the interface. Hope your new setup is treating you well so far. :slight_smile:

1 Like

I switched SD card and started a fresh install shortly after my first. I ended up having to assign the WAN port again, and I still needed to reboot to see everything working. Wonder if it's the version of my server. Thank you for getting back to us!

Not sure if these instructions are still current? I followed them, in relation to the custom image, burnt it and booted my RPi4 with just eth0 connected. I can ssh onto it with no issues but there's no web access via http://192.168.1.1 at all. netstat seeming shows no web server running. Looking at the logs I can't see any obvious issues.

This is the default configuration.

root@OpenWrt:/etc/config# cat network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fda8:6b17:596f::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

Hi there! It looks like it may now be necessary to explicitly request the luci and luci-ssl packages when you build a custom firmware image even using a non-snapshot version. You can verify that LuCI is present in the generated image by searching STDOUT for a string similar to:

Installing luci (git-20.074.84698-ead5e81) to root...

Alternatively since you've already flashed the image you can install it yourself with the following commands:

opkg update
opkg install luci
opkg install luci-ssl
/etc/init.d/uhttpd restart

Thanks for the heads-up, I'll update the guide!

1 Like

Yes that sorted it (I started a-fresh and added the luci and luci-ssl packages to the build), thanks for the prompt response :slight_smile:

1 Like

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: