hi,
How store print result (Ip adress one for each line is the result of my print) adding those ip adresses to ip/firewall/address list/ under name test ?
Thnak you
hi,
How store print result (Ip adress one for each line is the result of my print) adding those ip adresses to ip/firewall/address list/ under name test ?
Thnak you
You’d normally use a script on the /ip/dhcp-server to do this, in which case “print” is not involved, only “/ip/firewall/address-list add …”, see “lease-script=” under https://help.mikrotik.com/docs/spaces/ROS/pages/24805500/DHCP#DHCP-DHCPServerProperties
Is there some reason this approach does not work?
i am monitoring the network and restrict their IP by adding their ip to ip/firewall/address lists when see trafic to certain webpages
and together with a firewall Rule limit their freedom.
When and IP visiting forbidden sites like youtube,facebook to give some example my plane is to add the ip will to address list upon detecting with this command
/ip/kid-control/device/ print proplist=ip-address where activity ~“youtube”
will expand this activity field to include more sites but dont know how guessing it will be by using an array …
Well, now you have me more confused. Kid control does not do blocking of sites, only controls access by time. RouterOS is poorly suited to do content filtering.
So, even in terms of scripting, I’m not sure what your what your trying to gleam from /ip/kid-control/devices since it just what “kids” are connected, not anything about traffic/sites.
But you’d likely need to a :foreach and “print as-value” to loop “line-by-line” as RouterOS uses arrays variables to pass data, not text. But again what you’re looking for isn’t it kid-control AFAIK.
from command prompt i can get what kind of activity any given IP have at any given time at ip/kid-control/devices and field ip address and activity among other data on ROS 7.16.2 at least and seems usefull to use to monitor, my apology if i can not make my idea clearar but like to limit users activity “only if they do not avoid site that is not permited” without addding rules to deny unless needed, it is a project of mine. ..
I guess I don’t understand, since it just bytes per “kid” AFAIK. So if you want to add the IP address of some kid to the address-list based on traffic volume, not site. I’ve never heard of kid control doing anything with content filtering, so really not sure what you’re after.
Do you have some print command output that shows what you trying to add, and describe what should happen in a script? Otherwise, what I cannot connect the dots in what you’re trying to do.
This is printout of an abuser based on kid control, not just to control kids but as a tools to monitor the usage here is the output of my command but need to save each ip in addresslist as abusers:
/ip/kid-control/device/print proplist=ip-address where activity ~“youtube”
Flags: D - DYNAMIC
Columns: IP-ADDRESS
0 D 192.168.200.18
Hope this is possible
how save only the ip adress only since the list includes 1,2,3,4,5 and letter D before the Ip adress that i am interested in to add the ip adress to ip/firewall/address list/abusers
Thank you
I guess it should be something like this, but I don’t use kid-control so cannot test
:foreach ipaddr in=[/ip/kid-control/device/find activity~"YouTube"] do={
/ip/firewall/address-list name=ytkids timeout=1h address=[/ip/kid-control/device/get $ipaddr ip-address]
}
Hi
Thank you for your response, apology for my ignorace but
the script fails using your suggestions.
what do i expect to get from each "/ip/kid-control/device/get line ?
The variable $ipaddress contains
*18
*22
*25
that is what to expect ? but second lines fails since /ip/kid-control/device get option is “number” or “value-name”.
if i tabb thru the options i find ip address, mac address and so on after value-name option
kid-control exist in ROS7 for anyone i guess …
Couple of things:
I just tried this, and while the script logic is appears right… I don’t get anything in activity for any users, even from winbox or CLI with “print”. And docs (https://help.mikrotik.com/docs/spaces/ROS/pages/129531911/Kid+Control) actually do not describe the “activity” attribute so I have no idea what it’s doing to poplulate (or not populate it)…
But I do see your output does find something for activity~“youtube” but I cannot repo that. Activity for the “kid” associated with a MAC is always empty in my tests.
Hi,
Got it working as i want it, the error i got was becasue same ip already entered in firewall address list but it works,
THANK YOU a bunch
FWIW, The topic of YouTube blocking comes up often. But I don’t think I’ve ever seen anyone use kid-control for it.
It be curious if you report back on success/failure, since it’s always a hot topic. While docs are unclear how kid-control is getting activity, I have to presume it requires forcing use of the Mikrotik DNS server, otherwise kid-control activity= may not being detected – so that may effect your success here too…
Testing the kid-control feature with my script, and I’m finding it has some limitations.
While the kid-control it does show traffic for each user, YouTube traffic, for example, isn’t always captured by the kid-control script. This means it wouldn’t detect YouTube usage unless the user is solely on the main webpage (and not, for instance, logged in through microsoft.com or office365.com).
Overall, kid-control is useful for getting a quick snapshot of what websites are being used, but it’s not ideal for comprehensive monitoring with my script. As you mentioned, relying solely on the feature can lead to missed activity, especially with my current setup where my script checks every 10 minutes.
In short, kid-control alone might not be sufficient for detailed traffic monitoring but a usefull feature to get an quick glance.
if any point doing it at all, would be usefull if there would be an buffer of all “sites” visited for each user but now we are moving
looking for other features than what an router should be doing and do BEST routing ..
Thank you all for your help and input, i am glad i went thur all of it, i am glad for all help i got and more that i learned about Mikrotik Now…
Like to say like Einstein said “the more i learn the more i realize that i do not know as much as i thought”.