Page 1 of 1

Remove all connections

Posted: Tue Jan 10, 2006 7:09 am
by miroxy
I have script to enable and disable p2p but connection is active. I tried something like this
:global a [/ip firewall  connection print count-only] \ :for i from 0 to $a do=[/ip firewall connection remove $i]
but got nothing

Re: Remove all connections

Posted: Tue Jan 10, 2006 12:00 pm
by sten
/ ip firewall connection {remove [find]}
or the slower but that doesnt fail when there are no connections
/ ip firewall connection {:foreach r in=[find] do={remove $r}}

Posted: Tue Jan 10, 2006 5:42 pm
by miroxy
there are connections nearly 6000 but ...
action failed (6)
... any idea? in winbox works fine just CTRL+A and remove but I need script for this job

Re: Remove all connections

Posted: Thu Sep 25, 2008 1:47 pm
by sergeda
I have the same problem.
How to reset all connection in script. It seems must be simple task but I can't.
I tried / ip firewall connection {:foreach r in=[find tcp-state=established] do={remove $r}}
It simple does nothing. No errors, but no effect.
I tried / ip firewall connection {:put [find tcp-state=established]} to see if it works but it also produce nothing.
It seems that find doesn't find anything.
Can somebody help me with this?

Re: Remove all connections

Posted: Fri Sep 26, 2008 9:30 am
by sergeda
I've found that removing connection failed not only from script. It also failed from winbox with error
ROS 3.14
Is this a bug?

Re: Remove all connections

Posted: Sun Dec 14, 2008 12:03 pm
by sergeda
No one know?
The same thing on ROS 3.17.
I can't remove connection, the same error.

Re: Remove all connections

Posted: Sun Dec 14, 2008 1:03 pm
by balimore
----
hello frens,

yes, you can't remove when it connection still establised...:wink:
better you will set as you need on:
/ ip fire conn track
regards
Hasbullah.com
-----

Re: Remove all connections

Posted: Mon Dec 15, 2008 9:35 am
by sergeda
Well.
I can't remove connection even if it is closed.
But I need to remove established connection to apply rule wich disables p2p.
I schedule disabling of p2p in firewall rule but established connections still dowloading.
How can help
/ ip fire conn track
in this situation?

Re: Remove all connections

Posted: Mon Dec 15, 2008 9:42 am
by mrz
disable/enable connection tracking.

Re: Remove all connections

Posted: Mon Dec 15, 2008 9:52 am
by sergeda
disable/enable connection tracking
Wow, what a simple solution!
Thank you a lot.

Re: Remove all connections

Posted: Mon Dec 15, 2008 12:41 pm
by balimore
----
Hello again,

ye. . . . .that's old problem.
oh, i see that's problem p2p connection. i think 2 kinds will ignoring about it:

- by filter and action=drop or
- mangle it and put queue tree and will set to low speed by screen address

again, you can't remove established. offcourse but you can deacrease it speed.

regards . . . . . :wink:
Hasbullah.com
----
Well.
I can't remove connection even if it is closed.
But I need to remove established connection to apply rule wich disables p2p.
I schedule disabling of p2p in firewall rule but established connections still dowloading.
How can help
/ ip fire conn track
in this situation?