Community discussions

MikroTik App
 
User avatar
heislerb
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Mon Sep 16, 2013 4:41 pm

FIREWALL FILTER RULE NOT DOING ALL I WANT

Sat Feb 15, 2014 4:37 am

I wrote a script to block a users access to the internet for a period of time, after that user reached a certain amount of bytes usage. It adds the below firewall filter rule which works as described.
In testing, I found it did not stop a download in-progress (does not stop an established connection). I need to stop users from downloading 24/7 in a system that provides free internet access.
Can some on point me in the right direction? Can additions be made to the below filter rule to make it do both functions.
add action=reject chain=forward out-interface=ether1-gateway protocol=tcp reject-with=tcp-reset src-mac-address=00:00:00:00:00:00
 
User avatar
pcunite
Forum Guru
Forum Guru
Posts: 1345
Joined: Sat May 25, 2013 5:13 am
Location: USA

Re: FIREWALL FILTER RULE NOT DOING ALL I WANT

Sat Feb 15, 2014 4:45 am

RouterOS supports scripting in which you could find the marked connection and then disconnect it. However, it might be more useful to simply throttle it down to nearly nothing and let them disconnect on their own.

You can see how I do this here with HTTP_BIG connections.
 
User avatar
heislerb
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Mon Sep 16, 2013 4:41 pm

Re: FIREWALL FILTER RULE NOT DOING ALL I WANT

Sat Feb 15, 2014 4:54 pm

RouterOS supports scripting in which you could find the marked connection and then disconnect it. However, it might be more useful to simply throttle it down to nearly nothing and let them disconnect on their own.

You can see how I do this here with HTTP_BIG connections.
Yes, I would like to know how to find the marked connection and disconnect it. I had done some scripting to throttle the connect down, but I really need to block all connections for the user for a specific time.

Thanks for your reply!!
 
User avatar
heislerb
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Mon Sep 16, 2013 4:41 pm

Re: FIREWALL FILTER RULE NOT DOING ALL I WANT

Sat Feb 15, 2014 7:49 pm

I just figured it out. I have to move the firewall filter rule to the top of the list. This way the input established connection gets dropped and not accepted by the other firewall filter rules. Sad part is, I knew this when I started to design the script.

Who is online

Users browsing this forum: No registered users and 42 guests