Community discussions

MikroTik App
manfredklassen
刚刚加入了
Topic Author
Posts: 1
加入: Wed Apr 23, 2008 5:32 pm

p2p路由到分离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
Top
tyronzn
常客
常客
Posts: 70
加入: 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
Top
用户头像
sergejs
MikroTik Support
MikroTik Support
Posts: 6689
加入: 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.
Top
ValeriyZ
刚刚加入了
Posts: 17
加入: 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
Top
ValeriyZ
刚刚加入了
Posts: 17
加入: 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?
Top
tyronzn
常客
常客
Posts: 70
加入: 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.
Top
ValeriyZ
刚刚加入了
Posts: 17
加入: 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.
Top
tyronzn
常客
常客
Posts: 70
加入: 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.
Top
用户头像
Giepie
Member
Member
Posts: 432
加入: 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!
Top

Who is online

Users browsing this forum:Bing [Bot],kristapsesterlins,monkez,Semrush [Bot],zuband 54 guests