2 WAN to 1 LAN

Hi i hawe two ISP.
WAN1 and WAN2
How can i do p2p programms come WAN1,and all others come WAN2.
I try to make on example from mikrotik.com
I match all others connections and write route rule,but it did not work.

please give us the example of how you setup the rules

match all trafic

36 chain=prerouting action=mark-routing new-routing-mark=all passthrough=yes

And adding route:

0.0.0.0/0 r 82.135.202.1 1 WAN2 witch routing mark all

this route not work,then i matching example port 80 route works good.

And this example is from mikrotik.com

Notes
You can use policy routing even if you use masquerading on your private networks. The source address will be the same as it is in the local network. In previous versions of RouterOS the source address changed to 0.0.0.0

It is impossible to recognize peer-to-peer traffic from the first packet. Only already established connections can be matched. That also means that in case source NAT is treating Peer-to-Peer traffic differently from the regular traffic, Peer-to-Peer programs will not work (general application is policy-routing redirecting regular traffic through one interface and Peer-to-Peer traffic - through another). A known workaround for this problem is to solve it from the other side: making not Peer-to-Peer traffic to go through another gateway, but all other useful traffic go through another gateway. In other words, to specify what protocols (HTTP, DNS, POP3, etc.) will go through the gateway A, leaving all the rest (so Peer-to-Peer traffic also) to use the gateway B (it is not important, which gateway is which; it is only important to keep Peer-to-Peer together with all traffic except the specified protocols)

Example
To add the rule specifying that all the packets from the 10.0.0.144 host should lookup the mt routing table:

[admin@MikroTik] ip firewall mangle add action=mark-routing new-routing-mark=mt
... chain=prerouting
[admin@MikroTik] ip route> add gateway=10.0.0.254 routing-mark=mt
[admin@MikroTik] ip route rule> add src-address=10.0.0.144/32
... table=mt action=lookup
[admin@MikroTik] ip route rule> print
Flags: X - disabled, I - invalid
0 src-address=192.168.0.144/32 action=lookup table=mt
[admin@MikroTik] ip route rule>


in order to do this this you first have to match all-p2p and then match the rest of the traffic with your routing marks. Then you need a routing table for the p2p traffic. you can then direct p2p along the alternate route and keep normal traffic on the default route.

Your example matches all traffic, so the system cannot differentiate which is p2p without a specific mangle for it.

If p2p trafig goes by default route(not matched by firewall/mangle) interface WAN1.
Whats ports i must mach and routing by policy route when all others trafic coming WAN2?

You have to match p2p to something so that the router can distinguish, even if it goes out the default route. It is easy to match p2p and then assign to default route and then assume all other traffic that is not p2p must go through alternate route. It would not be easy to do the other way around

when i match routing mark p2p trafic and add route rule p2p programs not works.
And when i match other ports, example 80 or 25 route rule works good.