Policy-based routing
Unlike the static routes added to the system, policy-based routes will be created through firewall rules on OPNsense. In Chapter 5, Firewall, we explored firewall concepts and rules, but nothing related to using a gateway on rules, so now it's time to learn how to do that.
Before starting, to follow these steps, we'll need a host connected to OPNsense's LAN. If you are using VirtualBox as your lab platform, with an additional VM installed, follow these steps to connect it to the OPNsense LAN:
- To attach the VM to OPNsense's LAN, change the network settings to Host-only Adapter by editing the VM settings on VirtualBox:
- As we can see in the preceding screenshot, we need to select Host-only Adapter in the Attached to option. Choose the same network interface your OPNsense's VM uses as the LAN interface in the...