Community discussions

MikroTik App
 
manfredklassen
just joined
Topic Author
Posts: 1
Joined: Wed Apr 23, 2008 5:32 pm

Route p2p to seperate interface

Wed Jul 23, 2008 3:19 am

Is it possible to route p2p traffic to a seperate interface
Ex: ethernet_1 normal traffic and ethernet_2 all-p2p traffic
 
tyronzn
Frequent Visitor
Frequent Visitor
Posts: 72
Joined: Thu May 24, 2007 4:55 pm
Location: Durban,South Africa
Contact:

Re: Route p2p to seperate interface

Wed Jul 23, 2008 2:59 pm

copy this script under new terminal

/ip firewall mangle
add action=mark-connection chain=prerouting comment="Peer 2 Peer" disabled=no new-connection-mark="Peer 2 Peer" p2p=all-p2p passthrough=yes
add action=mark-packet chain=prerouting comment="Peer 2 Peer" connection-mark="Peer 2 Peer" disabled=no new-packet-mark="Peer 2 Peer" p2p=\
all-p2p passthrough=yes
add action=mark-routing chain=prerouting comment="Peer 2 Peer" connection-mark="Peer 2 Peer" disabled=no new-routing-mark="Peer 2 Peer" \
packet-mark="Peer 2 Peer" passthrough=yes


that will mark peer 2 peer,then go to /ip routes
add a new route and select the routing mark and specify the ip address of the interface or select a gateway interface,either way will work
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6697
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: Route p2p to seperate interface

Wed Jul 23, 2008 3:03 pm

As far as I know it's not possible to use policy routing for p2p matcher.
You need to leave P2P traffic for default gateway, and route important services to secondary gateway with policy routing.
 
ValeriyZ
just joined
Posts: 17
Joined: Thu Aug 21, 2008 3:18 pm
Location: Ukraine

Re: Route p2p to seperate interface

Mon Oct 20, 2008 10:28 pm

copy this script under new terminal
...
For someone did turn out to send р2р in such method on other interface?
For me it is not. For example 80 port is thrown. р2р only partly and to outgoing traffic
 
ValeriyZ
just joined
Posts: 17
Joined: Thu Aug 21, 2008 3:18 pm
Location: Ukraine

Re: Route p2p to seperate interface

Tue Oct 21, 2008 1:08 pm

Really in any way is it impossible Р2Р to throw on other interet connection?
 
tyronzn
Frequent Visitor
Frequent Visitor
Posts: 72
Joined: Thu May 24, 2007 4:55 pm
Location: Durban,South Africa
Contact:

Re: Route p2p to seperate interface

Tue Oct 21, 2008 1:34 pm

policy based routing is not possible with P2P,believe me i've tried and im sure many others too.only way is to set the primary gateway through the interface which you want P2P to go through and then add a second gateway and route the rest of important traffic such as HTTP,VOIP etc through that gateway with the use of mangle rules.

Hope it helps.
 
ValeriyZ
just joined
Posts: 17
Joined: Thu Aug 21, 2008 3:18 pm
Location: Ukraine

Re: Route p2p to seperate interface

Tue Oct 21, 2008 1:55 pm

policy based routing is not possible with P2P...
For me now works so. I do not want ports of ONLINE of games by hand to inscribe. I want, that all on straight (primary gateway), and only Р2Р on additional (second gateway). For me a channel with Р2Р will be loaded on 100% and ping on him will be greater.

I understood that this problem does not decide. :( Thank you for a help.
 
tyronzn
Frequent Visitor
Frequent Visitor
Posts: 72
Joined: Thu May 24, 2007 4:55 pm
Location: Durban,South Africa
Contact:

Re: Route p2p to seperate interface

Tue Oct 21, 2008 2:10 pm

problem is that mikrotik can't catch all the P2P,only parts of it.Thats why you need to add 1 gateway which everything
routes through,then add a second gateway and use exceptions of http,voip etc to go through that second gateway.So basically everything will go out the primary gateway with the exceptions of certain types of traffic you tell to go through
the secondry gateway.By doing that you will notice a drastic improvement of ping times and overall throughput.
 
User avatar
Giepie
Member
Member
Posts: 433
Joined: Mon Sep 13, 2004 12:33 pm
Location: Western Cape, South Africa
Contact:

Re: Route p2p to seperate interface

Sun May 03, 2009 10:39 am

The MT P2P rules work on the Layer 7 protocol. Layer 7 protocols are established connections, and due to the connections being established already, you can't route it as you'd be breaking the connection.

The only solution I know works, is as follow:
Route ALL traffic to one gateway(1).
On that gateway, route everything which is NOT P2P to another gateway(2).
On gateway 2 you can now route your non-P2P traffic the way you'd normally do.

It is possible to creat mangle/packet mark rules based on Layer 7 protocols, but it's intended for filter rules. It is still, however, possible to use those packet marks to route everything except traffic marked using Layer 7 filtering.

I hope the above makes sense!