[Work In Progress] OPNsense Ported into ARM Devices

Started by nekoprog, March 25, 2019, 11:55:58 AM

Previous topic - Next topic
March 25, 2019, 11:55:58 AM Last Edit: October 10, 2019, 09:17:02 AM by nekoprog
Hello, I would like to say thank you to OPNsense developers for creating this awesome firewall. I would like to mention that OPNsense is working great on Raspberry Pi 2, using image created by opnsense/tools with the latest PR. The only problem is that there is no repo for updates or installing plugins. Other than that it works just like on x86/64 hardware. I also tried UnboundBL plugin and it works too. I hope that plugin will go official any time soon.

If anyone ask why use RPI2 because it only has one LAN port, I would say that it doesn't matter because I use Netgear Aircard 320U for WWAN and use LAN port with D-Link DAP-1360 wifi AP.

With this as proof of concept, I hope other users/contributors/developers can use the template on opnsense/tools to port OPNsense to other ARM devices.




  • OPNsense ARM Images [DOWNLOADS]
  • Update Repo, edit /usr/local/etc/pkg/repos/OPNsense.conf:
OPNsense: {
  fingerprints: "/usr/local/etc/pkg/fingerprints/OPNsense",
  url: "http://neko.progr.am/pieSense/${ABI}/19.1/latest",
  signature_type: "NONE",
  mirror_type: "NONE",
  priority: 11,
  enabled: yes
}

  • How to make your own ARM image
Minimum required build system:
64bit multicore processor, 4GB RAM and 25GB disk space.

Supported 32-bit ARM devices (arm:armv6):
1. Banana Pi (bpi)
2. Raspberry Pi2 (rpi2)


Supported 64-bit ARM devices (arm64:aarch64):
1. NanoPi NEO2 (nanopi-neo2)
2. Orange Pi PC2 (orangepi-pc2)
3. Raspberry Pi3 (rpi3)


Build steps:
# pkg install git
# cd /usr
# git clone https://github.com/opnsense/tools
# cd tools
# make update
# make xtools base kernel packages arm-3G DEVICE=(product-device)


Everyone is invited to share ideas and help with porting ARM devices using the device config templates on OPNsense/tools.


Wishlist (Needs uboot slave file in ports to make it work)

#Devicedefconfigdtb
1ESPRESSObin??armada-3720-espressobin.dtb | armada-3720-community.dtb
2MACCHIATObin ??armada-8040-mcbin-single-shot.dtb | armada-8040-mcbin.dtb
3Libre Computer Tritium H5libretech_all_h3_cc_h5_defconfigsun50i-h5-libretech-all-h3-cc.dtb
4Odroid XU3/4odroid-xu3_defconfigexynos5422-odroidxu3.dtb
6NanoPi R1nanopi_r1_defconfigsun8i-h3-nanopi-r1.dtb





Hi,
sounds very interesting!
Do you know, if your image would work for RPI3, too?

best regards
Dirk

March 26, 2019, 04:18:20 PM #2 Last Edit: March 26, 2019, 04:47:24 PM by nekoprog
Quote from: monstermania on March 26, 2019, 01:57:11 PM
Hi,
sounds very interesting!
Do you know, if your image would work for RPI3, too?

best regards
Dirk

Hi, no. The attached .img was build specific for RPI2. But you can build RPI3 image using opnsense/tools. Franco just recently merged the PR to make the image bootable. But it still not tested yet because I don't own RPI3.

Hope you can test the code, see if it works or not. If not, we can still contribute something to make it work.

I'd be more than happy to help test! I've got several RPI3 boards gathering dust.

If I get some spare time this week and/or next, I'll test on the RPI3.

Fun to see this old topic is still alive! I think I would also prefer raspi 3 as the "old" image in raspi 1 was vvvveerryyyy slow...

https://forum.opnsense.org/index.php?topic=6099.msg25545#msg25545

:-D
kind regards
chemlud
____
"The price of reliability is the pursuit of the utmost simplicity."
C.A.R. Hoare

felix eichhorns premium katzenfutter mit der extraportion energie

A router is not a switch - A router is not a switch - A router is not a switch - A rou....

Quote from: lattera on March 26, 2019, 05:20:19 PM
I'd be more than happy to help test! I've got several RPI3 boards gathering dust.

If I get some spare time this week and/or next, I'll test on the RPI3.
Thanks. If it doesn't work, I guess UBLDR_LOADADDR=0x200 on device/rpi3.conf is not correct.

Quote from: chemlud on March 26, 2019, 06:34:42 PM
Fun to see this old topic is still alive! I think I would also prefer raspi 3 as the "old" image in raspi 1 was vvvveerryyyy slow...

https://forum.opnsense.org/index.php?topic=6099.msg25545#msg25545

:-D
Franco's code is already working fine to begin with, just a minor tweaking and it works well.

Quote from: chemlud on March 26, 2019, 06:34:42 PM
I think I would also prefer raspi 3 as the "old" image in raspi 1 was vvvveerryyyy slow...
Me too!  ;)
Also very interested of the performance on RPI3...
Of course a working image for Esspresso.bin would be nice!!!  ;D ;D ;D

...still dreaming of ducktaping a raspi to my laptop as a firewall/wifi access while traveling. Powering raspi from laptop would be fun, but a small power bank would be acceptable, too :-D

