Community discussions

MikroTik App
 
User avatar
cpresto
Member Candidate
Member Candidate
Topic Author
Posts: 177
Joined: Tue Jul 18, 2006 3:12 pm

P2P to Default Gateway

Wed Aug 29, 2007 2:22 pm

Hi all,
currently I'm identifying P2P by means of mangle on all other type of traffic (ports < 1024), that is mangle as "known". All other type of traffic is mangled unknown (with both connection and packet mark) and routed on default gateway. I would like to add also a "unknown" mark routing to this type of traffic, so I can route it to other routers different from default gateway:

p2p --->mark connection(unknown)--->mark packet(unknown)---->mark routing(unknown)

P2P traffic shares a simple queue.

Mark routing rule is matched on firewall/mangle, but traffic does not enter into simple queue...

Any advice?

Rgds
 
kev23m
just joined
Posts: 12
Joined: Tue Jul 17, 2007 2:23 pm

Re: P2P to Default Gateway

Wed Aug 29, 2007 5:26 pm

The idea is fine but implementation is not.

Get a list of the regular ports used and allow those and mark the rest.

1863 - msn msngr
1701 - VPN
3389 - rdc
5000-1 - yahoo voice
5050 - yahoo mnsgr
5100 - yahoo webcam
5190- aol
6112 - gaming
6665-6669 IRC
6891-6900 - msn msngr file transfer
6901- msn msngr voice
8080- common http
11999 - yahoo games
28800-29100- msn gaming

There will be other custom ports which you will need to remove.
This is how i have done it to, you could also mark unneeded ports from 0 to 1024 also.


Cheers
Kev
 
User avatar
cpresto
Member Candidate
Member Candidate
Topic Author
Posts: 177
Joined: Tue Jul 18, 2006 3:12 pm

Re: P2P to Default Gateway

Wed Aug 29, 2007 7:49 pm

Yes,
but there are many other ports needed (msn video, custom VPN, ....).
Actually the system is working pretty good: all P2P is routed to default gateway where it is queued and all other traffic (known) is directed to other connections. The only problem I have is that I'm not able to apply a mark routing to unknown traffic (p2p) and route this to a dedicated route (not default gateway).
 
User avatar
jdejansb
Frequent Visitor
Frequent Visitor
Posts: 69
Joined: Thu Jul 13, 2006 1:35 pm
Location: Srbija
Contact:

Re: P2P to Default Gateway

Fri Aug 31, 2007 12:07 pm

Yes,
but there are many other ports needed (msn video, custom VPN, ....).
Actually the system is working pretty good: all P2P is routed to default gateway where it is queued and all other traffic (known) is directed to other connections. The only problem I have is that I'm not able to apply a mark routing to unknown traffic (p2p) and route this to a dedicated route (not default gateway).
Yes, this is a problem. It's been written about here in forum, and the only thing one can do for p2p to keep working is NOT to mark routing - just leave it to "go" thru your DEFAULT gateway...

So, lets say, you have two links, "main" link that you pay for really much and "aux" (some adsl line) that is cheap(er).. Make ADSL default gateway, and then mark route all other (important) trafic thru the MAIN link... I've been doing that last night - it works ... still have some ports to "catch" so voice, video and some other stuff go thru "main" link too :)

Good luck,
Dejan
 
User avatar
cpresto
Member Candidate
Member Candidate
Topic Author
Posts: 177
Joined: Tue Jul 18, 2006 3:12 pm

Re: P2P to Default Gateway

Sat Sep 01, 2007 8:33 pm

HI jdejansb,
it seems that I've solve the problem, may be this might be useful to others... 8)

I've simply applied a mark routing (unknown) to all unknown traffic, as described in my post. The mikstake was that mark routing needs IP address to work, so I've done an address list (PPPoE users) where are stored all subnets that I use for customers and apply a mark routing to all unknown traffic (mark connection != known) whose source IP address belongs to address list "PPPoE users".

Now it works, so I can use a gateway for p2p traffic different from Default Gateway

### Unknown Traffic
chain=prerouting action=mark-routing new-routing-mark=unknown
passthrough=no connection-mark=!known src-address-list=PPPoE_users

Rgds
 
User avatar
jdejansb
Frequent Visitor
Frequent Visitor
Posts: 69
Joined: Thu Jul 13, 2006 1:35 pm
Location: Srbija
Contact:

Re: P2P to Default Gateway

Mon Sep 03, 2007 6:05 pm

HI jdejansb,
it seems that I've solve the problem, may be this might be useful to others... 8)

I've simply applied a mark routing (unknown) to all unknown traffic, as described in my post. The mikstake was that mark routing needs IP address to work, so I've done an address list (PPPoE users) where are stored all subnets that I use for customers and apply a mark routing to all unknown traffic (mark connection != known) whose source IP address belongs to address list "PPPoE users".

