Community discussions

MikroTik App
 
GREG3f
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 83
Joined: Wed Dec 03, 2008 9:52 pm

Limit connections per port per IP

Thu Dec 08, 2011 3:25 pm

Is there a way to limit every customer IP to say 4 connections per port. I know we can limit the total number of connections per IP, but I want to limit each port to a number of connections.

Or, would there e a way to list port numbers that have many connections and then limit just those ports?

Basically I want to limit connections to ports that are abusing and not limit every port that is being used so that the offending application will suffer and not the clients entire connection.
 
User avatar
alexandro
just joined
Posts: 24
Joined: Mon Jun 06, 2011 11:03 am
Location: Lebanon
Contact:

Re: Limit connections per port per IP

Fri Dec 09, 2011 2:54 pm

Hi ,

Do u mean that you want to make limit session on the user.
If yes please told me ,
I will help you.



TC
 
GREG3f
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 83
Joined: Wed Dec 03, 2008 9:52 pm

Re: Limit connections per port per IP

Fri Dec 09, 2011 3:38 pm

I want to allow for 4 connections per port per client IP.

So a client with an IP address of 192.168.1.2 could have 4 connections on port 80, port 25 and port 5055 while a client with IP 192.168.1.8 could also have 4 connections on port 80, 25, 5055 and also 4 connections on port 1024 and 4462.

Then we might also limit the client to a total of 50 connections TOTAL per IP.

I know how to do the total, but then is a client uses 50 connections for torrent, he can not send email (port 25) of surf web (port 80) or do anything else until he stops torrent.

I want to make problems for ports that are using more then 4 connections at a time, this way the limits should only effect the torrent and not the other services.

Make sense?
 
User avatar
alexandro
just joined
Posts: 24
Joined: Mon Jun 06, 2011 11:03 am
Location: Lebanon
Contact:

Re: Limit connections per port per IP

Sat Dec 10, 2011 11:55 am

Ok its easy ,

All you need to do a filter rule that says :


add action=drop chain=forward comment="Port 80 limit" connection-limit=8,32 disabled=no dst-port=80 protocol=tcp src-address=*.*.*.* tcp-flags=syn

Then any port you need change the dst-port and the connection limit you need

Best Regards
 
GREG3f
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 83
Joined: Wed Dec 03, 2008 9:52 pm

Re: Limit connections per port per IP

Sat Dec 10, 2011 3:51 pm

Are you suggesting that I create 65535 separate rules to control connections to each port? Is there not a way to do this with just a few rules?
 
User avatar
alexandro
just joined
Posts: 24
Joined: Mon Jun 06, 2011 11:03 am
Location: Lebanon
Contact:

Re: Limit connections per port per IP

Sat Dec 17, 2011 1:08 pm

LOL whow said that ,dont you use pools for every profile if not .... sucks
 
User avatar
cybercoder
Member Candidate
Member Candidate
Posts: 175
Joined: Tue Dec 07, 2010 11:20 pm
Location: Guilan, Iran
Contact:

Re: Limit connections per port per IP

Sat Dec 17, 2011 11:36 pm

I think you can do it with mangling and PCC.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot], Qanon and 198 guests