Community discussions

MikroTik App
 
User avatar
jager
Trainer
Trainer
Topic Author
Posts: 295
Joined: Mon Oct 31, 2005 2:44 am
Location: Germany
Contact:

SNAT p2p traffic - HOWTO? Please help

Thu Nov 03, 2005 11:46 pm

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
 
xrtc
just joined
Posts: 14
Joined: Mon Jul 11, 2005 7:40 pm

Mon Nov 21, 2005 1:11 pm

did u find any way to do this??

i want to do the same thing :)
 
User avatar
jager
Trainer
Trainer
Topic Author
Posts: 295
Joined: Mon Oct 31, 2005 2:44 am
Location: Germany
Contact:

Mon Nov 21, 2005 6:08 pm

No, still no idea how to do it :(
 
jarosoup
Long time Member
Long time Member
Posts: 596
Joined: Sun Aug 22, 2004 9:02 am

Tue Nov 22, 2005 1:24 am

Don't you want a destination nat instead of a source nat?
 
User avatar
jager
Trainer
Trainer
Topic Author
Posts: 295
Joined: Mon Oct 31, 2005 2:44 am
Location: Germany
Contact:

Tue Nov 22, 2005 11:11 am

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
 
User avatar
Eugene
Forum Veteran
Forum Veteran
Posts: 986
Joined: Mon May 31, 2004 5:06 pm
Location: Cranfield, UK

Tue Nov 22, 2005 4:25 pm

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
 
jarosoup
Long time Member
Long time Member
Posts: 596
Joined: Sun Aug 22, 2004 9:02 am

Tue Nov 22, 2005 8:01 pm

I think maybe I misunderstood what you were trying to do.
 
User avatar
jager
Trainer
Trainer
Topic Author
Posts: 295
Joined: Mon Oct 31, 2005 2:44 am
Location: Germany
Contact:

Tue Nov 22, 2005 11:05 pm

You want to route all p2p traffic through another ISP, right?
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.
 
smilga
just joined
Posts: 17
Joined: Wed Jun 02, 2004 3:10 pm

Wed Nov 23, 2005 9:28 am

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.
 
User avatar
jager
Trainer
Trainer
Topic Author
Posts: 295
Joined: Mon Oct 31, 2005 2:44 am
Location: Germany
Contact:

Wed Nov 23, 2005 9:31 am

But why not? Is the impossibility of marking the first packet a problem in mikrotik itself or some generaly networking issue?
 
smilga
just joined
Posts: 17
Joined: Wed Jun 02, 2004 3:10 pm

Wed Nov 23, 2005 10:27 am

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