Community discussions

MikroTik App
 
firewallrule
Member Candidate
Member Candidate
Topic Author
Posts: 118
Joined: Tue Oct 13, 2009 9:23 pm

Limit connection from host

Fri Mar 11, 2011 9:49 pm

How can i limit connection from host?

I do a touch on my network and i saw a lot of connections from a single ip address on the network.

I need help
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: Limit connection from host

Fri Mar 11, 2011 10:18 pm

add action=drop chain=forward comment="" connection-limit=200,32 disabled=no protocol=tcp
This will drop any connection after 200 from a single host going through the router. UDP does not have the concept of a connection, so if you wanted to limit UDP as well you would need to set up a packet limit.
 
firewallrule
Member Candidate
Member Candidate
Topic Author
Posts: 118
Joined: Tue Oct 13, 2009 9:23 pm

Re: Limit connection from host

Sat Mar 12, 2011 11:38 am

@fekler,

what does connection-limit=200,32 stand for.

Explain this rule more please
 
tiggda
newbie
Posts: 29
Joined: Fri Mar 04, 2011 11:07 am

Re: Limit connection from host

Sat Mar 12, 2011 4:40 pm

@fekler,

what does connection-limit=200,32 stand for.

Explain this rule more please
http://wiki.mikrotik.com/wiki/Manual:IP ... Properties

connection-limit (integer,netmask) Restrict connection limit per address or address block

32 means a 32-bit netmask, so per-host restriction.
 
tomspappola
just joined
Posts: 18
Joined: Sun Jan 24, 2010 8:32 pm

Re: Limit connection from host

Wed Mar 16, 2011 12:07 am

Hi Feklar

Can you post and example for limiting udp ?

Thanks
Tom
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: Limit connection from host

Wed Mar 16, 2011 4:38 pm

add chain=forward protocol=udp limit=50,5 action=drop

http://wiki.mikrotik.com/wiki/Manual:IP/Firewall/Filter
limit (integer,time,integer; Default: ) Matches packets within given pps limit. Parameters are written in following format: count,time,burst.

count - maximum average packet rate measured in packets per time interval
time - specifies the time interval in which the packet rate is measured
burst - number of packets which are not counted by packet rate
You can obviously get more firewall matches to drop packets off of instead of just setting a hard limit for everything, but that's the rule in it's most basic form. What it means is that the first 5 packets of UDP are ignored from the count, and after that only anything above 50 packets per second are dropped. The rule can also apply to different kinds of traffic like TCP and ICMP, it's just narrowed down by the protocol matcher.

Who is online

Users browsing this forum: gert1, johnson73, svmk, zekino and 121 guests