OPNsense Forum

English Forums => Hardware and Performance => Topic started by: Kuroko on December 04, 2020, 05:05:47 am

Title: OPNSense & NanoPi R4S (RK3399)
Post by: Kuroko on December 04, 2020, 05:05:47 am
Hello everyone,

friendlyarm recently released NanoPi R4S, it comes with an RK3399 chip and dual gigabit ethernet port, looks decent for a home firewall. So I am wondering if possible to run opnsense on it...

Link: https://www.friendlyarm.com/index.php?route=product/product&product_id=284
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: tsgan on December 11, 2020, 12:10:21 pm
It should work, see:

https://forum.opnsense.org/index.php?topic=12186.msg94969#msg94969
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: spikerguy on January 29, 2021, 06:45:07 pm
Thank you for creating a working image of opnsense for R4S.

I have used it to make an image for R4S 1Gb - DDR3 version.

I have posted it on Friendlyarm Forum
Here: https://www.friendlyarm.com/Forum/viewtopic.php?f=61&t=3474
So both there version have good support for it now.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: cheese_sticks on February 18, 2021, 07:05:41 pm
Any way to get the code for that? Tried running the compiled img and it doesn’t boot.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: spikerguy on March 11, 2021, 03:20:48 pm
Which Code ?

Here is Crochet repo by @sleepwalker
https://github.com/S199pWa1k9r/crochet

Using OpnSense on R4S Since a month now and everything seems to work fine.
Upgrading it to 21.1 now.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: Huinen on March 11, 2021, 11:27:29 pm
Hi!

I'm using your image and it works great. I tested many things and I think the board is awesome. Only things I miss is Suricata and the clamav antivirus. Good job anyway!

I would like to learn howto use crochet but being a newbie I don't know where to start. I can't see a directory for this board on github. Did  you use another board as base to launch the crochet script? 
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: spikerguy on March 14, 2021, 12:53:12 pm
Hello,

You're welcome.  I had pinged suricata on twitter and they responded with aarch64  pkg will come in future.

I have tried clamav its not very smooth.  Sergey have built opnsense 21.1 image for me already, I have to convert it to R4S image but as my R4s is being used in production I cannot test it yet, while I will order another one for testing.

All these images are work of sergey.  Yes we used Edge-v before but now he have HoneyComb board to build pkgs and images.  I think R4S support is not pushed to crochet yet.  Thanks for informing.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: Nikotine on March 17, 2021, 10:53:56 am
Hi, I've flashed the 4gb version from https://mirror.fkardame.com/Linux/Images/FriendlyArm/NanoPi%20R4s/ (https://mirror.fkardame.com/Linux/Images/FriendlyArm/NanoPi%20R4s/) on a Nanopi r4s 4gb, but I don't believe it runs.
It's hard to troubleshoot without a hdmi output.
Is the SYS led supposed to stay on if it successfully boots, because mine doesn't?
When I connect to the lan port, I don't get an IP address.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: cheese_sticks on March 17, 2021, 11:28:07 am
Hi, I've flashed the 4gb version from https://mirror.fkardame.com/Linux/Images/FriendlyArm/NanoPi%20R4s/ (https://mirror.fkardame.com/Linux/Images/FriendlyArm/NanoPi%20R4s/) on a Nanopi r4s 4gb, but I don't believe it runs.

I'm having the same problem. Tried it with another image @tsgan sent me and it also didn't boot. Connected via serial and there's nothing.

What is needed to build crochet for this? Do I just compile a generic and set it up at boot via serial or do I need to build some files for it? If custom files are needed, it'd be very helpful to get what's been used for the other model and this one so I can make minor changes rather than build the entire thing as this isn't really something I have experience with.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: Huinen on March 17, 2021, 02:41:41 pm
I used Balena-etcher to write the 1Gb version image provided by SpikerGuy and it works really well.

https://mirror.fkardame.com/Linux/Images/FriendlyArm/NanoPi%20R4s/

