Bookmark

Install OPNsense Firewall/Router in VirtualBox

This article adapts the installation of OPNsense in VirtualBox with two network adapters for a HomeLab firewall/router test. Identify the WAN and LAN roles before connecting the VM to a physical network.

Source reference: i12bretro – Install OPNsense in VirtualBox . The original video belongs to i12bretro on YouTube .

Youtube video player

Create the virtual machine

  1. Download OPNsense from opnsense.org/download .
  2. Extract the .bz2 archive and open VirtualBox.
  3. Select Machine > New.
  4. Name the VM OPNSense, set Type to BSD, and Version to FreeBSD (64-bit).
  5. Assign 1024 MB of memory and create a virtual hard disk.
  6. Name the disk OPNSense.vdi, set its size to 8 GB, choose VDI, and use Dynamically Allocated storage.
  7. Open Settings > Display and set Video Memory to 128 MB.
  8. Open Storage and attach the OPNsense ISO to the CD-ROM drive.
  9. In Network, set Adapter 1 to Bridged Adapter.
  10. Enable Adapter 2 and also set it to Bridged Adapter.

Install OPNsense

  1. Start the VM with Start > Normal and wait for the login prompt.
  2. Log in to the installer with installer / opnsense.
  3. Press Enter at the Welcome screen.
  4. Change the keymap or video font if necessary, then select Accept these Settings.
  5. Select Guided installation.
  6. Select the ada0 disk and choose GPT/UEFI mode.
  7. Wait for OPNsense to copy files and complete the installation.
  8. Set and confirm a new root password, then choose Accept and Set Password.
  9. Select Reboot.
  10. Before rebooting, use VirtualBox Devices > Optical Drives > Remove disk from virtual drive.
  11. Select Machine > Reset so the VM boots from its virtual disk.

Configure the LAN and Web UI

  1. Log in to the terminal as root with the new root password.
  2. Select Set interface IP address by entering 2.
  3. Select the interface that will be used as LAN.
  4. Enter n at the DHCP prompt.
  5. Enter a LAN IP on the same subnet as the management network.
  6. Enter bit count 24 when using a /24 subnet.
  7. Leave the IPv4 upstream gateway empty.
  8. Enter n for IPv6 WAN tracking.
  9. Enter n for IPv6 DHCP, then leave the IPv6 address empty.
  10. Enter n at the DHCP server prompt.
  11. Enter y at the revert-to-HTTP prompt if this is only initial setup on a trusted LAN.
  12. Record the Web UI address shown by the terminal.
  13. Open that address in a browser and log in as root with the new password.

Warning: Do not keep the default password. Bridged Adapter can place OPNsense directly on the physical network; assigning the two adapters incorrectly can create a loop or interrupt connectivity.

Source and video


0 Bình luận

Góp Ý / Bình Luận / Đánh giá