I recently switched over to OPNsense from my Ubiquiti Unifi Dream Machine. This is how I presented all my VLANs as interfaces.
To add VLANs as interfaces to OPNsense running on Hyper-V, you can follow these steps:
- Configure VLANs on Hyper-V Virtual Switch:
- Open Hyper-V Manager.
- Navigate to the virtual switch settings.
- Create VLANs corresponding to the VLANs you want to use on OPNsense.
- Assign VLAN IDs to each virtual switch.
- Configure Virtual Machine Network Settings:
- Select the OPNsense virtual machine in Hyper-V Manager.
- Go to its settings.
- Add network adapters corresponding to the VLANs you created in the previous step.
- Assign each adapter to the respective virtual switch with the appropriate VLAN ID.
- Configure OPNsense Interfaces:
- Log in to OPNsense web interface.
- Navigate to Interfaces > Assignments.
- You should see the additional network adapters corresponding to the VLANs.
- Assign each adapter to an interface (e.g., LAN, WAN, OPT1, OPT2, etc.).
- Configure IP addresses and other settings for each interface as needed.
- Configure Firewall Rules and NAT:
- Once the interfaces are assigned, configure firewall rules to allow or block traffic as per your network requirements.
- If you’re using NAT, configure NAT rules accordingly.
- Verify Configuration:
- Test connectivity from devices connected to each VLAN to ensure that traffic is passing through OPNsense correctly.
- Check firewall logs and monitor traffic to ensure that rules are being applied correctly.
By following these steps, you can add VLANs as interfaces to OPNsense running on Hyper-V and effectively manage your network traffic within your virtual environment. Remember to review and adjust configurations as necessary based on your specific network setup and requirements.