peer to peer prerouting

Hi, I have 2 ISPs and I want to use ISP1 for http connections and ISP2 for ftp+p2p (lots of clients with emule,bit-torrent)
Since for different routing I need routing-mark I tried everything - mark connections, mark packets, mark routing but still can’t reroute my p2p connections to go via ISP2. Any ideas?

p.s. first route is Destination=0.0.0.0/0 Gateway=ISP2 with routing-mark=all-p2p (marked already with mark-packets)
Second route is Destination=0.0.0.0/0 Gateway=ISP1

Set the gateway you wish to use for P2P as the default route.
Set routing mark for TCP traffic on port 80 to send it to the other gateway.

well i do that but every route that i add with some routing-mark - not working - dunno why!?!?

Here you are, next time try to post your ip configurations:

Adjust the values between “” :

/ip fire man
add chain=prerouting action=jump jump=markhttp in-interface=[YOUR LOCAL INTERFACE] dst-port=80 protocol=tcp passthrough=no
add chain=prerouting action=jump jump=markhttp in-interface=[YOUR LOCAL INTERFACE] dst-port=443 protocol=tcp passthrough=no
add chain=markhttp action=mark-connection new-connection-mark=http passthrough=yes
add chain=markhttp action=mark-routing new-routing-mark=http passthrough=no 
add action=return

/ip firewall nat 
add chain=src-nat action=src-nat to-address=[your ISP1 src Address] connection-mark=http comm="HTTP NAT"
add chain=src-nat action=masquerade comm="All Traffic"

/ip route
add dst-address=0.0.0.0/0 gateway=[YOUR ISP1 GATEWAY] routing-mark=http
add dst-address=0.0.0.0/0 gateway=[YOUR ISP2 GATEWAY]

regards.

Thank the above idea.

I really want to known whether the rules can work well?

… there’s only one way to find out :laughing: