Using SAT (port forward) to forward traffic into another routing table

Last modified on 25 Nov, 2026. Revision 9
The scenario is that we want to pick up incoming traffic with a SAT forwarding rule, then forward the traffic to a host that is located in another routing table.
Up to date for
cOS Core 15.00.09
Supported since
cOS Core 12.00
Status OK
Author
Peter Nilsson


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

Getting totals for triggering cOS Core IP rule set entries
16 Mar, 2023 core incontrol statistics rules
Closing existing sessions when cOS Core schedules trigger
2 May, 2023 core rules schedule applicationcontrol
Does IPsecBeforeRules trigger before Access rules?
8 Sep, 2020 core ipsec rules access
Troubleshooting cOS Core rules/routes with ping simulation
17 Mar, 2023 core routing rules ping icmp cli