Install and configure OPNsense 26.7 on Proxmox
OPNsense 26.7 routes and filters traffic between networks. This guide installs it in a Proxmox VM with two network adapters.
The WAN gets an address from your router. The lab LAN uses a private bridge and its own DHCP service. Keep Proxmox management on the existing network.
First verify internet access on LAN, then create a guest VLAN that can browse the web while internal networks remain blocked.
Prepare the WAN and LAN bridges
In Proxmox → node → System → Network, keep vmbr0 connected to the physical NIC. Create Linux Bridge vmbr1 with no bridge port, IP address or gateway. Apply changes from the local console if host access could be interrupted.
- VM WAN → vmbr0 → upstream router. Example upstream network 192.168.1.0/24. Use DHCP on WAN.
- VM LAN → vmbr1 → client VM. Firewall address 192.168.50.1/24, DHCP pool 192.168.50.100 through 192.168.50.199.
- Use a LAN subnet that differs from WAN. To run both products at once, give each firewall a separate LAN bridge and distinct subnets.
Install OPNsense 26.7 in the VM
On the official site, choose the amd64 DVD image for Community version 26.7. Verify the download with the provided checksums or signatures and unpack the .bz2 file to get the ISO.
- In Proxmox, upload the ISO to local → ISO Images. Create an Other OS VM with 2 vCPUs, 4 GB RAM and a 24 GB virtual disk. Mount the ISO and add two VirtIO adapters.
- Attach net0 to vmbr0 for WAN and net1 to vmbr1 for LAN. Record both MAC addresses in Hardware to confirm assignment in the installer.
- At the live console, sign in with installer / opnsense. Select the keyboard, Install (UFS) and the virtual disk. Set a root password, finish installation and remove the ISO on reboot.
Assign interfaces and open the web interface
In the firewall console, use Assign interfaces. Check MAC addresses to match WAN to the upstream adapter and LAN to the private adapter. VirtIO devices usually appear as vtnet0 and vtnet1.
- Use Set interface(s) IP address to configure WAN via DHCP and LAN as 192.168.50.1/24. Leave the LAN gateway unset. This scenario and the rules below cover IPv4.
- Connect a client VM to vmbr1. If LAN DHCP is not active yet, temporarily set the client to 192.168.50.10/24. Open https://192.168.50.1 from that client.
- Sign in as root with the password set during installation. Follow the wizard and confirm WAN and LAN settings.
- If WAN is behind a home router and uses a private address, clear Block private networks on the lab WAN. Keep inbound filtering and web administration on LAN. Leave the protection enabled on a public WAN.
- Under Interfaces → Settings, verify checksum offloading, TSO and LRO are disabled for the VM.
Configure DHCP, DNS and outbound NAT
In Services → Dnsmasq DNS & DHCP, verify the service is enabled and includes LAN. Under DHCP ranges, assign the pool 192.168.50.100 through 192.168.50.199 to LAN. Use one DHCP server on the segment.
- Return the client VM to DHCP. It should receive an address from the pool, gateway 192.168.50.1 and a valid DNS server. To use the firewall for DNS, check that the resolver listens on LAN and answers on TCP/UDP 53.
- On a fresh installation, keep automatic outbound NAT. Under Firewall → NAT, inspect Source NAT or the Outbound page if your configuration still uses it. Also verify the LAN outbound pass rule.
- From the client, check its gateway, then DNS resolution and HTTPS. The lab firewall performs NAT behind the home router’s NAT.
Terminalip -4 addr ip route getent ahostsv4 debian.org curl -4 -I https://www.debian.orgCreate guest VLAN 20
Enable VLAN aware on vmbr1. Leave the firewall’s LAN NIC untagged in Proxmox so it can carry the native LAN and tagged VLAN 20. In Interfaces → Devices → VLAN, create tag 20 on LAN adapter vtnet1.
- In Interfaces → Assignments, add the VLAN as interface INVITES. Enable it with static IPv4 192.168.20.1/24 and leave its gateway blank. For this IPv4 lab, leave IPv6, DHCPv6 and router advertisements disabled on INVITES.
- Add INVITES to the Dnsmasq interfaces and create its DHCP range from 192.168.20.100 through 192.168.20.199. Verify the automatic Dnsmasq DHCP rules.
- Attach a second client VM to vmbr1 with VLAN Tag 20 in Proxmox. Inside that VM, use DHCP on its NIC without creating a VLAN subinterface. The bridge handles tagging for the client.
Isolate guest VLAN with firewall rules
In Firewall → Aliases, create RESEAUX_PRIVES containing 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Add these inbound IPv4 rules in Firewall → Rules → INVITES, in order.
- Pass TCP/UDP 53 from the INVITES subnet to 192.168.20.1 if the firewall supplies DNS. Verify Unbound listens on this interface and permits its subnet. Keep the rule generated by the DHCP service.
- After the DNS exception, block all traffic from INVITES to This Firewall (self), then to RESEAUX_PRIVES. Add any other internal prefixes used by your lab. Finally, pass TCP 80 and 443 from INVITES to any with gateway set to Default. Other traffic is blocked by default.
- From the guest client, verify its DHCP lease and HTTPS access. Try an active LAN service and the firewall web interface. Both should be unreachable from INVITES. Open a new connection after rule changes to avoid reusing an existing state.
Export the configuration and troubleshoot
In System → Configuration → Backups, export the XML configuration after testing. Store it securely because it may contain secrets. Test a restore in an isolated VM.
- No DHCP lease. Check the bridge, the client’s tag, the interface assignment and the DHCP service on the correct network.
- Lease obtained but no internet. Verify the WAN gateway and firewall logs, then check that outbound NAT covers the client subnet.
- If connectivity to a public IP works but names fail, check the DNS server advertised by DHCP and query it from the client. Keep web administration on the management network and apply security updates.