Community discussions

Search found 217 matches

by ADahi
Thu Jun 13, 2019 7:03 pm
Forum: Scripting
Topic: :tobool not working as expected
Replies: 4
Views: 487

Re: :tobool not working as expected

try remove "" from string
by ADahi
Thu May 23, 2019 2:52 am
Forum: Scripting
Topic: Quick help for short code line
Replies: 11
Views: 905

Re: Quick help for short code line

yes
problem fixed by remove ( ) from script
by ADahi
Wed May 22, 2019 9:26 pm
Forum: Scripting
Topic: Quick help for short code line
Replies: 11
Views: 905

Re: Quick help for short code line

=0 : mean false or wireless registration table is empty
both are same
other solutions
<=0 : mean less or equal zero
!=0 : mean any number except zero
!=1 : mean any number except one
>0 : mean greater than zero.
etc.
by ADahi
Tue May 21, 2019 2:18 am
Forum: Scripting
Topic: Quick help for short code line
Replies: 11
Views: 905

Re: Quick help for short code line

interval should be "1d 00:00:00" to work properly
by ADahi
Mon May 20, 2019 4:47 am
Forum: Scripting
Topic: Quick help for short code line
Replies: 11
Views: 905

Re: Quick help for short code line

:if ( [/interface wireless registration-table print as-value count-only]=0 ) do={/interface wireless disable wlan1} else={}
by ADahi
Sun May 19, 2019 2:08 am
Forum: Scripting
Topic: How to get multiple data using "value-name"
Replies: 5
Views: 547

Re: How to get multiple data using "value-name"

Solved
:do {/ip dhcp-server lease
 :foreach i in=[find] do={
 :put ("comment=" . [get $i value-name=comment] . ", address=" . [get $i value-name=address] . ", host-name=" . [get $i value-name=host-name]);
 }
} on-error={}
by ADahi
Tue Feb 12, 2019 11:40 pm
Forum: Scripting
Topic: Visual Studio IDE 2017 RouterOS API C
Replies: 1
Views: 262

Visual Studio IDE 2017 RouterOS API C

This is RouterOS API in C for windows, I just import https://github.com/h0rhay67/Mikrotik-API to Visual Studio IDE 2017 and fix all issues, if you interested, you can download it.
hope benefit.

Best Regards.
by ADahi
Fri Nov 23, 2018 5:05 am
Forum: Scripting
Topic: Scripting Array help
Replies: 4
Views: 901

Re: Scripting Array help

by ADahi
Mon Nov 12, 2018 10:30 pm
Forum: Scripting
Topic: Need help with a simple put
Replies: 1
Views: 345

Re: Need help with a simple put

:if ( [/ip firewall filter find where dst-port=XXXX] !="" ) do={:put "Firewall Filter Rule for port XXXX is confirmed"}
by ADahi
Sat Nov 10, 2018 12:48 pm
Forum: Scripting
Topic: shift array
Replies: 1
Views: 761

Re: shift array

