Bachelor Tech
  • Home
  • Tutorials
  • Portfolio
  • About Jan
  • Contact Jan

OPNSense VM Set Up

by Jan Bachelor September 21, 2020
  1. Download the OPNSense ISO image (use amd64, DVD version) – it should be < 500 MB in size.
  2. Unpack the iso.bz2 file – note that the size of the image will be much greater – at least 1.5 GBs in size.
  3. Upload the image to your Proxmox instance – click on your node -> local disk -> Content -> Upload button:
Uploading OPNSense image into Proxmox
The image upload may take a few minutes

4. Create a new VM with the following parameters:

  • General tab
    • Fill the name VM’s name (e.g. OPNSense), tick the box to ‘Start at boot’.
      • Fill in Start/Shutdown order as 1 (= 1 second), startup delay as 1 (you want this to be the first VM to be started when your server restarts), shutdown delay as 60 seconds or more (to be the last VM to shut down since it will be the gateway for all other devices).
      • Tick the ‘Advanced’ button to view additional settings later.
Creating OPNSense VM on Proxmox
  • OS tab
    • Select the image that you previously uploaded.
    • For Guest OS, select ‘Other’ since OPSense runs on FreeBSD (Unix).
Choosing the OPSense image for the VM installation
  • System tab -> SCSI controller – select VirtUI SCSI (all as defaults). See more details on performance tweaks in Proxmox.
  • HDD tab -> Use SCSI, 16 GB is enough, no cache. The tick box for ‘IO thread’ is useful if you use multiple drives, since with the IO thread, each disk would get a qemu thread.
Recommended hard disk settings for OPNSense VM
  • CPU tab
    • On a Core i5/i7 CPU, it is recommended to be generous with the CPU resources, since any hiccups (CPU spikes) would cause your whole network to slow down – e.g. 2 cores and 2 sockets.
    • The great function of the Core i3+ (and AMD-equivalent) processors is that they support AES-NI, which is good to minimize performance impact of encryption when using VPN services, for example.
    • As for the ‘Type’, choose the appropriate architecture for your CPU. In case of QOTOM, the most compatible example is IvyBridge for a Core i3/i5/i7. If your VM fails to start, the best troubleshooting CPU Type is ‘Westmere’.
    • For the extra CPU flags, enable ‘aes’ for AES-NI support.
Recommended CPU settings – enable AES-NI if your CPU supports it
  • Memory tab -> untick Ballooning Device (since FreeBSD VMs cannot use this functionality). By default for up to 20 devices on the network, 1 GB of RAM is enough. BUT think of what else you may be using OPNSense for (this guide will show you how to do all those):
    • Connecting to an external VPN provider = + 1 GB RAM (ca for 10 active devices on the network).
    • Intrusion Detection & Prevention (e.g. Sensei plugin) = + 1 GB RAM (ca for 10 active devices on the network).
    • Running an OpenVPN server (to connect to your LAN from outside) = + 1 GB RAM (ca for up to 5 active connections).
Recommended min. memory settings for OPNSense VM
  • Network – Select ‘vmbr0’ (LAN) since only one network card can be added at this point. Choose model VirtIO (paravirtualized), untick Firewall.
Network set up of OPNSense – only one network card can be added at this point
  • Finish the set up afterwards – do not set the VM to start yet!

5. Add an extra network card for the WAN interface

Under Datacenter -> your Proxmox node -> OPNsense VM, go to Hardware and add a Network Device that is vmbr1 . For model, use virtio (paravirtualized) or whatever you prefer.

Add the WAN network card once the VM is created but not yet started

6. Final state before first launch

Once all done, check the overall hardware settings of the OPNSense VM. It could look like this:

Overall hardware settings of the OPNSense VM before launch

Now you can finally start the VM up and proceed to the next step 🙂

Disabling default Proxmox firewall
OPNSense Installation
Go back to course overview: Build Your Own Router – Proxmox, OPNSense, OpenVPN server and a VPN client all in one!

2 comments

SL September 22, 2020 - 4:55 pm

Very helpful article! I have created the VM as per suggestions in this article with some slight modifications:
– in the Hard disk tab, I chose “SATA” and enabled “SSD emulation” option. This enables some OSes to treat the SSD drives differently (for example, Windows disables defragmentation). Not sure if it does something in FreeBSD
– in addition to “aes” flag, enabled “pcid” (meldown fix cost reduction on westmere, sandy and ivy bridge intel CPUs)

I have also left SeaBIOS as per default settings, I’m assuming it doesn’t matter really much what BIOS is selected in this case.

Reply
Ed April 21, 2021 - 11:55 pm

In step 4 firewall you turned off firewall, should it be off in step 5 also?
(also firewall=1 in the screen capture for dev0, which, I think should be off and therefore no on the net0 line. I point that out for inexperienced people like myself so others don’t get hung up)

Reply

Leave a Comment Cancel Reply

Save my name, email, and website in this browser for the next time I comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 FacebookWhatsappEmail

Course Steps

  1. Disabling default Proxmox firewall
  2. OPNSense VM Set Up
  3. OPNSense Installation
  4. PCI Passthrough Set Up (Optional)
  5. WAN / LAN Set Up (Before OPNSense Installation)
  6. Initial OPNSense Set up in Web GUI
  7. Dynamic DNS Set Up with DuckDNS on OPNSense
  8. Choosing a VPN provider for your OPNSense
  9. Is it worth getting VPN on OPNSense?
  10. NordVPN installation on OPNSense
  11. Multi-WAN Set Up in Proxmox & OPNSense
Previous Next

Recent Comments

  • Jan Bachelor on Dynamic DNS Set Up with DuckDNS on OPNSenseHi Jake, that's awesome, congratulations on getting…
  • Jake on Dynamic DNS Set Up with DuckDNS on OPNSensefollowed guide above to the T and all is working. i…
  • Fastbrain on Dynamic DNS Set Up with DuckDNS on OPNSenseThanks for the guide. For some reason, after follow…

Other courses

Install iRedMail Mail Server As Proxmox VM With...

October 31, 2024

Remote Bucket Storage for Proxmox VM Backups

August 16, 2024

Concur Alternative: Import Employees’ Credit Card Expenses to...

January 19, 2024

Create an automated Gravity workflow that will allow...

January 19, 2024

Dynamically Populate Gravity Forms from Google Sheets (GSheets...

March 16, 2021
Bachelor Tech
  • Home
  • Tutorials
  • Portfolio
  • About Jan
  • Contact Jan

Recent Posts

  • How to join two Proxmox nodes into a cluster (PVE 8.x)

  • How to Rename a Proxmox Node

  • How to mount an NFS share on an Android box

Facebook Twitter Instagram Pinterest Linkedin Youtube

All Rights Reserved. The theme was customized from Soledad, see PenciDesign