Community discussions

MikroTik App
 
User avatar
GlueGuy
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Tue May 16, 2006 10:57 pm
Location: San Francisco Bay Area California (CA)
Contact:

Clarification please on connection-limit

Wed Apr 25, 2007 5:11 pm

We have LAN2 on our MT set up for guest access. We want to limit the total number of connections for all the clients on LAN2. It's not clear to me whether this rule limits "per client" or globally on the LAN2 interface:
;;; Drop invalid connections
chain=forward in-interface=LAN2 connection-state=invalid action=drop
;;; Allow established connections
chain=forward in-interface=LAN2 connection-state=established action=accept
;;; Allow only 40 connections
chain=forward in-interface=LAN2 protocol=tcp connection-limit=40,24 connection-state=new action=reject
Can someone let me know if this will do what we want; specifically to limit total connections on LAN2 to 40?
 
sroa
just joined
Posts: 14
Joined: Mon Dec 19, 2005 10:09 pm
Location: Puebla Mexico
Contact:

Thu Apr 26, 2007 8:22 pm

change connection-state=new with tcp-flags=syn and move all the rule before the one that accepts valid connections.
 
User avatar
GlueGuy
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Tue May 16, 2006 10:57 pm
Location: San Francisco Bay Area California (CA)
Contact:

Fri Apr 27, 2007 8:43 am

Not sure what you mean there.

Are you saying to make it like this?:
;;; Drop invalid connections
chain=forward in-interface=LAN2 connection-state=invalid action=drop
;;; Allow only 40 connections
chain=forward in-interface=LAN2 protocol=tcp tcp-flags=syn connection-limit=40,24 action=reject reject-with=tcp-reset
;;; Allow established connections
chain=forward in-interface=LAN2 connection-state=established action=accept
Why put the reject before allowing established connections? Would it not work essentially the same way if after that rule? Or did I misunderstand what you were saying?
 
sroa
just joined
Posts: 14
Joined: Mon Dec 19, 2005 10:09 pm
Location: Puebla Mexico
Contact:

Fri Apr 27, 2007 5:19 pm

If you put the rule to Allow established connections before, all the packets or connections that match (good connections) will exit the filter section and will not continue with the next rule that limits to 40.

You could try changing to 3 or 4 connections instead of 40 and then see the counters in Winbox to see if it limit to the number of connections that you want.
 
User avatar
GlueGuy
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Tue May 16, 2006 10:57 pm
Location: San Francisco Bay Area California (CA)
Contact:

Fri Apr 27, 2007 6:07 pm

I thought the rule:
;;; Allow established connections
chain=forward in-interface=LAN2 connection-state=established action=accept
would only pass connections that are already "established".

so... new connections (ones that are being established (e.g. new connections), would not match this rule?

And following along with that same thought, we would want to also allow "related" connections prior to the reject rule?

Who is online

Users browsing this forum: No registered users and 48 guests