1st: use local instead of global to prevent issues(local is auto, global is static) 2nd: use "=" inside array index is not needed, use($array->index) better to get or set values This example may help you to solve your issue :do { :local array {1; 2; 3; 4; 5; 6; 7; 8; 9; 10}; :for i from=0 to=([:len ...
by ADahi
Wed Sep 26, 2018 9:39 pm
Forum: Scripting
Topic: Problem with string concatenation
Replies: 1
Views: 270

Re: Problem with string concatenation

what do you want get from Wireless registration table ?
by ADahi
Sun Sep 23, 2018 1:02 am
Forum: Beginner Basics
Topic: need help with simple failover
Replies: 6
Views: 518

Re: need help with simple failover

set eth1 distance=1
set eth2 distance=2
done :wink:
by ADahi
Sun Sep 23, 2018 12:58 am
Forum: General
Topic: Email via Gmail no longer working since Aug 22 [SOLVED]
Replies: 9
Views: 1155

Re: Email via Gmail no longer working since Aug 22 [SOLVED]

smtp.gmail.com resolves to another IP (173.194.79.108, depending on location and used dns service). Just set hostname as address and you should be fine. /tool e-mail set address=[:resolve "smtp.gmail.com"] from=myaddress@gmail.com password=\ "laaadeeeda" port=587 start-tls=yes user=myaddress@gmail....
by ADahi
Sat Sep 22, 2018 9:28 pm
Forum: Scripting
Topic: "No such item (4)" while counting connections
Replies: 11
Views: 1002

Re: "No such item (4)" while counting connections

/ip firewall connection print count-only where dst-address~"[1-5]+\\.[1-5]+\\.[1-5]+\\.[1-5]+"
OR
/ip firewall connection print count-only where (dst-address~"1.1.1.1" || dst-address~"2.2.2.2" || dst-address~"3.3.3.3" || dst-address~"4.4.4.4" || dst-address~"5.5.5.5")
by ADahi
Fri Sep 21, 2018 11:50 am
Forum: Scripting
Topic: Bandwidth test daily
Replies: 9
Views: 2841

Re: Bandwidth test daily

you welcome :D
by ADahi
Fri Sep 21, 2018 11:25 am
Forum: Scripting
Topic: Bandwidth test daily
Replies: 9
Views: 2841

Re: Bandwidth test daily

it was working on bugfix versions
modify script required for stable versions
by ADahi
Wed Sep 19, 2018 1:36 am
Forum: The User Manager
Topic: USERS start time end time incorrect
Replies: 1
Views: 668

Re: USERS start time end time incorrect

"Parent time zone"
its right value
by ADahi
Sat Sep 15, 2018 7:26 pm
Forum: Scripting
Topic: name of variable
Replies: 4
Views: 413

Re: name of variable

:global x 10;
if you need to change value of x
:set $x 20;
by ADahi
Sat Sep 15, 2018 1:40 pm
Forum: Scripting
Topic: name of variable
Replies: 4
Views: 413

Re: name of variable

{
:local x 10;
:local y $x;
:put ($y);
}
y = x = 10
by ADahi
Sat Sep 15, 2018 9:56 am
Forum: Scripting
Topic: how to take mac-adress
Replies: 2
Views: 295

Re: how to take mac-adress

:put [/interface bridge host get number=[find where local=yes && on-interface=ether1 ] mac-address ]
by ADahi
Thu Sep 13, 2018 9:38 pm
Forum: The User Manager
Topic: Possibility of deleting user manager sessions older than 3 months
Replies: 1
Views: 760

Re: Possibility of deleting user manager sessions older than 3 months

better idea, when user get expired, export his sessions to file before remove his sessions
file name = USER_sessions _of_month
by ADahi
Thu Sep 13, 2018 8:46 pm
Forum: Scripting
Topic: Script to create directory (Wiki update)
Replies: 2
Views: 1181

Re: Script to create directory (Wiki update)

Easier and safer
[/tool fetch dst-path="/dir1/dir2/ " url="http://127.0.0.1:80/mikrotik_logo.png" keep-result=no]
by ADahi
Thu Sep 13, 2018 8:24 pm
Forum: Scripting
Topic: Script delete old log files for date
Replies: 7
Views: 1127

Re: Script delete old log files for date

You're very welcome
by ADahi
Thu Sep 13, 2018 7:47 pm
Forum: Scripting
Topic: Problem with script
Replies: 2
Views: 281

Re: Problem with script

may be "no such item"
use this command to see what is the output
:put [/ip firewall address-list remove numbers=6 ]
by ADahi
Thu Sep 13, 2018 7:27 pm
Forum: Scripting
Topic: Script delete old log files for date
Replies: 7
Views: 1127

Re: Script delete old log files for date

if I wanted to delete only the older 10-day examples, do I have to modify the script? yes, you have to modify the script. is there a command in ftp to move the log files? it would be ideal, so you do not need to delete all the log files. yes, you can use fetch command to send the log files to other...
by ADahi
Thu Sep 13, 2018 3:11 pm
Forum: Scripting
Topic: Script delete old log files for date
Replies: 7
Views: 1127

Re: Script delete old log files for date

schedule this script every 1d :do { :local array {"jan"; "feb"; "mar"; "apr"; "may"; "jun"; "jul"; "aug"; "sep"; "oct"; "nov"; "dec"} :local DATE [/system clock get date]; :local day [:pick $DATE 4 6]; :local month ([:find $array [:pick $DATE 0 3]]); :if ($month=0) do={ :set $month 11; :set $year ($...
by ADahi
Thu Sep 13, 2018 2:20 pm
Forum: Scripting
Topic: need a script for backup and email with details
Replies: 5
Views: 964

Re: need a script for backup and email with details

Does this help?
Updated check it again
by ADahi
Tue Sep 11, 2018 8:20 pm
Forum: Scripting
Topic: Script to compare RX-Rate? [SOLVED]
Replies: 14
Views: 1057

Re: Script to compare RX-Rate? [SOLVED]

can you show us the output
by ADahi
Tue Sep 11, 2018 6:14 am
Forum: Scripting
Topic: Script to compare RX-Rate? [SOLVED]
Replies: 14
Views: 1057

Re: Script to compare RX-Rate? [SOLVED]

script will work if found station with rx-rate less than 20 Mbps in wireless registration table
by ADahi
Sun Sep 09, 2018 11:33 am
Forum: General
Topic: How isolate a WiFi connected device ?
Replies: 4
Views: 465

Re: How isolate a WiFi connected device ?

to isolate all wifi stations
by ADahi
Sun Sep 09, 2018 7:08 am
Forum: Scripting
Topic: disable rules by comment [SOLVED]
Replies: 27
Views: 1563

Re: disable rules by comment [SOLVED]

I know you'd do the same for me. :wink:
by ADahi
Sun Sep 09, 2018 6:44 am
Forum: Scripting
Topic: disable rules by comment [SOLVED]
Replies: 27
Views: 1563

Re: disable rules by comment [SOLVED]

you welcome :do {/ppp secret :local LIST "reminder"; :foreach ix in=[find where comment="0"] do={ :local sNAME [get $ix name]; :if ([/ppp active find where name=$sNAME]!="") do={ :local IPadd [/ppp active get number=[find where name=$sNAME] address]; :do {/ip firewall address-list remove numbers=[fi...
by ADahi
Sun Sep 09, 2018 5:27 am
Forum: Scripting
Topic: disable rules by comment [SOLVED]
Replies: 27
Views: 1563

Re: disable rules by comment [SOLVED]

@runbound
You are going to make things complicated, I recommend you use RADIUS
by ADahi
Sat Sep 08, 2018 7:43 pm
Forum: Scripting
Topic: disable rules by comment [SOLVED]
Replies: 27
Views: 1563

Re: disable rules by comment [SOLVED]

why not, explain your project in detail
by ADahi
Sat Sep 08, 2018 6:22 pm
Forum: Scripting
Topic: disable rules by comment [SOLVED]
Replies: 27
Views: 1563

Re: disable rules by comment [SOLVED]

@runbound
updated check it again
by ADahi
Sat Sep 08, 2018 11:19 am
Forum: Scripting
Topic: disable rules by comment [SOLVED]
Replies: 27
Views: 1563

Re: disable rules by comment [SOLVED]

No I am not
I'm looking for PHP web designer
by ADahi
Sat Sep 08, 2018 11:17 am
Forum: Scripting
Topic: disable rules by comment [SOLVED]
Replies: 27
Views: 1563

Re: disable rules by comment [SOLVED]

Updated working :do {/ppp secret :local LIST "reminder"; :foreach ix in=[find where comment="0"] do={ :local sNAME [get $ix name]; :if ([/ppp active find where name=$sNAME]!="") do={ :local IPadd [/ppp active get number=[find where name=$sNAME] address]; :do {/ip firewall address-list add list=$LIST...
by ADahi
Fri Sep 07, 2018 8:36 pm
Forum: Scripting
Topic: disable rules by comment [SOLVED]
Replies: 27
Views: 1563

Re: disable rules by comment [SOLVED]

@Jotne
are you PHP web designer?
by ADahi
Fri Sep 07, 2018 7:18 pm
Forum: Scripting
Topic: disable rules by comment [SOLVED]
Replies: 27
Views: 1563

Re: disable rules by comment [SOLVED]

try with
by ADahi
Fri Sep 07, 2018 6:28 pm
Forum: Scripting
Topic: disable rules by comment [SOLVED]
Replies: 27
Views: 1563

Re: disable rules by comment [SOLVED]

updated, check it
by ADahi
Fri Sep 07, 2018 6:22 pm
Forum: Scripting
Topic: disable rules by comment [SOLVED]
Replies: 27
Views: 1563

Re: disable rules by comment [SOLVED]

okay wait i will fix it
by ADahi
Fri Sep 07, 2018 6:14 pm
Forum: Scripting
Topic: disable rules by comment [SOLVED]
Replies: 27
Views: 1563

Re: disable rules by comment [SOLVED]

Well, what was your question?
by ADahi
Fri Sep 07, 2018 4:15 pm
Forum: Scripting
Topic: wpa to wpa2 clone
Replies: 3
Views: 446

Re: wpa to wpa2 clone

script for run one time only, do not schedule :do {/interface wireless security-profiles set default wpa2-pre-shared-key=[get default wpa-pre-shared-key]; set default authentication-types=wpa-psk,wpa2-psk unicast-ciphers=aes-ccm group-ciphers=aes-ccm } on-error={:log error message="operation failed....
by ADahi
Fri Sep 07, 2018 11:06 am
Forum: RouterBOARD hardware
Topic: RB4011
Replies: 359
Views: 66072

Re: RB4011

does Realtek RTL8367 manageable switch and support acl?
by ADahi
Fri Sep 07, 2018 9:39 am
Forum: Scripting
Topic: Script to compare RX-Rate? [SOLVED]
Replies: 14
Views: 1057

Re: Script to compare RX-Rate? [SOLVED]

No need to quote each others post. Makes it hard to read the thread.
Use Post Reply button at the bottom of the post.
If you need to quote, quote just the part that you need to explain.
post updated, you're right
thanks :)
by ADahi
Fri Sep 07, 2018 9:35 am
Forum: Scripting
Topic: disable rules by comment [SOLVED]
Replies: 27
Views: 1563

Re: disable rules by comment [SOLVED]

:do {/ppp secret :foreach ix in=[find where (comment>"0" && comment<"721")] do={ :local sNAME [get $ix name]; disable $ix; :log warning message=("The user: " . $sNAME . " has Temporary Disconnected!"); :do {/ppp active remove numbers=[find where name=$sNAME] } on-error={:log error message=("Disconn...
by ADahi
Fri Sep 07, 2018 7:40 am
Forum: Scripting
Topic: Script to compare RX-Rate? [SOLVED]
Replies: 14
Views: 1057

Re: Script to compare RX-Rate? [SOLVED]

thank you very much really!!
I know you'd do the same for me. :wink:
by ADahi
Fri Sep 07, 2018 1:34 am
Forum: Scripting
Topic: Script to compare RX-Rate? [SOLVED]
Replies: 14
Views: 1057

Re: Script to compare RX-Rate? [SOLVED]

Can work like this? :do { :foreach WR in=[/interface wireless registration-table find] do={ :local R [/interface wireless registration-table get $WR rx-rate]; :local X [:pick $R 0 [:find $R "M"]] :if ($X < "20") do={ :log warning message=("Found rx-rate=" . $X . "Mbps"); /interface wireless disable...
by ADahi
Fri Sep 07, 2018 12:08 am
Forum: Scripting
Topic: Traccar GPS http post advice
Replies: 11
Views: 1683

Re: Traccar GPS http post advice

I do not have GPS, but i tried to write one, may help you :do { :local latitude ([/system gps monitor as-value once]->"latitude"); :local longitude ([/system gps monitor as-value once]->"longitude"); :do {/tool fetch keep-result=no url=("http://demo.traccar.org:5055/\?id=123456&lat=" . $latitude . "...
by ADahi
Thu Sep 06, 2018 11:48 pm
Forum: Scripting
Topic: Backup scripts
Replies: 3
Views: 570

Re: Backup scripts

:do { :local IDENTITY [/system identity get name]; :local MODEL [/system resource get board-name]; :local OSVERSION [/system resource get version]; :local array {""; "jan"; "feb"; "mar"; "apr"; "may"; "jun"; "jul"; "aug"; "sep"; "oct"; "nov"; "dec"} :local DATE [/system clock get date]; :local day ...
by ADahi
Thu Sep 06, 2018 9:19 pm
Forum: Beginner Basics
Topic: Facing problem in Hotspot
Replies: 2
Views: 243

Re: Facing problem in Hotspot

WDS bridge will fix your issues
by ADahi
Thu Sep 06, 2018 8:12 pm
Forum: Scripting
Topic: Bandwidth test daily
Replies: 9
Views: 2841

Re: Bandwidth test daily

first temp script modify it as you need :do {/tool :local avrTX 0; :local avrRX 0; :local luser ""; :local lpass ""; :local Addr ""; bandwidth-test duration=60s user=$luser password=$lpass protocol=tcp address=$Addr direction=both do={ :if ($status="done testing") do={ :set $avrTX ("tx-total-average...
by ADahi
Thu Sep 06, 2018 6:01 pm
Forum: Scripting
Topic: Gett MAC addresses of MOBILE Devices from DHCP Lease
Replies: 8
Views: 3242

Re: Gett MAC addresses of MOBILE Devices from DHCP Lease

HI Oxygeno20, Can you help me out on this script? It is not running on v6.42.7 :local SERVER “server250”; :local INTERFACEFILTER “combo1-core-switch”;   # # AUTOR: NICOLAS DAITSCH # # www.tech-nico.com # # Modified by Oseni Abiola   :foreach i in=[/ip dhcp-server lease find dynamic=yes active-serve...
by ADahi
Thu Sep 06, 2018 12:42 pm
Forum: Scripting
Topic: Script to compare RX-Rate? [SOLVED]
Replies: 14
Views: 1057

Re: Script to compare RX-Rate? [SOLVED]

punch Accept this answer ✔ :wink: :do { :foreach WR in=[/interface wireless registration-table find] do={ :local R [/interface wireless registration-table get $WR rx-rate]; :local X [:pick $R 0 [:find $R "M"]] :if ($X < "20") do={ :log warning message=("Found rx-rate=" . $X . "Mbps"); # # your custo...
by ADahi
Thu Sep 06, 2018 12:07 am
Forum: Scripting
Topic: PTP Link wireless monitor
Replies: 11
Views: 761

Re: PTP Link wireless monitor

For PtP and PtMP :do { :if ( ([/interface wireless monitor wlan1 as-value once]->"registered-clients")!=0 ) do={:quit;} :log info "No Wireless Registration Wait 1 - 10 mins"; :delay 600s; :if ( ([/interface wireless monitor wlan1 as-value once]->"registered-clients")!=0 ) do={:log info "10Min Check ...
by ADahi
Wed Sep 05, 2018 11:57 pm
Forum: Scripting
Topic: PTP Link wireless monitor
Replies: 11
Views: 761

Re: PTP Link wireless monitor

next post
by ADahi
Wed Sep 05, 2018 5:14 am
Forum: Beginner Basics
Topic: How to bridge 2 bridges ?
Replies: 8
Views: 1902

Re: How to bridge 2 bridges ?

turn off hardware offloading, then you can filter the traffic
by ADahi
Wed Sep 05, 2018 4:57 am
Forum: Scripting
Topic: PTP Link wireless monitor
Replies: 11
Views: 761

Re: PTP Link wireless monitor

off course will not work with AP, it is for station you have to change if condition, as you suggested :if ( ([/interface wireless monitor wlan1 as-value once]->"registered-clients")!=0 ) do you want schedule reboot for AP?, if so i think not good idea can you export configuration here?, may be we ca...
by ADahi
Tue Sep 04, 2018 9:16 pm
Forum: Scripting
Topic: PTP Link wireless monitor
Replies: 11
Views: 761

Re: PTP Link wireless monitor

As I have already have netwatch checking PTP IP address's and will alert when an IP address is down,the purpose of this script is to solve by rebooting what I call partial router lockup resulting in loss of wireless registration of a PTP and if it works without any unforeseen issues I may use it on...
by ADahi
Tue Sep 04, 2018 8:17 pm
Forum: Scripting
Topic: PTP Link wireless monitor
Replies: 11
Views: 761

Re: PTP Link wireless monitor

I'm happy to help you, and without schedule extra script, I putted the Email warning script inside main script, edit it as you need. :do { :if ( ([/interface wireless monitor wlan1 as-value once]->"status")="connected-to-ess" ) do={:quit;} :log info "No Wireless Registration Wait 1 - 5 mins"; :delay...
by ADahi
Tue Sep 04, 2018 5:29 am
Forum: Scripting
Topic: Script to compare RX-Rate? [SOLVED]
Replies: 14
Views: 1057

Re: Script to compare RX-Rate? [SOLVED]

hi
I can help you, but explain more detail, what you want to do
now you got RX of each station
:do {
:foreach WR in=[/interface wireless registration-table find] do={
 :log info [/interface wireless registration-table get $WR rx-rate]
 }
} on-error={}
now, what next?
by ADahi
Mon Sep 03, 2018 4:55 pm
Forum: Scripting
Topic: Does find command distinguish small and capital letters [SOLVED]
Replies: 8
Views: 564

Re: Does find command distinguish small and capital letters [SOLVED]

for delete "unknown" interface from list use
/interface list member remove numbers=[ find where list=test && interface~("^\\*[A-Z]+") ]
by ADahi
Mon Sep 03, 2018 2:14 pm
Forum: Beginner Basics
Topic: How to hide web interface of router from internet?
Replies: 11
Views: 773

Re: How to hide web interface of router from internet?

you can use firewall and you have to block public access to the router
by ADahi
Mon Sep 03, 2018 2:04 pm
Forum: Scripting
Topic: Does find command distinguish small and capital letters [SOLVED]
Replies: 8
Views: 564

Re: Does find command distinguish small and capital letters [SOLVED]

this mean interface deleted and shown as unknown interface
by ADahi
Mon Sep 03, 2018 11:15 am
Forum: General
Topic: Switch Chip on CRS106-1C-5S
Replies: 19
Views: 1585

Re: Switch Chip on CRS106-1C-5S

i have crs125 and working with bugfix version with no issues
by ADahi
Mon Sep 03, 2018 11:13 am
Forum: Scripting
Topic: Does find command distinguish small and capital letters [SOLVED]
Replies: 8
Views: 564

Re: Does find command distinguish small and capital letters [SOLVED]

my router output 6.40.9 bugfix /interface list member print Flags: X - disabled, D - dynamic # LIST INTERFACE 0 test ether3 1 test ether4 2 test ether5
by ADahi
Mon Sep 03, 2018 11:09 am
Forum: Scripting
Topic: script for find similar domains in dns cache
Replies: 3
Views: 509

Re: script for find similar domains in dns cache

thank you sir
working well
you welcome :wink:
by ADahi
Sun Sep 02, 2018 2:24 pm
Forum: RouterBOARD hardware
Topic: RB 3011
Replies: 5
Views: 621

Re: RB 3011

why not
by ADahi
Sun Sep 02, 2018 2:12 pm
Forum: Scripting
Topic: PTP Link wireless monitor
Replies: 11
Views: 761

Re: PTP Link wireless monitor

sure this can help you :do { :if ( ([/interface wireless monitor wlan1 as-value once]->"status")="connected-to-ess" ) do={:log info "Wireless Registration Restored";:quit;} :log info "No Wireless Registration"; :delay 300s; :if ( ([/interface wireless monitor wlan1 as-value once]->"status")="connect...
by ADahi
Sun Sep 02, 2018 11:41 am
Forum: Scripting
Topic: script for find similar domains in dns cache
Replies: 3
Views: 509

Re: script for find similar domains in dns cache

you welcome simple, easy and efficient :do { :local LIST "instagram"; :local DOMAIN "instagram.com"; :foreach Crec in=[/ip dns cache all find where ( ( (type="A") || (type="CNAME") ) && (static=no) && (name~$DOMAIN) )] do={ :local Cname [/ip dns cache get number=$Crec name]; :local Cdata ""; :delay ...
by ADahi
Sat Sep 01, 2018 3:46 pm
Forum: Scripting
Topic: Does find command distinguish small and capital letters [SOLVED]
Replies: 8
Views: 564

Re: Does find command distinguish small and capital letters [SOLVED]

Do not confuse Interface name with Interface id
by ADahi
Sat Sep 01, 2018 3:40 pm
Forum: Scripting
Topic: In /ppp profile on-up script the $interface variable is with small letters [SOLVED]
Replies: 3
Views: 844

Re: In /ppp profile on-up script the $interface variable is with small letters [SOLVED]

it's not a bug
$interface : will gives youe id of interface not the name of interface
if you want get interface name?, use this below
[/interface get $interface name];
by ADahi
Sat Sep 01, 2018 1:10 pm
Forum: General
Topic: DNS Service stops responding
Replies: 5
Views: 563

Re: DNS Service stops responding

I'm running v6.42.6 on a CCR1009-8G-1S-1S+ at a large event. Today under reasonable load (10k pps / 1Gbps WAN routing for ~1k users on ~20 vlans) i've experienced the Mikrotik DNS service stop responding to requests. Clearing the cache, or changing the upstream DNS IP's (or possibly even just click...
by ADahi
Sat Sep 01, 2018 10:01 am
Forum: General
Topic: Load Balance/Dual WAN (PPPoE Dial out) + PPPoE Server HELP
Replies: 37
Views: 2865

Re: Load Balance/Dual WAN (PPPoE Dial out) + PPPoE Server HELP

even though your PPPoE server is connected to LAN, traffic from your PPPoE customers won't match the mangle in-interface=LAN

Instead use in-interface=all-ppp but watchout as your uplinks are also PPPoE...


better idea use
in-interface=all-ppp + src-address=customersIP/24
by ADahi
Fri Aug 31, 2018 6:33 pm
Forum: General
Topic: Switch Chip on CRS106-1C-5S
Replies: 19
Views: 1585

Re: Switch Chip on CRS106-1C-5S

i guess the reason you specified "hw=no" for interface=combo-TP-LinkSwitch if hw=no : switching configuration don bye CPU, bridge->vlan if hw=yes : switching configuration don bye Switch Chip, switch->vlan put different PVID for each port and do not forgot "sa-learning=yes" in [/interface ethernet s...
by ADahi
Fri Aug 31, 2018 6:15 pm
Forum: General
Topic: Switch Chip on CRS106-1C-5S
Replies: 19
Views: 1585

Re: Switch Chip on CRS106-1C-5S

The last step in the guide is to add: /interface ethernet switch set drop-if-invalid-or-src-port-not-member-of-vlan-on-ports= https://wiki.mikrotik.com/wiki/Manual:CRS1xx/2xx_series_switches_examples#Management_IP_Configuration I don't see that in your config. this is same /interface ethernet switc...
by ADahi
Fri Aug 31, 2018 5:59 pm
Forum: Beginner Basics
Topic: Locked Out of Mikrotik
Replies: 29
Views: 3220

Re: Locked Out of Mikrotik

Hey amte I managed to achieve the same thing but in a different way. Still I couldn't connect to the router via web or winbox including winbox mac so a the end I just made a reset of the device. I guess it'll be a bit paintful if you have a lot of settings but it's always an option. Making a reset ...
by ADahi
Fri Aug 31, 2018 1:57 pm
Forum: Scripting
Topic: Finding WAN interface name
Replies: 3
Views: 591

Re: Finding WAN interface name

:D Do not struggling with RouterOS command line. :D
:put ([/ip route check 8.8.8.8 as-value once]->"interface")
best regards
by ADahi
Fri Aug 31, 2018 10:20 am
Forum: Beginner Basics
Topic: Locked Out of Mikrotik
Replies: 29
Views: 3220

Re: Locked Out of Mikrotik

not sure if this can help
https://mikrotik.com/product/woobm
Image
by ADahi
Fri Aug 31, 2018 1:52 am
Forum: Scripting
Topic: Finding WAN interface name
Replies: 3
Views: 591

Re: Finding WAN interface name

does this help you?
:put [/ip arp get number=[find where address=[/ip route get number=[find where dst-address="0.0.0.0/0" && active=yes ] gateway]] interface]
by ADahi
Thu Aug 30, 2018 3:26 pm
Forum: Scripting
Topic: Exit script if...
Replies: 4
Views: 1141

Re: Exit script if...

Hi! I am looking for a solution to abort a script if a variable is empty. :if ([:len $net1] = 0) do={ exit } ...rest of the script should not be executed if $net1 empty This does not work. Can you give me a hint on how to solve this? Thank you Stril try reverse condition :if ([:len $net1]!=0) do={ ...
by ADahi
Thu Aug 30, 2018 2:49 pm
Forum: Beginner Basics
Topic: Locked Out of Mikrotik
Replies: 29
Views: 3220

Re: Locked Out of Mikrotik

try mac-telnet from other connected routerboard
by ADahi
Thu Aug 30, 2018 2:44 pm
Forum: Scripting
Topic: DHCP to DNS in 16-line script [SOLVED]
Replies: 0
Views: 473

DHCP to DNS in 16-line script [SOLVED]

This is simple and efficient script for registering FQDN=(host-name.domain) with TTL=10m working 100% RouterOS 6.40.9 bugfix :do { :if ($leaseBound=1) do={ :local HostName [/ip dhcp-server lease get number=[find where mac-address=$leaseActMAC] host-name]; if ([:len $HostName]=0) do={:log error messa...
by ADahi
Sat Aug 25, 2018 3:49 pm
Forum: Scripting
Topic: Disable/Enable firewall rule based on ping result
Replies: 2
Views: 485

Re: Disable/Enable firewall rule based on ping result

use netwatch instead
simple and easier
by ADahi
Sat Aug 18, 2018 4:12 pm
Forum: Scripting
Topic: script stop on error
Replies: 6
Views: 2224

Re: script stop on error

the problem is inside "IPblacklist1.rsc" can not add exist you have 2 solution remove all address list of "IPblacklist1" before import rsc file or you have to edit every line in rsc file like this example :do {/ip firewall address-list :do {add address=18.208.0.0/13 list=AWS comment="AWS-AMAZON"} on...
by ADahi
Thu Jul 26, 2018 9:24 am
Forum: General
Topic: GRE Tunnel Behind with one router behind NAT
Replies: 2
Views: 1064

Re: GRE Tunnel Behind with one router behind NAT

you have to use VPN PPTP is based on GRE+TCP
by ADahi
Thu Jul 26, 2018 9:18 am
Forum: General
Topic: CRS1025 sudden locks down
Replies: 2
Views: 285

Re: CRS1025 sudden locks down

CRS is a switch, is not a router
go with RB or CCR versions
by ADahi
Wed Jul 25, 2018 10:40 pm
Forum: Scripting
Topic: Problem running script(s) [SOLVED]
Replies: 6
Views: 717

Re: Problem running script(s) [SOLVED]

Tried using local instead of global? Not ":global getDateTime" but ":local getDateTime"? If you have few scripts and they all have this function - they overwrite it and maybe it's causing the problem if they are doing it in the same time? +1 Try :do { :local getDateTime do={ :local thisdate [/syste...
by ADahi
Wed Jul 25, 2018 8:04 pm
Forum: General
Topic: Trunk port and VLAN translation [SOLVED]
Replies: 18
Views: 2739

Re: Trunk port and VLAN translation [SOLVED]

Hi everybody, I want to achieve a VLAN translation with RB951. Here is the actual scenario: Same subnet for every computer and network device (192.168.0.0/22). One router connected to internet, provided by the ISP which doesn´t allow trunk ports on it´s LAN ports, and can´t translate any type of VL...
by ADahi
Wed Jul 25, 2018 7:52 pm
Forum: General
Topic: Calling all Mikrotik Switch experts
Replies: 7
Views: 694

Re: Calling all Mikrotik Switch experts

Hi, I am in the market for a Mikrotik switch, but have no experience with the different types / series of Mikrotk switches available, and would like know which series (CRS1xx, CRS2xx, CRS3xx, CSxxx, etc) you prefer and why, what are the problems / concerns out there regarding Mikrotik switches, etc...
by ADahi
Wed Jul 25, 2018 5:41 pm
Forum: Scripting
Topic: Force Netwatch thru WAN1?
Replies: 2
Views: 491

Re: Force Netwatch thru WAN1?

explain your plan more
fail-over based on ping or check gateway or what?
by ADahi
Wed Jul 25, 2018 5:25 pm
Forum: Scripting
Topic: Problem with route remove
Replies: 2
Views: 367

Re: Problem with route remove

yes dst-address should be in CIDR form
/ip route remove numbers=[find where dst-address="4.2.2.2/32"]
by ADahi
Wed Jul 25, 2018 5:21 pm
Forum: Scripting
Topic: using result of a script in another script
Replies: 1
Views: 340

Re: using result of a script in another script

use :global instead of :local
by ADahi
Sun Jun 24, 2018 9:07 pm
Forum: Scripting
Topic: Check enabled rule or not
Replies: 2
Views: 372

Re: Check enabled rule or not

X flag mean disabled=yes ex: [-@MikroTik] > /ip address print Flags: X - disabled, I - invalid, D - dynamic # ADDRESS NETWORK INTERFACE 0 192.168.89.1/24 192.168.89.0 wlan1 1 172.26.0.4/24 172.26.0.0 ether2 2 D 10.8.86.194/32 10.0.0.1 pppoe-out1 3 D 192.168.255.248/32 100.101.0.2 pptp-out1 [-@MikroT...
by ADahi
Fri Jun 01, 2018 10:16 pm
Forum: Scripting
Topic: SCRIPT TO RESET-COUNTERS OF SPECIFIC USERS
Replies: 6
Views: 869

Re: SCRIPT TO RESET-COUNTERS OF SPECIFIC USERS

contact mikrotik support
by ADahi
Mon May 28, 2018 9:29 pm
Forum: Scripting
Topic: SCRIPT TO RESET-COUNTERS OF SPECIFIC USERS
Replies: 6
Views: 869

Re: SCRIPT TO RESET-COUNTERS OF SPECIFIC USERS

Ok. Tried your code but it still gives me the same error. Is it a problem of the version of Mikrotik OS i am using, or a problem related to the number of users in that query script returned. The total number of users in my database is 29,000. Can that be the problem??? maybe version or maybe the sp...
by ADahi
Mon May 28, 2018 6:40 pm
Forum: Scripting
Topic: SCRIPT TO RESET-COUNTERS OF SPECIFIC USERS
Replies: 6
Views: 869

Re: SCRIPT TO RESET-COUNTERS OF SPECIFIC USERS

RouterOS v6.40.8 Bugfix
/tool user-manager user reset-counters numbers=[find where actual-profile="xyz"]
working 100%
by ADahi
Sat May 12, 2018 7:25 pm
Forum: Scripting
Topic: Logical operator "not in"
Replies: 5
Views: 618

Re: Logical operator "not in"

203.0.113.0/27 = {203.0.113.0 - 203.0.113.31} so range begin 203.0.113.32 to 203.0.113.254 /ppp active print count-only where address~( "203\\.0\\.113\\.(3[2-9]|[4-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-4]))" ) use this link may help you about IP regular expression http://www.analyticsmarket.com/fre...
by ADahi
Sat Apr 21, 2018 10:43 pm
Forum: Scripting
Topic: PPP profile script to enable multiple instances of one user only.
Replies: 2
Views: 548

Re: PPP profile script to enable multiple instances of one user only.

make special profile for special user only
no need for scripts
by ADahi
Mon Apr 16, 2018 7:07 pm
Forum: Scripting
Topic: Remove "unknown" interface
Replies: 5
Views: 3176

Re: Remove "unknown" interface

/interface wireless access-list remove numbers=[find where !interface]
try it
may help you
by ADahi
Mon Apr 16, 2018 1:17 pm
Forum: Scripting
Topic: on hotspot connect event (not on login)
Replies: 4
Views: 666

Re: on hotspot connect event (not on login)

/ip dhcp-server set 0 lease-script=script1
by ADahi
Wed Apr 11, 2018 5:56 pm
Forum: Scripting
Topic: on hotspot connect event (not on login)
Replies: 4
Views: 666

Re: on hotspot connect event (not on login)

whynot
by ADahi
Tue Apr 10, 2018 10:08 am
Forum: Wireless Networking
Topic: Mikrotik PTP bridge Queue Types
Replies: 2
Views: 305

Re: Mikrotik PTP bridge Queue Types

only-hardware-queue
by ADahi
Tue Apr 10, 2018 9:54 am
Forum: Scripting
Topic: Hotspot Script Match Assistance
Replies: 3
Views: 511

Re: Hotspot Script Match Assistance

:foreach item in=[/queue simple find where (name~"hotspot" && target~"1\\.1\\.1\\.[0-9]+"=false)] do={/queue simple remove $item}
by ADahi
Mon Apr 09, 2018 11:24 pm
Forum: The User Manager
Topic: Add profile to user via Console/API/Script
Replies: 29
Views: 23702

Re: Great! it works, thanks millions

Great! it works, thanks millions you can get sequence number of the user /tool user-manager user print Flags: X - disabled, A - active, I - incomplete 0 customer=admin username="111" password="" shared-users=1 wireless-psk="" wireless-enc-key="" wireless-enc-algo=none last-seen=never and use it lik...
by ADahi
Mon Apr 09, 2018 11:22 pm
Forum: The User Manager
Topic: Mikrotik router board as external user manager
Replies: 5
Views: 1172

Re: Mikrotik router board as external user manager

better look for RB1100AHx4. there is ssd inside so you can store your user manager there.
RB1100AHx2 is an old model but of course it also working great.
I agree with you
thanks
by ADahi
Mon Apr 09, 2018 2:20 pm
Forum: The User Manager
Topic: Add profile to user via Console/API/Script
Replies: 29
Views: 23702

Re: Add profile to user via Console/API/Script

you can get sequence number of the user /tool user-manager user print Flags: X - disabled, A - active, I - incomplete 0 customer=admin username="111" password="" shared-users=1 wireless-psk="" wireless-enc-key="" wireless-enc-algo=none last-seen=never and use it like: /tool user-manager user create-...
by ADahi
Fri Apr 06, 2018 11:38 am
Forum: Scripting
Topic: Api script add from file
Replies: 3
Views: 486

Re: Api script add from file

via CLI:
/system script add name=test source=[/file get run.txt contents];
by ADahi
Fri Apr 06, 2018 11:30 am
Forum: Scripting
Topic: Hotspot Script Match Assistance
Replies: 3
Views: 511

Re: Hotspot Script Match Assistance

:foreach item in=[/queue simple find where (name~"hotspot" && target!="1.1.1.0/24")] do={/queue simple remove $item}
by ADahi
Thu Apr 05, 2018 6:57 pm
Forum: The User Manager
Topic: Mikrotik router board as external user manager
Replies: 5
Views: 1172

Re: Mikrotik router board as external user manager

Level 6 license device you have to look for it
ex: rb1100AHx2 or CCR
by ADahi
Wed Apr 04, 2018 1:46 pm
Forum: Scripting
Topic: help me with schedule script
Replies: 1
Views: 478

Re: help me with schedule script

/system scheduler add interval=1d name=enable on-event="/tool netwatch enable numbers=[find where host=\"192.168.2.10\"]" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \ start-date=apr/04/2018 start-time=20:00:00 add interval=1d name=disable on-event="/tool netwatch disabl...
by ADahi
Tue Mar 27, 2018 1:19 pm
Forum: Scripting
Topic: sript to remove total bytes limit hotspot user
Replies: 4
Views: 701

Re: sript to remove total bytes limit hotspot user

if you mean disable rate limit of user profiles, use this script:
:foreach UPro in=[/ip hotspot user profile find] do={
 /ip hotspot user profile set $UPro rate-limit="";
}
by ADahi
Tue Mar 27, 2018 12:48 am
Forum: The Dude
Topic: Feature Request [Batch Update/ Batch Script]
Replies: 3
Views: 1170

Re: Feature Request [Batch Update/ Batch Script]

I'm using this script, may help you # Firmware Update ### :do { :local Arch [/system resource get value-name=architecture-name]; :local Cver [/system resource get value-name=version]; :local Aver "6.40.6 (bugfix)"; :local Hver [:pick $Cver 2 4]; :local Lver [:pick $Cver 5 6]; :local Nver [:pick $Ave...
by ADahi
Tue Mar 27, 2018 12:39 am
Forum: Scripting
Topic: accepted "!" interface in filter by script
Replies: 1
Views: 589

accepted "!" interface in filter by script

wrong code { :local Enet [/interface ethernet get number=[ find default-name=ether1 ] value-name=name]; /interface bridge filter add action=drop chain=forward in-interface=!$Enet out-interface=!$Enet; } correct code { :local Enet ("!".[/interface ethernet get number=[ find default-name=ether1 ] valu...
by ADahi
Sat Mar 24, 2018 9:36 pm
Forum: Scripting
Topic: Find MAC adress in DHCP server and play sound
Replies: 2
Views: 429

Re: Find MAC adress in DHCP server and play sound

like this?
:if ([/ip dhcp-server lease find where mac-address="11:22:33:44:55:66"]!="") do={beep frequency=4000 length=1s;}
by ADahi
Sat Mar 24, 2018 9:25 pm
Forum: The User Manager
Topic: How to script delele user expire in usermanager
Replies: 18
Views: 6606

Re: How to script delele user expire in usermanager

did you specify validity of profile?
by ADahi
Thu Mar 22, 2018 10:54 pm
Forum: The User Manager
Topic: How to script delele user expire in usermanager
Replies: 18
Views: 6606

Re: How to script delele user expire in usermanager

Now the only thing I have left to solve, are the users who open a voucher but leave before their time / quote, could you help me with that case? thank you very much.

how do you know user left before their time / quote ?
by ADahi
Thu Mar 22, 2018 12:26 am
Forum: The User Manager
Topic: How to script delele user expire in usermanager
Replies: 18
Views: 6606

Re: How to script delele user expire in usermanager

Adahi, the issue of user expired, either time or mb quota, I have to configure it in the "profile" of the USER MANAGER, is this correct? or do I have to do it in ip> hotspot?

thanks again.
yes user manager
by ADahi
Tue Mar 20, 2018 10:51 pm
Forum: The User Manager
Topic: How to script delele user expire in usermanager
Replies: 18
Views: 6606

Re: How to script delele user expire in usermanager

script only remove expired users
expire-user = (user/pass without active profile)
profile expire depend on period of time (ex: 1d) or quota (100MB) or both
by ADahi
Tue Mar 20, 2018 7:42 pm
Forum: The User Manager
Topic: How to script delele user expire in usermanager
Replies: 18
Views: 6606

Re: How to script delele user expire in usermanager

use this with profile scripts #Remove expired users { :foreach ExpireUser in=[/tool user-manager user find where !actual-profile] do={ /tool user-manager user remove $ExpireUser; } } ******************* Hi Adahi, first of all, I appreciate your time. I tested the scipt, and it worked fine but only ...
by ADahi
Mon Mar 19, 2018 11:46 pm
Forum: Scripting
Topic: DNS Cache to Static Move Script
Replies: 2
Views: 617

Re: DNS Cache to Static Move Script

more likely, one day, it will cause you hard to debug problems!
readers are warned - only use when you know what you are breaking...
yes i mean for debug purpose only, that's why i said one day not every day
thanks guru :D
by ADahi
Mon Mar 19, 2018 9:18 pm
Forum: Scripting
Topic: DNS Cache to Static Move Script
Replies: 2
Views: 617

DNS Cache to Static Move Script

one day, may help you :wink: # DNS Cashe To Static Moving Script # Rename script to "DNS-CTS" # Moving all alias of host. { :if ([:len [/system script job find script="DNS-CTS"]]!=1) do={:log warning "DNS-CTS in processing...";} else={ :local CFlush false; :foreach Crec in=[/ip dns cache all find wh...
by ADahi
Mon Mar 19, 2018 8:26 pm
Forum: The User Manager
Topic: How to script delele user expire in usermanager
Replies: 18
Views: 6606

Re: How to script delele user expire in usermanager

use this with profile scripts
#Remove expired users 
{ 
:foreach ExpireUser in=[/tool user-manager user find where !actual-profile] do={ 
     /tool user-manager user remove $ExpireUser; 
	} 
} 
by ADahi
Fri Jan 12, 2018 9:18 pm
Forum: Beginner Basics
Topic: CRS125-24G-1S-RM Fios Gigabit WAN
Replies: 2
Views: 318

Re: CRS125-24G-1S-RM Fios Gigabit WAN

"CRS125-24G-1S-RM" is powerful switch but simple router
by ADahi
Fri Jan 12, 2018 8:58 pm
Forum: Scripting
Topic: sript to remove total bytes limit hotspot user
Replies: 4
Views: 701

Re: sript to remove total bytes limit hotspot user

if you wan reset all counters of all users use
/ip hotspot user reset-counters [find] 

if you want cancel limit bytes in/out/total of all users use
/ip hotspot user set [find] limit-bytes-in=0 limit-bytes-out=0 limit-bytes-total=0;
by ADahi
Fri Jan 12, 2018 2:54 pm
Forum: Scripting
Topic: i want Script schedule in queue
Replies: 3
Views: 375

Re: i want Script schedule in queue

Like this?
{ 
:local CIP 3.3.3.3
/queue simple set numbers=[find where target=($CIP . "/32")] max-limit=256K/1M comment="0"; 
} 
by ADahi
Wed Jan 10, 2018 12:55 pm
Forum: The User Manager
Topic: AD radius server user activity log for hotspot
Replies: 13
Views: 1363

Re: AD radius server user activity log for hotspot

you can get all logs from "AD radius".
How it possible?
can you explain?

Can I see user Usage & URL and IP History & File Downloaded?
it is belongs to "AD radius" software abilities
by ADahi
Wed Jan 10, 2018 11:58 am
Forum: Scripting
Topic: Child bedtime control - scripts
Replies: 3
Views: 1488

Re: Child bedtime control - scripts

use /ip firewall row, easier
by ADahi
Wed Jan 10, 2018 11:53 am
Forum: RouterBOARD hardware
Topic: New POE hardware for IP Cameras and IP Phones
Replies: 5
Views: 759

Re: New POE hardware for IP Cameras and IP Phones

CRS328-24P-4S+RM

PoE out switch

Dual boot SwOS or RouterOS
24 ports with PoE out function
Supports 802.3af/at output
Per port auto detection of PoE standard
Four SFP+ ports for 10GbE
One 120/220V IEC connector

thumbs up
by ADahi
Wed Jan 10, 2018 11:36 am
Forum: The User Manager
Topic: AD radius server user activity log for hotspot
Replies: 13
Views: 1363

Re: AD radius server user activity log for hotspot

you can get all logs from "AD radius".
by ADahi
Wed Jan 10, 2018 11:31 am
Forum: General
Topic: Simple question - bridges
Replies: 7
Views: 423

Re: Simple question - bridges

yes it should see each other because of using wrong nat rules /ip firewall nat add action=masquerade chain=srcnat src-address=192.168.31.0/24 add action=masquerade chain=srcnat src-address=192.168.30.0/24 You have to specify output interface for each one. /ip firewall nat add action=masquerade chain...
by ADahi
Wed Jan 10, 2018 10:57 am
Forum: General
Topic: How to NAT based on the https site requested
Replies: 10
Views: 974

Re: How to NAT based on the https site requested

I have a couple of servers with IIS and about 3 web sites per server. I would like to make NATs so I can access from outside using only https my internal web sites. Public DNS is set. Do I have to read the Content on NAT Rule > Advanced or there is some other way? wiki https://wiki.mikrotik.com/wik...
by ADahi
Wed Jan 10, 2018 10:24 am
Forum: General
Topic: How to NAT based on the https site requested
Replies: 10
Views: 974

Re: How to NAT based on the https site requested

I have a couple of servers with IIS and about 3 web sites per server. I would like to make NATs so I can access from outside using only https my internal web sites. Public DNS is set. Do I have to read the Content on NAT Rule > Advanced or there is some other way? wiki https://wiki.mikrotik.com/wik...
by ADahi
Wed Jan 10, 2018 10:21 am
Forum: General
Topic: AAA server for Mikrotik Login /
Replies: 5
Views: 578

Re: AAA server for Mikrotik Login /

Can someone guide me how to user userman for RouterOS login ?

Cause i setup but still not working .

Any tutorial link ??

WIKI https://wiki.mikrotik.com/wiki/Manual:User_Manager
youtube https://youtu.be/Geid7ugU_Cs
and you can search related videos
by ADahi
Wed Jan 10, 2018 10:16 am
Forum: General
Topic: AAA server for Mikrotik Login /
Replies: 5
Views: 578

Re: AAA server for Mikrotik Login /

Can i host that Router OS on VM for only userman ?
why not
by ADahi
Tue Jan 09, 2018 9:11 pm
Forum: Scripting
Topic: i want Script schedule in queue
Replies: 3
Views: 375

Re: i want Script schedule in queue

can you explain more detail
by ADahi
Tue Jan 09, 2018 9:06 pm
Forum: General
Topic: Connect RB951G-2HnD
Replies: 2
Views: 249

Re: Connect RB951G-2HnD

yes, Mikrotik support PPPOE client
for detail HowTo https://wiki.mikrotik.com/wiki/Manual:Interface/PPPoE
for short HowTo go with "Quick Set" in winbox
by ADahi
Tue Jan 09, 2018 12:02 pm
Forum: General
Topic: AAA server for Mikrotik Login /
Replies: 5
Views: 578

Re: AAA server for Mikrotik Login /

You can use userman with level 6 RouterOS license.
by ADahi
Mon Jan 08, 2018 6:55 pm
Forum: Beginner Basics
Topic: CRS125, ROS 6.41, VLANs
Replies: 13
Views: 2303

Re: CRS125, ROS 6.41, VLANs

I can help you if you use "master port" firmware
I have same switch, but I didn't upgrade yet, I'm happy with 6.40.4
Best regards
by ADahi
Sun Jan 07, 2018 8:56 pm
Forum: General
Topic: WAN2 doesnt switch to WAN1 (failover)
Replies: 17
Views: 1584

Re: WAN2 doesnt switch to WAN1 (failover)

Today my internet connection is too bad, sorry :cry:
by ADahi
Sun Jan 07, 2018 8:43 pm
Forum: General
Topic: WAN2 doesnt switch to WAN1 (failover)
Replies: 17
Views: 1584

Re: WAN2 doesnt switch to WAN1 (failover)

Hi ADahi, What I need is WAN1 to WAN2 failover and after WAN1 comes back online for all the traffic to move back to WAN1. We tried the distance approach, however, we also have VPN_Client and when traffic moves to WAN2 as WAN1 is disconnected, it creates new connections which don't reset when WAN1 c...
by ADahi
Sun Jan 07, 2018 8:35 pm
Forum: General
Topic: WAN2 doesnt switch to WAN1 (failover)
Replies: 17
Views: 1584

Re: WAN2 doesnt switch to WAN1 (failover)

Hi ADahi, What I need is WAN1 to WAN2 failover and after WAN1 comes back online for all the traffic to move back to WAN1. We tried the distance approach, however, we also have VPN_Client and when traffic moves to WAN2 as WAN1 is disconnected, it creates new connections which don't reset when WAN1 c...
by ADahi
Sun Jan 07, 2018 8:28 pm
Forum: General
Topic: WAN2 doesnt switch to WAN1 (failover)
Replies: 17
Views: 1584

Re: WAN2 doesnt switch to WAN1 (failover)

please can you answer my question do you need wan fail over for vpn tunnel only? if so, remove all default gateway in ip route table and use this only /ip route add check-gateway=ping distance=2 dst-address=<VPN_Server_IP> gateway=<ISP1_Gateway_IP> add check-gateway=ping distance=3 dst-address=<VPN_...
by ADahi
Sun Jan 07, 2018 6:45 pm
Forum: General
Topic: script won't run on scheduler?
Replies: 11
Views: 3931

Re: script won't run on scheduler?

put whole script inside { }
by ADahi
Sun Jan 07, 2018 9:49 am
Forum: Wireless Networking
Topic: is hotspot safe??
Replies: 15
Views: 1165

Re: is hotspot safe??

every things hack-able, every things secure-able :!: - What a useless garbage. I cannot believe somebody real have time to write this! Mikrotik is not safe by default. When I got router and plug it first time, I found it is open to outer network! It was open in a way that anybody from outer Interne...
by ADahi
Sat Jan 06, 2018 6:58 pm
Forum: Wireless Networking
Topic: is hotspot safe??
Replies: 15
Views: 1165

Re: is hotspot safe??

every things hack-able, every things secure-able :!:
by ADahi
Sat Jan 06, 2018 12:09 pm
Forum: Forwarding Protocols
Topic: Cisco to MikroTik command translation - OSPF
Replies: 1
Views: 468

Re: Cisco to MikroTik command translation - OSPF

many thanks
very helpful :D
by ADahi
Thu Jan 04, 2018 7:36 pm
Forum: General
Topic: WAN2 doesnt switch to WAN1 (failover)
Replies: 17
Views: 1584

Re: WAN2 doesnt switch to WAN1 (failover)

Yeah... I did, but it doesn't really work, as I have VPN client and the tunnel get hung up on WAN2.. ready above. I like simple solutions but this is not the case here.


dose vpn client the default gateway after established tunnel ?
by ADahi
Thu Jan 04, 2018 12:16 pm
Forum: General
Topic: WAN2 doesnt switch to WAN1 (failover)
Replies: 17
Views: 1584

Re: WAN2 doesnt switch to WAN1 (failover)

Hello All, My problem is quite basic, yet i'm stuck. Attempted to set up WAN1 to WAN2 failover with automatic switch to WAN1 when back online. I understand that links established on WAN2 are not reset, as when WAN1 goes offline all the links collapse and WAN2 establishes new ones, however, when WAN...
by ADahi
Wed Jan 03, 2018 8:02 pm
Forum: Scripting
Topic: netwatch
Replies: 1
Views: 307

Re: netwatch

{ :if ([/ip route find where (dst-address="0.0.0.0/0" && gateway="192.168.1.1")]="") do={ /ip route add distance=1 dst-address=0.0.0.0/0 gateway=192.168.1.1 disabled=no; /ip route add distance=1 dst-address=0.0.0.0/0 gateway=192.168.1.1 disabled=no routing-mark=rota1; /ip cloud force-update; } }
by ADahi
Wed Jan 03, 2018 5:21 pm
Forum: Wireless Networking
Topic: big mistake [SOLVED]
Replies: 21
Views: 2873

Re: big mistake [SOLVED]

The only mistake you could do is to badly design your network or misconfigure your devices. Maybe you did both errors?
+1
by ADahi
Tue Jan 02, 2018 9:09 pm
Forum: Scripting
Topic: Hostname Shield (hotspot Mac spoof-clone) updated
Replies: 6
Views: 1649

Re: Hostname Shield (hotspot Mac spoof-clone)

uncheck Login by: MAC
may be easier solution
by ADahi
Tue Jan 02, 2018 1:41 pm
Forum: Beginner Basics
Topic: Dynamic IP
Replies: 1
Views: 231

Re: Dynamic IP

I use this with ppp profile # On Up: # configure static src-nat after pppoe-client interface connected { :local InterfaceName "GigaNet-AC"; :local newIP [/ip address get [find interface=$InterfaceName] address]; /ip firewall nat set number=[find out-interface=$InterfaceName] to-addresses="$newIP"; :...
by ADahi
Tue Jan 02, 2018 1:33 pm
Forum: General
Topic: Export log? [SOLVED]
Replies: 5
Views: 3362

Re: Export log? [SOLVED]

/system logging
add action=disk topics=info
by ADahi
Tue Jan 02, 2018 1:18 pm
Forum: Scripting
Topic: editing or deleting users based on a condition
Replies: 1
Views: 226

Re: editing or deleting users based on a condition

i am trying to change the limit bytes total for all users with profile Prof1 { :local Profile_name prof1; :local limitBT 888888888888; :foreach usr in=[/ip hotspot user find where profile=$Profile_name] do={ /ip hotspot user set numbers=$usr limit-bytes-total=$limitBT; } } and also delete all users...
by ADahi
Mon Dec 25, 2017 9:27 pm
Forum: Scripting
Topic: String operations [SOLVED]
Replies: 2
Views: 766

Re: String operations [SOLVED]

sure it is easy :wink:
{ 
:local str "something1%something2"; 
:put [:pick $str ([:find $str "%"]+1) ([:len $str])];   
} 
by ADahi
Sat Dec 23, 2017 10:33 pm
Forum: Scripting
Topic: Writing TX and RX bytes to file for all interfaces [SOLVED]
Replies: 3
Views: 633

Re: Writing TX and RX bytes to file for all interfaces [SOLVED]

check it now { :global time ([/system clock get time]); :global hour [:pick $time 0 2]; :global min [:pick $time 3 5]; :global sec [:pick $time 6 8]; :global stamp ($hour . "_" . $min . "_" . $sec); :global id ([/system identity get name]); :global numports 100; :global name " "; :global rx " "; :gl...
by ADahi
Mon Dec 18, 2017 6:09 pm
Forum: Scripting
Topic: How to "Find" pppoe values and set via if statement [SOLVED]
Replies: 6
Views: 776

Re: How to "Find" pppoe values and set via if statement [SOLVED]

to get distance
[/ip route get number=[find (gateway=pppoe1 && dst-address="0.0.0.0/0") ] distance] 

try
/ip route set gateway=pppoe1 check-gateway=        
arp  ping
may help you
by ADahi
Sun Dec 17, 2017 8:28 pm
Forum: Wireless Networking
Topic: Detect 1Mbps data rate
Replies: 20
Views: 2106

Re: Detect 1Mbps data rate

At present scripts when searching default logs for keywords have a flaw where repetitive emails are sent about the same issue, for example below will be received every 15mins ( script scheduler ) may/09/2017 23:15:00 Router:XXXX_PTP_XXXX Routing Error 16:40:42 new master flag=false may/09/2017 23:3...
by ADahi
Sat Dec 16, 2017 7:46 pm
Forum: Wireless Networking
Topic: Detect 1Mbps data rate
Replies: 20
Views: 2106

Re: Detect 1Mbps data rate

#telegram bot version script { :local Btoken "bot token" :local chatID "-chat id" :local found false; :local Dname [/system identity get name] :local cDT ([/system clock get date] . " " . [/system clock get time]) :local msg ($cDT . "%0AFound 1Mbps in Signal Strengths Table%0ADevice Name: " . $Dnam...
by ADahi
Fri Dec 15, 2017 10:42 pm
Forum: General
Topic: Redirect DNS requests to more than 1 IP
Replies: 6
Views: 1365

Re: Redirect DNS requests to more than 1 IP

this may help you { :local dns1 8.8.8.8 :local dns2 9.9.9.9 /tool netwatch add down-script="/ip firewall nat disable numbers=[find to-addresses=$dns1];\r\ \n/ip firewall nat enable numbers=[find to-addresses=$dns2];" host=$dns1 up-script=\ "/ip firewall nat enable numbers=[find to-addresses=$dns1];\...
by ADahi
Fri Dec 15, 2017 10:21 pm
Forum: General
Topic: Redirect DNS requests to more than 1 IP
Replies: 6
Views: 1365

Re: Redirect DNS requests to more than 1 IP

use anycast DNS service instead ex: 8.8.8.8
by ADahi
Fri Dec 15, 2017 10:10 pm
Forum: Wireless Networking
Topic: Detect 1Mbps data rate
Replies: 20
Views: 2106

Re: Detect 1Mbps data rate

mmm if you accept my advice: it's better and easier to use Telegram bot
it's direct and simple :wink:
[/tool netwatch] telegram bot example on YouTube https://youtu.be/6sVrUJi9_K8
if you accept, I can help you
by ADahi
Fri Dec 15, 2017 9:56 pm
Forum: General
Topic: Redirect DNS requests to more than 1 IP
Replies: 6
Views: 1365

Re: Redirect DNS requests to more than 1 IP

what is the purpose of the 2nd DNS ?
by ADahi
Fri Dec 15, 2017 6:33 pm
Forum: Wireless Networking
Topic: Detect 1Mbps data rate
Replies: 20
Views: 2106

Re: Detect 1Mbps data rate

....
by ADahi
Fri Dec 15, 2017 5:15 pm
Forum: Scripting
Topic: Script to monitor interface bytes
Replies: 4
Views: 1001

Re: Script to monitor interface bytes

{ :global monitorIN1 0; :global monitorIN2 0; :local newin1 0; :local newin2 0; :local usedin1 0; :local usedin2 0; :local totalin1 0; :local totalin2 0; :set newin1 ([/interface get [find name=IN1] rx-byte] + [/interface get [find name=IN1] tx-byte]); :set newin2 ([/interface get [find name=IN2] r...
by ADahi
Fri Dec 15, 2017 5:01 pm
Forum: Scripting
Topic: Script to monitor interface bytes
Replies: 4
Views: 1001

Re: Script to monitor interface bytes

hi all i need script to make a qouta like 20 GB to a name in simple queue monitor upload and download when ritch a limt speed well be change to 128


viewtopic.php?f=9&t=126573#p631249
by ADahi
Fri Dec 15, 2017 11:48 am
Forum: Scripting
Topic: How to "Find" pppoe values and set via if statement [SOLVED]
Replies: 6
Views: 776

Re: How to "Find" pppoe values and set via if statement [SOLVED]

ok, Give me output of
/ip route print detail
or screen shot
by ADahi
Thu Dec 14, 2017 8:18 pm
Forum: General
Topic: Mikrotik /31 Subnet - RFC3021
Replies: 3
Views: 1056

Re: Mikrotik /31 Subnet - RFC3021

Use /32 instead.

thumbs up
by ADahi
Thu Dec 14, 2017 1:19 pm
Forum: Wireless Networking
Topic: Problem with ccq
Replies: 4
Views: 520

Re: Problem with ccq

signal -62 for 250m is low
check the SNR may be low
by ADahi
Thu Dec 14, 2017 1:12 pm
Forum: Scripting
Topic: [Ask]. Modify firewall order or add firewall with script.
Replies: 12
Views: 8675

Re: [Ask]. Modify firewall order or add firewall with script.

This still doesn't work. If you try to change position with move or place-before the script returns no such item or similar error.
Both commands work in winbox, ssh, etc. It's just a problem on running them from scripts.
show us your scripts, maybe we can find where the error :wink:
by ADahi
Thu Dec 14, 2017 1:05 pm
Forum: General
Topic: PoE Schedule On/Off
Replies: 3
Views: 637

Re: PoE Schedule On/Off

sure it is easy
to power it on
/interface ethernet poe set ether10 poe-out=forced-on; 

or use auto on
/interface ethernet poe set ether10 poe-out=auto-on; 

to power it off
/interface ethernet poe set ether10 poe-out=off; 
by ADahi
Thu Dec 14, 2017 9:28 am
Forum: Scripting
Topic: Run Script Randomly
Replies: 2
Views: 555

Re: Run Script Randomly

try this may help you :wink:
this random numbers with range of 0 to 9
{
:local NofScripts 10;
:local S [/system clock get time]; 
:local rand [:pick $S ([:len $S]-2) [:len $S]];
:log warning ("random number = " . $rand % $NofScripts) 
#:do { /system script run number=($rand % $NofScripts) }
}
by ADahi
Thu Dec 14, 2017 8:59 am
Forum: Scripting
Topic: NV2 set cpe queue to 80% of wireless data rate
Replies: 33
Views: 1861

Re: NV2 set cpe queue to 80% of wireless data rate

@hengst
did you use this before?
by ADahi
Thu Dec 14, 2017 8:46 am
Forum: Scripting
Topic: How to "Find" pppoe values and set via if statement [SOLVED]
Replies: 6
Views: 776

Re: How to "Find" pppoe values and set via if statement [SOLVED]

I think you do not need any scripts, no marking, no etc.
Just specify different distance for each default gateway
:wink:
by ADahi
Thu Dec 14, 2017 8:21 am
Forum: Wireless Networking
Topic: Detect 1Mbps data rate
Replies: 20
Views: 2106

Re: Detect 1Mbps data rate

first step: script for check in 1Mbps is listed in Signal Strength Table, then log warning. { global found false; :foreach SS in=[/interface wireless registration-table get 0 strength-at-rates] do={ :local rate [:pick $SS ([:find $SS "@"]+1) ([:find $SS "M"])]; #:log warning $rate; :if ( $rate=1 ) d...
by ADahi
Wed Dec 13, 2017 9:49 pm
Forum: Wireless Networking
Topic: Detect 1Mbps data rate
Replies: 20
Views: 2106

Re: Detect 1Mbps data rate

Hi n21roadie
please can you tell me how "reset then reflash fixes the issue !" in winbox
by ADahi
Wed Dec 13, 2017 8:32 pm
Forum: Scripting
Topic: dns script
Replies: 13
Views: 3356

Re: dns script

how to add scripts to wiki?
by ADahi
Wed Dec 13, 2017 7:45 pm
Forum: Scripting
Topic: NV2 set cpe queue to 80% of wireless data rate
Replies: 33
Views: 1861

Re: NV2 set cpe queue to 80% of wireless data rate

:?: @ ADahi sorry to hijack the topic thread but I am looking for a script to detect when 1Mbps data rates are being used by a CPE and print to a file? really, you are "Forum Guru", I should learn from you are you serious? FYI “Forum Guru” is a user (not staff) who has been helpful to other users? ...
by ADahi
Tue Dec 12, 2017 6:43 pm
Forum: Scripting
Topic: NV2 set cpe queue to 80% of wireless data rate
Replies: 33
Views: 1861

Re: NV2 set cpe queue to 80% of wireless data rate

:?:
@ADahi
sorry to hijack the topic thread but I am looking for a script to detect when 1Mbps data rates are being used by a CPE and print to a file?


really, you are "Forum Guru", I should learn from you
are you serious?
by ADahi
Tue Dec 12, 2017 1:31 pm
Forum: Scripting
Topic: NV2 set cpe queue to 80% of wireless data rate
Replies: 33
Views: 1861

Re: NV2 set cpe queue to 80% of wireless data rate

nice lets try remove all queue and try set only hardware queue
/queue interface
set wlan1 queue=only-hardware-queue 

let me know the results.
many thanks
by ADahi
Tue Dec 12, 2017 8:31 am
Forum: Scripting
Topic: NV2 set cpe queue to 80% of wireless data rate
Replies: 33
Views: 1861

Re: NV2 set cpe queue to 80% of wireless data rate

try this one { :local RX [/interface wireless registration-table get 0 rx-rate ]; :if ([:find $RX "."]>=1 ) do={:set $RX ( [:pick $RX 0 [:find $RX "."]]+1 )} else={:set $RX [:pick $RX 0 [:find $RX "M"]]}; /queue simple set 0 max-limit=((($RX * 8) / 10)."M"); } for logging :log warning ("queue set to...
by ADahi
Sun Dec 10, 2017 8:26 pm
Forum: Scripting
Topic: Mikrotik API - Show hotspot customer information
Replies: 4
Views: 1318

Re: Mikrotik API - Show hotspot customer information

ref: https://wiki.mikrotik.com/wiki/Manual:IP/Hotspot/User on-login: List of available variables: $user $username (alternative var name for $user) $address $"mac-address" $interface on-logout: List of available variables: $user $username (alternative var name for $user) $address $"mac-address" $inte...
by ADahi
Sat Dec 09, 2017 2:50 pm
Forum: Scripting
Topic: NV2 set cpe queue to 80% of wireless data rate
Replies: 33
Views: 1861

Re: NV2 set cpe queue to 80% of wireless data rate

RouterOS doesn't support floating numbers, so you have to eliminate point
by ADahi
Fri Dec 08, 2017 3:16 pm
Forum: The User Manager
Topic: Add profile to user via Console/API/Script
Replies: 29
Views: 23702

Re: Add profile to user via Console/API/Script

via Script/CLI suppose username is "111" suppose profile is TRIAL To remove user profiles try this /tool user-manager user clear-profiles numbers=[find username="111"]; To add profile to user try this /tool user-manager user create-and-activate-profile profile=TRIAL customer=admin numbers=[find user...
by ADahi
Fri Dec 08, 2017 2:07 pm
Forum: Scripting
Topic: ppp on-up/on-down variables
Replies: 5
Views: 5379

Re: ppp on-up/on-down variables

https://wiki.mikrotik.com/wiki/Manual:P ... r_Profiles
Execute script on user login-event. These are available variables that are accessible for the event script:
    user
    local-address
    remote-address
    caller-id
    called-id
    interface
by ADahi
Thu Dec 07, 2017 11:00 am
Forum: Scripting
Topic: NV2 set cpe queue to 80% of wireless data rate
Replies: 33
Views: 1861

Re: NV2 set cpe queue to 80% of wireless data rate

make your experiment and share result in the forum
Best Regards
by ADahi
Wed Dec 06, 2017 10:53 pm
Forum: Scripting
Topic: Scripting for Userman's User
Replies: 1
Views: 525

Re: Scripting for Userman's User

use it in ppp profile Scripts tab On UP: { #qouta in bytes :local quota ((1048576) * 1024); :local UQ [/interface get $interface name]; :local Download [/tool user-manager user get number=[find where user=$user] download-used]; :if ($Download > $quota) do={/queue simple add name=$user target=$UQ max...
by ADahi
Wed Dec 06, 2017 6:00 pm
Forum: Scripting
Topic: Script to update or create user.
Replies: 1
Views: 1040

Re: Script to update or create user.

Error there is space after else
 }else ={

the correct grammar space before else
} else={
by ADahi
Wed Dec 06, 2017 8:34 am
Forum: Scripting
Topic: Changing queues via script
Replies: 1
Views: 569

Re: Changing queues via script

:foreach QS in=[/queue simple find where max-limit=1024k/1024k] do={/queue simple set $QS max-limit=2048k/2048k }; or you can import full script. note: specify the time of day and time of night as you need /system scheduler add interval=1d name="NightSpeed(1->2)M" on-event=\ ":foreach QS in=[/queue...
by ADahi
Tue Dec 05, 2017 7:34 pm
Forum: Scripting
Topic: Mikrotik and Telegram
Replies: 38
Views: 14837

Re: Mikrotik and Telegram

Good work man
by ADahi
Tue Dec 05, 2017 1:21 pm
Forum: Scripting
Topic: NV2 set cpe queue to 80% of wireless data rate
Replies: 33
Views: 1861

Re: NV2 set cpe queue to 80% of wireless data rate

it is easy
after configure simple queue as you need
use this script
{ 
:local RX [/interface wireless registration-table get 0 rx-rate ]; 
:local QS [:pick $RX 0 [:find $RX "M"]]; 
/queue simple set 0 max-limit=((($QS / 10)*8)."M")
} 
by ADahi
Tue Dec 05, 2017 9:08 am
Forum: The User Manager
Topic: Unable to delete log
Replies: 1
Views: 622

Re: Unable to delete log

to delete all LOG table
/tool user-manager log remove numbers=[find]; 
by ADahi
Tue Dec 05, 2017 8:48 am
Forum: The User Manager
Topic: Run the same UM on tow RBs
Replies: 2
Views: 694

Re: Run the same UM on tow RBs

yes you can
add this to both routers
specify radius IP and secret
{
:local RadiusIP 192.168.1.1;
:local sec 123;
/radius add address=$RadiusIP secret=$sec service=hotspot timeout=3s
}

Best Regards
by ADahi
Tue Dec 05, 2017 8:25 am
Forum: The User Manager
Topic: API MIkrotik
Replies: 3
Views: 1353

Re: API MIkrotik

via Script/CLI suppose username is "111" suppose profile is TRIAL To remove user profiles try this /tool user-manager user clear-profiles numbers=[find username="111"]; To add profile to user try this /tool user-manager user create-and-activate-profile profile=TRIAL customer=admin numbers=[find user...
by ADahi
Tue Dec 05, 2017 7:41 am
Forum: Scripting
Topic: 123abc only need 123 :pick how to
Replies: 4
Views: 545

Re: 123abc only need 123 :pick how to

Sure it is easy :wink:

:global RX [/interface wireless registration-table get 0 rx-rate]
:log info [:pick $RX 0 [:find $RX "M"]]

Best Regards
by ADahi
Fri Dec 01, 2017 8:51 pm
Forum: The User Manager
Topic: find "start time" and "end time" by console
Replies: 2
Views: 1483

Re: find "start time" and "end time" by console

hi
how to find "start time" and "end time" of users in user manager with cli?
+1
by ADahi
Thu Nov 30, 2017 6:11 am
Forum: Scripting
Topic: Script to fetch Gateway IP
Replies: 5
Views: 1758

Re: Script to fetch Gateway IP

Sure :wink: to set the dynamic gateway for each pppoe-client, you can use this script # Get the dynamic gateway for each pppoe-client :global pppoe1-gateway [/ip route get number=[find gateway=pppoe1 && distance=0 && scope=10] dst-address]; :global pppoe2-gateway [/ip route get number=[find gateway=...
by ADahi
Thu Nov 30, 2017 5:44 am
Forum: Scripting
Topic: can i create scripting for this command
Replies: 1
Views: 361

Re: can i create scripting for this command

just add your command in
/system scheduler
by ADahi
Wed Nov 29, 2017 11:18 pm
Forum: Scripting
Topic: dns script
Replies: 13
Views: 3356

Re: dns script

...
by ADahi
Sun Nov 26, 2017 8:49 pm
Forum: Scripting
Topic: Solution: Automatically clean expired User-Manager accounts
Replies: 70
Views: 45261

Re: Solution: Automatically clean expired User-Manager accounts

Try this Script
/tool user-manager user remove numbers=[find where !actual-profile];