Dear Mikrotik friends,
I have two WAN connections one is optic connection and other one is cable. Optic is primary and cable is secondary connections. Optic is ppoe with AD 0 and I have configured cable for AD 5 for failover . I have published one web server on optic and other web server on cable interface with NAT (port forward) . The problem is on cable connection the Web server receives packet but when responds it sends packet trough optic connection. I tried preroute mangle rule to send to cables connection gateway but without success. I have managed to make web server to work when I add static routes of public client IPs which are accessing web server to forward to cables gateway IP
Any suggestions would be appreciated
The reason is how youve configured your routes most likely.
Since all traffic goes out the primary WAN, this will also be the case for any traffic entering via WAN2 (should be the only traffic really) and headed for that server.
The return from this server will follow the rules you have set which is probably go out WAN1.
What I would do is simply make a copy of your rule currently for wan2 as you need to keep the original one as is.
On the copy you will add some info.
Add a routing mark and call it “server_wan2”
Then go to the tab of routing rules and create a new rule.
Use source address of the server
Use action - lookup only in table
Fill in table entry with - server_wan2
Thus anytime traffic is coming out from that server it will go out WAN2.
No need to mangle or do anything fancy as far as I can tell.
How I can create routing mark I can only select main… ? I can in policy rule select Source, Destination, interface.
Would it work source for example 192.168.1.10 ( Web server) and for interface to select one or that is AND function
Okay best thing here is to post your current config without the attempt at any marking,.
Then I can explain it better with examples.
/export hide-sensitive file=anynameyouwish
Hope this screenshot helps?

THANK YOU Very MUCH IT IS WORKING!!!