Community discussions

 
simonflex
just joined
Topic Author
Posts: 3
Joined: Fri Dec 21, 2018 8:59 pm

Please help in writing the script.

Wed Jan 09, 2019 9:16 pm

I'm new, I have trouble writing a script. Please help in writing the script.
There is an address-list as_1 as_2 as_3. It is necessary to add all the ip address in the new address list with a check,
for example allow_list_ip. After checking, if the address is missing, then add, if the address was deleted from ~as_,then
delete from allow_list_ip
:foreach ipaddr in= [/ip fi add  print as-value where list~"as_"] do={:put ($ipaddr->"address")}
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 1302
Joined: Sat Dec 24, 2016 11:17 am
Location: jo.overland at gmail.com

Re: Please help in writing the script.

Wed Jan 09, 2019 10:26 pm

Why?

It may be an other way to solve your problem.
 
How to use Splunk to monitor your MikroTik Router

MikroTik->Splunk
 
 
simonflex
just joined
Topic Author
Posts: 3
Joined: Fri Dec 21, 2018 8:59 pm

Re: Please help in writing the script.

Thu Jan 10, 2019 3:25 am

Why?

It may be an other way to solve your problem.
I assume that it is possible to solve differently. Write 20 rules or more, and make changes with your hands. Such tips have already given me .....
I have a home network, and RB-951 ROS 6.43.8
I want to create my own list of trusted and untrusted networks and ip. And then decide what to do with a certain traffic.
For example: I created address lists to track traffic as_apple as_google as_amazon as_microsoft and so on
I added a rule in mangle
ch=forward action=add-src-to-address-list src-address-list=!allow_list_ip address-list=ip_src_frwd_new address-list-timeout=none-dynamic in-interface=ether1
after that there will be thousands of addresses. And how to understand them? And so I added src-address-list=!allow_list_ip and for this my need to fill this address list from my ~as_ address-list
for this task I decided to write a script. I am not a programmer. And for a beginner without skills it is difficult to do this. And perhaps this decision will be needed by many. Thank

Who is online

Users browsing this forum: No registered users and 4 guests