Currently I use a rather big old box with a wifi stick. 
kind regards
chemlud
____
"The price of reliability is the pursuit of the utmost simplicity."
C.A.R. Hoare

felix eichhorns premium katzenfutter mit der extraportion energie

A router is not a switch - A router is not a switch - A router is not a switch - A rou....

Quote from: monstermania on March 27, 2019, 09:42:51 AM
Quote from: chemlud on March 26, 2019, 06:34:42 PM
I think I would also prefer raspi 3 as the "old" image in raspi 1 was vvvveerryyyy slow...
Me too!  ;)
Also very interested of the performance on RPI3...
Of course a working image for Esspresso.bin would be nice!!!  ;D ;D ;D
If espressobin supported by freebsd, it should work with opnsense, just need to add device config and compile.

Quote from: chemlud on March 28, 2019, 09:55:26 AM
...still dreaming of ducktaping a raspi to my laptop as a firewall/wifi access while traveling. Powering raspi from laptop would be fun, but a small power bank would be acceptable, too :-D

Currently I use a rather big old box with a wifi stick. 
Currenly using RPI2 to run suricata and unboundbl, works great with additional swap file. Still works better than using ipfire or openwrt. More to come with the plugins and update repo. I can see a future of opnsense with wide range of highend (multicore processor + 4GB and above of ram) arm SBC supported.

Is it this Aircard:

https://www.hackster.io/beame-io/how-to-use-an-off-the-shelf-4g-usb-module-with-raspberry-pi-c5c30f


...I only have a Telekom Speedstick LTE V (Huawei E3372s -153), any chance to get that working with the raspi 2? :-)
kind regards
chemlud
____
"The price of reliability is the pursuit of the utmost simplicity."
C.A.R. Hoare

felix eichhorns premium katzenfutter mit der extraportion energie

A router is not a switch - A router is not a switch - A router is not a switch - A rou....

Quote from: chemlud on March 29, 2019, 11:00:39 AM
Is it this Aircard:

https://www.hackster.io/beame-io/how-to-use-an-off-the-shelf-4g-usb-module-with-raspberry-pi-c5c30f


...I only have a Telekom Speedstick LTE V (Huawei E3372s -153), any chance to get that working with the raspi 2? :-)
Looks like same model, but different branding, I guess it's ISP branded air card and not generic one. If possible buy a generic unlocked usb modem and can connect using PPP effortlessly.

Most Huawei usb modem supported by open source distro, I guess freebsd already has a support for it. Just shove it into usb port and open Interface>WAN>IP Configuration Type>PPP and select the correct modem port.

Good news. I also have SBC, but still not supported by BSD.
It's a Libre Computer Tritium H5 2GB:

https://libre.computer/2019/02/07/linux-4-19-lts-images-for-tritium/

It only have support on Ubuntu, Debian and Armbian for now.
Proxmox enthusiast @home, bare metal @work.

Quote from: nekoprog on March 29, 2019, 02:09:43 PM
Quote from: chemlud on March 29, 2019, 11:00:39 AM
I only have a Telekom Speedstick LTE V (Huawei E3372s -153), any chance to get that working with the raspi 2? :-)

Most Huawei usb modem supported by open source distro, I guess freebsd already has a support for it. Just shove it into usb port and open Interface>WAN>IP Configuration Type>PPP and select the correct modem port.

Can confirm this Huawei works, I created a PPP interface with cuaU0.1 and added Z as "init String" under Advanced Options, assigned it to WAN and works like a charm... Will test with the raspi soonish. :-)
kind regards
chemlud
____
"The price of reliability is the pursuit of the utmost simplicity."
C.A.R. Hoare

felix eichhorns premium katzenfutter mit der extraportion energie

A router is not a switch - A router is not a switch - A router is not a switch - A rou....

I'd like to thank nekoprog for the work done with the ARM ports. Very useful and robust now. :)

Next step is actually the long-promised BPI image and then come 20.1 we'll have to see what we can do when i386 is being dropped from our supported list...


Cheers,
Franco

March 31, 2019, 02:07:21 PM #14 Last Edit: April 01, 2019, 12:17:23 PM by nekoprog
Quote from: Antaris on March 30, 2019, 08:10:49 PM
Good news. I also have SBC, but still not supported by BSD.
It's a Libre Computer Tritium H5 2GB:

https://libre.computer/2019/02/07/linux-4-19-lts-images-for-tritium/

It only have support on Ubuntu, Debian and Armbian for now.
Looks like a great device with crypto support. Not sure if FreeBSD already have a supported device that has the same hardware. If they do, maybe can port it's uboot into Tritium.

Quote from: chemlud on March 30, 2019, 10:53:51 PM
Can confirm this Huawei works, I created a PPP interface with cuaU0.1 and added Z as "init String" under Advanced Options, assigned it to WAN and works like a charm... Will test with the raspi soonish. :-)
That's great. Huawei modem always have a good support from open source community. If you have RPI3, try test using that, would like to know how good it will performs.

Quote from: franco on March 31, 2019, 12:41:36 PM
I'd like to thank nekoprog for the work done with the ARM ports. Very useful and robust now. :)

Next step is actually the long-promised BPI image and then come 20.1 we'll have to see what we can do when i386 is being dropped from our supported list...


Cheers,
Franco
No problem, I'm glad to be able to contribute back. If I have any other SBC with 64bit arch, I will help with porting and testing.