I want to set up an OPNsense firewall on my MSI Cubi N microcomputer. First of all, I need a bootable USB stick. Since I use a non-privileged user on my MacBook, things get a bit more complicated…
Download the Installer: https://opnsense.org/download/
File: OPNsense-24.7-vga-amd64.img.bz2
Now, let’s open the terminal and continue there. Determine the SHA256 checksum and compare it with the checksum provided on the download page:
shasum -a 256 OPNsense-24.7-vga-amd64.img.bz2
Copy the ISO image file to the admin user that has more access rights:
cp OPNsense-24.7-vga-amd64.img.bz2 /Users/admin/Public/Drop\ Box/
Login as the admin user:
su admin
Move to the drop box directory of the admin user. WordPress or my server doesn’t allow me to enter the command with path here…
Unpack the image:
bunzip2 OPNsense-24.7-vga-amd64.img.bz2
Insert the USB stick and determine its path by running the mount command:
mount
The output of the mount command shows, that the USB stick is assigned on my system to /dev/disk2
/dev/disk2 (external, physical):
...
And here is an alternative method to determine the mounting:
diskutil list
diskutil unmountDisk /dev/disk2
diskutil list
Write the image to the USB stick. Note that the path of the USB stick determined previously is changed: /dev/disk2
→ /dev/rdisk2
sudo dd if=OPNsense-24.7-vga-amd64.img of=/dev/rdisk2 bs=64k
And the output is:
39955+1 records in
39955+1 records out
2618501632 bytes transferred in 512.309291 secs (5111173 bytes/sec)
Eject the USB stick and use it to set up the OPNsense firewall.
References
- https://opnsense.org/users/get-started/
- https://www.cyberciti.biz/faq/how-to-create-disk-image-on-mac-os-x-with-dd-command/
- https://superuser.com/questions/1209828/how-can-i-determine-what-various-dev-disk-map-to-on-mac-os-x-macos
- https://superuser.com/questions/631592/why-is-dev-rdisk-about-20-times-faster-than-dev-disk-in-mac-os-x