Now it works, so I can use a gateway for p2p traffic different from Default Gateway

### Unknown Traffic
chain=prerouting action=mark-routing new-routing-mark=unknown
passthrough=no connection-mark=!known src-address-list=PPPoE_users

Rgds
WOW!!!

This would be great if works... I will try to find some time tonight and test :)

(I am having BIG problems since I changed default gateway ... on-line games work very bad, FTP is working sometimes :shock:, etc.....)

Dejan!
 
bushy
Member Candidate
Member Candidate
Posts: 135
Joined: Thu Oct 20, 2005 11:56 pm
Location: Ireland

Re: P2P to Default Gateway

Mon Sep 03, 2007 8:29 pm

It takes a few packets to recognise P2P , so if you try and mark it and send it any other way , it won't perform so well
 
User avatar
jdejansb
Frequent Visitor
Frequent Visitor
Posts: 69
Joined: Thu Jul 13, 2006 1:35 pm
Location: Srbija
Contact:

Re: P2P to Default Gateway

Mon Sep 03, 2007 9:14 pm

It takes a few packets to recognise P2P , so if you try and mark it and send it any other way , it won't perform so well
well... guess that's right. And what if we send ALL packets other then some known to specific gateway??? huh... keep trying :?

Dejan.
 
User avatar
cpresto
Member Candidate
Member Candidate
Topic Author
Posts: 177
Joined: Tue Jul 18, 2006 3:12 pm

Re: P2P to Default Gateway

Tue Sep 04, 2007 12:06 pm

I'm using it in last four days, and it seems ok... :)
Now my DG does not receive P2P any more

Rgds
 
User avatar
jdejansb
Frequent Visitor
Frequent Visitor
Posts: 69
Joined: Thu Jul 13, 2006 1:35 pm
Location: Srbija
Contact:

Re: P2P to Default Gateway

Tue Sep 04, 2007 1:26 pm

I'm using it in last four days, and it seems ok... :)
Now my DG does not receive P2P any more

Rgds
I'm starting to think that I'm stupido :shock: When I do as you suggested, p2p traffic really does not go thru default gateway ... but, also, it goes nowhere :lol: (not working)...

What am I missing? Does address have to be in a address list or could I just put 10.10.0.0/16 ?? (pppoe users get 10.10.10.xxx, 11.xxx, 12.xxx and 14.xxx)??

Dejan
 
User avatar
cpresto
Member Candidate
Member Candidate
Topic Author
Posts: 177
Joined: Tue Jul 18, 2006 3:12 pm

Re: P2P to Default Gateway

Tue Sep 04, 2007 2:11 pm

Did you use a connection mark in your Unknown traffic mark routing rule?

### Unknown Traffic
chain=prerouting action=mark-routing new-routing-mark=unknown
passthrough=no connection-mark=!known src-address-list=PPPoE_users

If your PPPoE address are
10.10.0.0/16
10.11.0.0/16
10.12.0.0/16
10.14.0.0/16
then you need to add all the above networks into PPPoE address list or the whole subnet 10.0.0.0/8. Did you remove the "Passthrough" from mark routing mangle?
Try with a single IP as test (e.g. the one on your PC) and check if mangle rule is matched:
### Unknown Traffic
chain=prerouting action=mark-routing new-routing-mark=unknown
passthrough=no connection-mark=!known src-address-list=<your IP address>
 
User avatar
jdejansb
Frequent Visitor
Frequent Visitor
Posts: 69
Joined: Thu Jul 13, 2006 1:35 pm
Location: Srbija
Contact:

Re: P2P to Default Gateway

Thu Sep 06, 2007 5:00 pm

... I had some problems with WiFi - didn't have time for p2p :( But, I'll try in next few days to make it work ..... (I have to mark ALL the "stuff" that my clients use before sending "!known" to non-default gateway :))

Regards,
Dejan
 
User avatar
jdejansb
Frequent Visitor
Frequent Visitor
Posts: 69
Joined: Thu Jul 13, 2006 1:35 pm
Location: Srbija
Contact:

Re: P2P to Default Gateway

Fri Sep 14, 2007 8:44 pm

it looks like WORKING!!!

Nevertheless - I MANGLEd almost all known nonp2p traffic and ACCEPTed it (when someone complains I look for ports his app. is using and add it to mangle/accept), and whatever left I MARKed connection, packet, and MARKed ROUTING :) ...

p2p goes thru cheep line, and the rest of trafic is on my primary line :shock: :D

Regards,
Dejan
 
User avatar
cpresto
Member Candidate
Member Candidate
Topic Author
Posts: 177
Joined: Tue Jul 18, 2006 3:12 pm

Re: P2P to Default Gateway

Sat Sep 15, 2007 10:43 am

I'm glad it helps...
Rgds,
Carlo

Who is online

Users browsing this forum: parm, tinus and 25 guests