VirtualBox and OPNsense Setup

How to setup OPNsense with Virtualbox

In this guide I will show you how to setup OPNsense on virtualbox so we have a secure lab to practice pentesting. If you want to use pfsense I recommend this writeup from 0xCOFFEE.

https://benheater.com/virtualbox-lab-pfsense-firewall/

First we need to download OPNsense which can be found at https://opnsense.org/download/

Select dvd as the image type. We want the iso.

Once downloaded, Open a terminal (Windows key + T < lower case t > ) cd to your Downloads folder and run:

bzip2 -d OPNsense-23.1-OpenSSL-dvd-amd64.iso.bz2

bzip2 is the program we are using to decompress the .bz2 archive.

-d is the flag to decompress the archive.

You should now have:

OPNsense-23.1-OpenSSL-dvd-amd64.iso

Start VirtualBox and add a new machine.

Give your new Machine a Name such as "OpenSense"

Select the location of your ISO Image (Should be in your Downloads folder)

Set Type: BSD and Version to FreeBSD (64-bit) as OPNSense is built on FreeBSD.

Press Next.

Minimum Requirements are 2GB memory and dual core processor. More information on Hardware requirements can be found here: https://docs.opnsense.org/manual/hardware.html

Set Disk Size to at least 16GB

I went with 25GB for the VIrtual Hard Disk. Click Next then click Finish.

Next click System and uncheck Floppy.

We don't need Floppy

In the Audio tab Uncheck Enable Audio.

Uncheck USB in the USB tab.

Network tab

We need to setup 4 adapter cards so we can have access to the internet and also hack our vulnerable machines from vulnhub.

Change adapter 1 to Bridged Adapter and Adapter Type to "Paravirtualized Network"

Click Adapter 2

Enable Adapter 2 and Attached to: Internal Network. Name Your Adapter. This will be for Kali to access the internet and also exploit vulnerable machines. I named mine cyber-range.

Adapter Type: Paravirtualized Network for all adatpers.

Name it whatever you want so you know its Kali.

Adapter 3 will be used for vulnerable machines and won't have access to the internet. Only our kali machine will be able to talk to it.

Adapter 4 will be for Active Directory testing with Windows machines.

Click OK. Your VirtualBox Manager should look similar this:

Last updated

Was this helpful?