The pwr led should stay red. Mine, at least, stays red all the time. Others are off.
After writing the image to the SD you should be able to access via HTTP to the LAN port. Be carefull, because the IP is 192.168.111.10/24, wich is not OPNSenses default one. Also the WAN port IP is 192.168.1.230. I did check both IPs mouting the UFS filesystem on the Image provided by Ganbold. Remember to put you computers IP also in the same network.

To use chrochet you need first a Freebsd Operating system (unless you want to crosscompile). I think that the easyest way is to install a Virtual machine with FreeBSD and then download crochet from Github. After that you should launch the script. The problem here,  as i stated in my previous post, is that there is not a dedicated directory for the NanoPi R4s in crochet.

Here is a little guide about using crochet for another board that might help you.

http://minix-i2c.blogspot.com/2013/09/building-custom-freebsd-sd-card-image.html 
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: Nikotine on March 17, 2021, 03:22:23 pm
I used Raspberry Pi Imager, but that shouldn't matter.

I have dhcp enabled on my laptop.
When connecting to the LAN port, I get an 169.254.x.x address, so rubbish.
Should I manually set the ip address and gateway?
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: Huinen on March 17, 2021, 11:35:58 pm
You should set your IP manually since the DHCPv4 is not active in the image. Gateway is not mandatory to reach the device if you are in the same subnet.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: Nikotine on March 18, 2021, 09:51:28 am
Wanted to report back that these settings allowed me to ping Opnsense and get access to the web interface:
IP: 192.168.111.20
MASK: 255.255.255.0 (or 24 on Windows 10)
GW: 192.168.111.10
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: Nikotine on March 18, 2021, 01:43:58 pm
So with this being an unofficial release (meaning not natively supported), I assume that updating doesn't work?

