In this guide, we will walk through the complete installation and configuration of OPNsense, an open-source firewall, in a virtual home lab environment using VMware Workstation. We will cover downloading the ISO, setting up the virtual machine with multiple network segments, performing the initial CLI configuration, and finally setting up firewall rules via the web interface.
OPNsense is free and open-source. To get started, visit opnsense.org and navigate to the download section.
Choose the DVD ISO image type (usually paired with amd64 architecture). Select a mirror close to your location for faster download speeds.
The downloaded file will be compressed (e.g., .bz2). You will need a tool like 7-Zip to extract the actual .iso file from the archive before you can use it in VMware.
We will configure the VM to act as a central router/firewall for our lab network.
Create a new Virtual Machine in VMware Workstation. Select "Typical" and browse to your extracted OPNsense ISO file.
We need three distinct network adapters to simulate a real firewall environment:
Power on the VM. It will boot into a "Live Mode". To perform a permanent installation, log in with the user installer and password opnsense.
Follow the installer prompts:
da0) and confirm to destroy contents.Once installation is complete, reboot the system.
After rebooting, log in as root with password opnsense. You will be presented with a text-based menu.
Select Option 1. Based on the MAC addresses in VMware settings, map the interfaces:
em0.em1.em2.By default, LAN 1 might conflict with your home network IP range. We need to change it.
192.168.11.1 (or any subnet different from your WAN)./24.192.168.11.100 to 192.168.11.199.Switch to your Windows 11 VM (connected to LAN Segment 1). It should receive an IP in the 192.168.11.x range. Open a browser and navigate to http://192.168.11.1.
Log in (root/opnsense). The wizard will guide you through general setup like hostname, domain, and DNS servers (e.g., 8.8.8.8).
Important: Uncheck "Block RFC1918 Private Networks" on the WAN interface settings. Since our WAN is a private home network, keeping this checked would block our internet access.
Go to Interfaces > Assignments. You will see the optional interface (opt1). Enable it, rename it to "LAN Server", and set a static IPv4 address (e.g., 192.168.22.1/24).
By default, the new LAN interface (LAN 2) blocks all traffic. We need to create a rule to allow traffic.
Navigate to Firewall > Rules > LAN Server (or whatever you named the second interface).
Click Save and Apply Changes. Your Windows Server on LAN 2 should now have internet connectivity and be able to communicate with devices on LAN 1.