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

OPNSense VM Set Up

by Jan Bachelor September 21, 2020

Last Updated on September 21, 2020 by Jan Bachelor

  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
Back to: 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 comment 0 FacebookWhatsappEmail

Build Your Own Router – Proxmox, OPNSense, OpenVPN server and a VPN client all in one!

  • Previous
  • Next
Collapse
Expand
  • Hardware Considerations
  • Disabling default Proxmox firewall
  • OPNSense VM Set Up
  • OPNSense Installation
  • PCI Passthrough Set Up (Optional)
  • WAN / LAN Set Up (Before OPNSense Installation)
  • Initial OPNSense Set up in Web GUI
  • Dynamic DNS Set Up with DuckDNS on OPNSense
  • Choosing a VPN provider for your OPNSense
  • Is it worth getting VPN on OPNSense?
  • NordVPN installation on OPNSense
  • Multi-WAN Set Up in Proxmox & OPNSense

Search for articles

Other Tips

  • How to mount an NFS share (such as from FreeNAS) from an Android box
  • How to download a Windows 10 ISO on a Windows device – easy work-around

Other Tutorials

  • Build Your Own Router - Proxmox, OPNSense, OpenVPN server and a VPN client all in one!
    12 Steps
  • Dynamically Populate Gravity Forms from Google Sheets (GSheets APIv4)
    6 Steps

Recent Comments

  • Jan Bachelor on Use Integromat to get computer IDs from user email in JamF ProHi Robert, the static groups were created in the p…
  • Robert Petitto on Use Integromat to get computer IDs from user email in JamF ProCan you share how you'd use Make (integromat) to a…
  • Martin on Part 1 – What do we want to do + Required technology (bank feed)This tutorial deserves more credit, I've not seen…
  • Jan Bachelor on WAN / LAN Set Up (Before OPNSense Installation)Hi Ed, I have not tested it with PCI passthrough y…
  • Ed on OPNSense VM Set UpIn step 4 firewall you turned off firewall, should…

Tags

chrome iso windows

Categories

  • Android
  • FreeNAS
  • Linux
  • Windows

Recent Posts

  • How to mount an NFS share (such as from FreeNAS) from an Android box

  • How to download a Windows 10 ISO on a Windows device – easy work-around

Facebook Twitter Instagram Pinterest Linkedin Youtube

@2019 - All Right Reserved. Designed and Developed by PenciDesign

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