Scenario
We have a fairly straight forward setup that looks like this:
--Routing Table <main>
Route WAN all-nets GW-World
Route LAN LANnet
--Routing Table <MyTable>
Route DMZ DMZnet
What we want to do is to use an IP Policy to forward incoming traffic arriving on WAN to the host located in the DMZnet behind the DMZ interface using a SAT (port forwarding). But no matter what we do using PBR rules, this does not seem to work, we suspect it is because the DMZ interface and server is located in another routing table than the receiving interface.
The Problem
The solution is unfortunately not obvious. The problem is that the routing table has already been selected when the packet arrives on the WAN interface. This means that the route lookup to find the destination host will be done in the routing table the receiving interface is a member of. In this example the WAN interface is a member of <main>. So the lookup will always be done in the <main> routing table regardless of any created PBR rules. It will not be possible to override the route lookup using PBR rules in this particular scenario.
Workaround
The easiest solution to the problem is to add a single-host route in the <main> table (or the table the receiving interface is a member of) that points to the DMZ interface, like this:
--Routing Table <main>
Route WAN all-nets GW-World
Route LAN LANnet
Route DMZ 192.168.50.10
The drawback of this would be that the server in DMZ gets added into a routing table that the administrator may not want it to exist in due to one reason or the other. There is also a chance for rule leakage if the IP policies are not locked down properly.
An alternative workaround would be to use Loopback interfaces to lessen the chance of rule leakage (as the DMZ interface would not be exposed in the same way).
--Routing Table <main>
Route WAN all-nets GW-World
Route LAN LANnet
Route Loopback_1 192.168.50.10
--Routing Table <MyTable>
Route DMZ DMZnet
Route Loopback_2 All-nets
Note: The above is just a simplified example, for more details about Loopback interfaces please see the cOS Core admin guide.
Related articles
26 Apr, 2023 core rules
16 Mar, 2023 core incontrol statistics rules
2 May, 2023 core rules schedule applicationcontrol
26 Jan, 2023 core rules transpose
7 Oct, 2025 core rules
8 Sep, 2020 core ipsec rules access
17 Mar, 2023 core routing rules ping icmp cli