SNAT p2p traffic - HOWTO? Please help

Hi,
I would like to redirect all p2p traffic to another IP.
I marked it in mangle with the following:

0 chain=prerouting p2p=all-p2p action=mark-connection new-connection-mark=p2p_conn passthrough=yes

1 chain=prerouting connection-mark=p2p_conn action=mark-packet new-packet-mark=p2p passthrough=yes

This marking is OK, and there is traffic shown OK on it.
After that, I created a rule as follows:

0 chain=srcnat packet-mark=p2p connection-mark=p2p_conn action=src-nat to-addresses=x.x.x.x to-ports=0-65535

But, unfortunately, this is not working. No traffic is being redirected. Can anybody help me, what am I doing wrong??

Thank you in advance for help

did u find any way to do this??

i want to do the same thing :slight_smile:

No, still no idea how to do it :frowning:

Don’t you want a destination nat instead of a source nat?

well, destination does not matter in this case, right? My logic goes that it should be snat, but maybe I`m wrong.
Please, give some example how do you think we should do it. Thank you

You want to route all p2p traffic through another ISP, right? Then the second rule should contain new-routing-mark parameter instead of new-packet-mark.
Passthrough should be set to no for the second rule as well. Finally, add a separate route for all packets mangled with particular routing mark in /ip route section.

Eugene

I think maybe I misunderstood what you were trying to do.

YES! Thats correct!
Will try your tip the first thing in the morning! Thanx a million, I hope it will work. In any case, I will leave a feedback here.

You can not mark first packet for P2P traffic that why you can not route it to different ISP.

I suggest you to route all P2P traffic to default gateway and everything else to different.

But why not? Is the impossibility of marking the first packet a problem in mikrotik itself or some generaly networking issue?

It is impossibility to detect from first packet if it P2P or not so it is generaly.