I also can't seem to find plugins to install, I get this message:
Code: [Select]
Firmware status check was aborted internally. Please try again.
Also this:
Code: [Select]
root@nanopi-r4s:~ # pkg update -f
Updating HardenedBSD repository catalogue...
pkg: http://pkgs.hardenedbsd.org/HardenedBSD/pkg/FreeBSD:13:aarch64/meta.txz: Not Found
repository HardenedBSD has no meta file, using default settings
pkg: http://pkgs.hardenedbsd.org/HardenedBSD/pkg/FreeBSD:13:aarch64/packagesite.txz: Not Found
Unable to update repository HardenedBSD
Updating FreeBSD repository catalogue...
pkg: http://pkg.kubsu.ru/FreeBSD:13:aarch64/20.7/meta.txz: Not Found
repository FreeBSD has no meta file, using default settings
pkg: http://pkg.kubsu.ru/FreeBSD:13:aarch64/20.7/packagesite.txz: Not Found
Unable to update repository FreeBSD
Error updating repositories!
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: Nikotine on March 19, 2021, 11:22:00 am
Hi Huinen, does updating or installing plugins work for you?
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: cheese_sticks on March 21, 2021, 03:30:35 pm
Not sure what was going on but I finally got the 4GB running with the link above. It is using the default of 192.168.11.1:80 and dhcpv4 is disabled (that may have been why I couldn't get in). The only light that comes on is the power light.

However, I can't login as it doesn't use the default or any of the standard combos I could think of (root/root, root/password, root/opnsense, admin/admin, etc). Does anyone know what the log in is?

edit: nevermind, turns out there's something else on my network at 192.168.11.1:80, which is very od considering my network uses 10.0.0.0/24...
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: Nikotine on March 21, 2021, 08:16:54 pm
However, I can't login as it doesn't use the default or any of the standard combos I could think of (root/root, root/password, root/opnsense, admin/admin, etc). Does anyone know what the log in is?

root/opnsense
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: Huinen on March 22, 2021, 10:42:44 pm
Hi Huinen, does updating or installing plugins work for you?
I'm afraid that the repositories on kubu.org only contain the 21.1 branch. I tried some changes on the pkg repos but i ended with a broken system.
Lets hope Ganbold, Spikerguy and Sleepwalker make their magic soon...
Meanwhile I'm trying to build myself an image, but I'm a big newbie in Freebsd so don't expect much.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: spikerguy on March 24, 2021, 10:53:22 pm
You need to change the repo of kubsu to this

https://pkg.personalbsd.org/${ABI}-opnsense/21.1/latest

Sleepwalker have moved to his own repo. I will mirror it on my server soon so we have 2 mirrors for users.  Please donate to sleepwaker for all his work on
https://personalbsd.org/
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: Nikotine on March 24, 2021, 11:44:52 pm
You need to change the repo of kubsu to this

https://pkg.personalbsd.org/${ABI}-opnsense/21.1/latest

Sleepwalker have moved to his own repo. I will mirror it on my server soon so we have 2 mirrors for users.  Please donate to sleepwaker for all his work on
https://personalbsd.org/
And how do you change a repo?
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: Nikotine on March 25, 2021, 02:08:40 pm
Ok, I give up. I came here to have something more advanced than OpenWRT, but at the moment this is a bit too much bleeding edge, I think.

On top of all the issues I have setting it up, now the LAN port lost its MAC address somehow:
(https://i.imgur.com/8Jn5fk7.png)

I'll definitely be back once this ARM is officially supported.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: pakcjo on April 10, 2021, 10:11:35 pm
Hi, I just got the 4GB version of the R4S, is there a guide or documentation somewhere about how to build an image for it? Unfortunately I got the version with the case and I’m not sure how to open it to access the uart serial console.

Thanks!
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: cheese_sticks on May 13, 2021, 07:22:45 pm
Unfortunately I got the version with the case and I’m not sure how to open it to access the uart serial console.

On the bottom of the case are 4 rubber pads. Remove those and you'll have access to 4 screws to take of the bottom, then there's two screws on the board. When you have all the screws out you'll have to gently slide the board so that it's pressed all the way up against the side of the case that the ethernet ports are on and then it should come out.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: RainerD on May 28, 2021, 04:53:05 pm
Hi All!

I received my R4S and promptly got it up and running with the premade build from here:
https://personalbsd.org/?p=313 named OPNsense-21.1-OpenSSL-aarch64-NANOPI-R4S-20210417.img.xz

As far as I can see everything worked fine ootb: default ip-address on the LAN port is 192.168.1.1 with te default opnsense login. After initial setup everything worked great.

https://imgur.com/6nKB8aB (https://imgur.com/6nKB8aB)
https://imgur.com/GoYLV0G (https://imgur.com/GoYLV0G)

Now the one thing thats not working for me it's the updates. I tried changing the repo as spikerguy mentioned with the following format but I wasn't sure what the variable ABI means so I tried things like R4S-opnsense but that doesn't work.
 
How could I update to the newest version?

Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: Antaris on May 29, 2021, 01:46:06 am
I observing these series from few years. Any version with proper (Intel) NICs?
And doesn't cost like latest 1L Lenovo with riser and 4 port gig Intel...
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: TheLinuxGuy on June 13, 2021, 10:56:37 pm
How's it going for those using NanoPi-R4S with OPNsense?

I just ordered this off amazon and will start to play with it soon. If OPNsense isn't stable I may use OpenWRT on it but wanted to ask the community if the updates/packages are truly broken on NanoPi-R4S platform or not
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: TheLinuxGuy on June 17, 2021, 07:40:44 am
You need to change the repo of kubsu to this

https://pkg.personalbsd.org/${ABI}-opnsense/21.1/latest

Sleepwalker have moved to his own repo. I will mirror it on my server soon so we have 2 mirrors for users.  Please donate to sleepwaker for all his work on
https://personalbsd.org/
And how do you change a repo?

https://forum.opnsense.org/index.php?topic=12186.0
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: spikerguy on June 19, 2021, 01:26:34 am
Yes updating and installing plugin works fine as sergey is maintaining a repo for aarch64 pkgs which is updated as an when he gets time and there is major updates.

Dont expect all plugins as many are not available for aarch64 architecture yet.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: roninxt on June 25, 2021, 01:01:26 pm
The June 12 image here doesn't work on first boot. Did anyone got it working including internet connection on the WAN interface?

https://personalbsd.org/?page_id=2

I know the mac address of LAN needs to be configured first so you have to connect directly to the pc. I haven't tried it though. Is there a working build that has a working connection on first boot?


Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: spikerguy on August 30, 2021, 01:31:00 am
The June 12 image here doesn't work on first boot. Did anyone got it working including internet connection on the WAN interface?

https://personalbsd.org/?page_id=2

I know the mac address of LAN needs to be configured first so you have to connect directly to the pc. I haven't tried it though. Is there a working build that has a working connection on first boot?
Do you mean it doesn't boot at all?  Coz r4s have 2 types of ram used so maybe it have different uboot for it. 

Not sure.  Please share more detailed logs
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: roninxt on August 30, 2021, 04:20:30 am
Do you mean it doesn't boot at all?  Coz r4s have 2 types of ram used so maybe it have different uboot for it. 

I have R4S with 4 GB ram. It doesn't boot at all. How long until it boots btw? I read that I need to wait for a long time but I already did this. Do I also need to connect R4S directly to my PC and login then edit the mac address?
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: roninxt on September 01, 2021, 10:19:54 am
I finally made it work. The mac address of LAN is 00:00:00... so you won't be able to connect to the admin page and get a connection if you have: R4S -> a switch or a router -> your pc. You must connect your pc directly to R4S and update the mac address of LAN.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: roninxt on September 02, 2021, 12:19:51 am
I have a 1 Gigabit internet, unfortunately I can only get 500 mbps download speed. R4S has a Realtek nic and custom nic which is pci-e based.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: spikerguy on September 11, 2021, 12:43:05 am
If you have 1gb internet than no arm device can handle it atm unless you use macchiatobin or clearfog as most sbc are low end cpu soc with limited IO like the gigabit Ethernet are not powerful enough to give you full performance. 

Best option for you is to use x86_64 device
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: roninxt on September 13, 2021, 07:23:08 am
I think the Hardened BSD drivers are not just optimized for the NICs of R4S.

I'm back to using OpenWRT snapshot and I am able to get 937 Mbps download without Software Flow Offloading. Note that I also tried the official firmware FriendlyWRT, and some other custom WRTs version and all are able to get past 900+ Mbps.

The drivers will get better overtime, when I switch to a lower speed plan I'll use opnsense.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: mentaluproar on October 05, 2021, 07:41:54 pm
Is anyone having cert issues with this?  I cant update or fetch plugins.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: spikerguy on October 10, 2021, 12:14:36 am
Please share which image are you using? 
Which device? 

How are you trying to update? 
You will have to manual change the source link to get updated pkgs if your using image made by sleepwalker as he have created a new repo to maintain all bsd builds.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: mentaluproar on October 16, 2021, 04:56:47 am
It seems to have cleared itself up.  I noticed I couldn't access the personalbsd site while this was broken so it was likely a glitch at the other side.

Unfortunately, I have another problem.  the LAN interface disconnects and reconnects repeatedly after the nano has been running for a day or two.  rebooting it resolves the problem.  It also seems hotter than usual.  Has anyone else noticed this issue?
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: ezerez on February 11, 2022, 04:30:03 pm
Hello

I have just installed OPNsense-21.7.5-OpenSSL-aarch64-NanoPi-R4S-20211130.img.xz from personalbsd.org.
It seems to be getting a DHCP adress on the WAN as well as the LAN interface. It is also accepting ssh on the lan interface. However I dont find a login that works + I also cant see a web interface. Does anyone know the standard login. I already tried alot of combinations, amongst others opnsense/opnsense, root/root, admin/admin, freebsd/freebsd and any combinations of those.

thank you for the help

kind regards
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: mupi2k on February 11, 2022, 09:09:24 pm
root/opnsense

By default, though, on FreeBSD (inherited by most derivatives...) you cannot log in as root via SSH. On mine, I had to enable both "enable root login" and "enable password login" on the GUI to be able to log in.

The GUI allows you to create additional users, which is much preferred over allowing root logins directly. Also highly recommend using SSH keys instead (but you'll need to be in the GUI for that)...
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: EduardCH on May 04, 2022, 09:06:29 pm
Hello

I've tested OPNSense on my NanoPi R4S. As I can see there is the same problem with speed as in OpenWRT when it's doesn't use IRQ to correct CPU Core pinning (cpu affinity). When I tested my board with Iperf3 I got CPU utilization on A53 cores insted of A72. That is why it is not possible to utilize full gigabit speed in OPNSense. I know that it's possible to do the same trick with IRQ to CPU pinning in FreeBSD, but nothing that I've tried worked. Does anybody knows how to correctly do this in FreeBSD? It would be a great home router, if it will work on full gigabit and OPNSense.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: rcat on May 09, 2022, 05:29:12 am
Hello

I've tested OPNSense on my NanoPi R4S. As I can see there is the same problem with speed as in OpenWRT when it's doesn't use IRQ to correct CPU Core pinning (cpu affinity). When I tested my board with Iperf3 I got CPU utilization on A53 cores insted of A72. That is why it is not possible to utilize full gigabit speed in OPNSense. I know that it's possible to do the same trick with IRQ to CPU pinning in FreeBSD, but nothing that I've tried worked. Does anybody knows how to correctly do this in FreeBSD? It would be a great home router, if it will work on full gigabit and OPNSense.

I don't really have anything good to add in terms of actual help but, I've been using a RockPro64 with FreeBSD as my router for about a year now. I just checked iperf, and it used all cores.

I built OPNsense for the RockPro64 and the PCI slot doesn't seem to work. It seems hardware support isn't a direct match with FreeBSD 13. I had to add relevant device tree binaries to the MSDOSBOOT partition and everything works well on the RockPro64 now.

I'm not saying this is the issue in your case, but something to consider.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: mupi2k on May 10, 2022, 05:26:07 pm
If you have 1gb internet than no arm device can handle it atm unless you use macchiatobin or clearfog as most sbc are low end cpu soc with limited IO like the gigabit Ethernet are not powerful enough to give you full performance. 

Best option for you is to use x86_64 device

Sorry, but that's simply not the case. It may be true for OPNsense-based (FreeBSD kernel), but the linux-based OpenWRT works at ~940mbps bidirectionally without breaking a sweat.

I've seen posts where folks running FBSD kernel can get 940mbps, so it's quite possible that the problem lies with something poorly configured in HBSD, but I don't have the resources to purchase a second device just to troubleshoot. I don't realistically have the time, even if someone buys me one, to dig into this, but I really hate when folks say things that are clearly not the case.

I see that Sergey now has a 22.1-based image over on PersonalBSD I may try just to see if it's any better, but setting everything up over and over gets tedious...
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: justdontask on May 22, 2022, 06:26:13 am
I finally made it work. The mac address of LAN is 00:00:00... so you won't be able to connect to the admin page and get a connection if you have: R4S -> a switch or a router -> your pc. You must connect your pc directly to R4S and update the mac address of LAN.

How do you do this?

How do you guys install the img from personalbsd? I tried using balenaetcher to write it to a sd card, but my r4s won't boot...

I put the sd card on the r4s and turn it on, the red led will light up and after some moments the lan and wan led will light up together for like 1-2 seconds then they will turn off to never turn on again and the system led will never turn on.
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: S199p.Wa1k9r on October 14, 2022, 02:04:23 pm
I finally made it work. The mac address of LAN is 00:00:00... so you won't be able to connect to the admin page and get a connection if you have: R4S -> a switch or a router -> your pc. You must connect your pc directly to R4S and update the mac address of LAN.

How do you do this?

How do you guys install the img from personalbsd? I tried using balenaetcher to write it to a sd card, but my r4s won't boot...

I put the sd card on the r4s and turn it on, the red led will light up and after some moments the lan and wan led will light up together for like 1-2 seconds then they will turn off to never turn on again and the system led will never turn on.

Try replacing the sd card
Title: Re: OPNSense & NanoPi R4S (RK3399)
Post by: Bebito on November 08, 2022, 01:34:42 pm
hello, someone has managed to reach 1gb with a nano pi r4s???