1- Primary connection dedicated for Exchange server that is published to the internet (Ports published: TCP/443; TCP/25 only)
2- Secondary connection dedicated for local users and it’s main purpose to allow the users surf the internet and as a backup access to the exchange server if the primary connection goes down.
All PC’s and Servers are on the same LAN (192.200.200.0/24)
My questions are:
1- how to configure a policy routing to always allow exchange server pass through primary connection (src-nat or masquerade) and to serve any external request to the exchange that is published (dst-nat)?
2- how to configure a policy routing to always allow traffic from users to pass through the secondary connection? and how can I make sure that if I request exchange server (OWA service on port TCP/443) on secondary connection will route to the published service (HTTPS OWA)?
using a mangle rule, chain=prerouting, action=mark routing
set the other variables, such as src-add and dst-add for catching incoming traffic that you want to rout specifically, then set the action to a routing mark based on the connection you want it to go out
then create routes as you normally would, but also include the routing mark you specified in your mangle.
You can see the primary internet has a check-gateway=ping and the failover has a distance of 2. The third entry will force the routing through the failover if the routing-mark=dsl.
This does the routing-mark so packets can return to the DSL interface. It also adds a connection-mark if the packet arrived from the DSL interface. exclude_nat is a list of local subnets that don’t go to the internet.
Now using that connection mark do a srcnat rule so that the packets from the LAN coming back to the router will go out the correct interface: