Hi everybody
I want to measure my abilities with mikrotik scripting language (only mikrotik scripting no API)
so if anyone has an idea for script i ll try to solve it for him
I have 2 3g/4g Ethernet routers that i am using as Wan1 and Wan2 links.
What I am trying to do is the following:
all traffic should go out Wan1 until I hit my data limit. The Telco gives me full speed of 4-20G until I hit my limit then throttles me to 32K. So the switch mechanism could be use Wan1 until the speed drops (I think very difficult but does not rely on data counters) or check data counters then disable Wan1 and use Wan2 (default backup routes i think).
Reset data counters on interfaces on specific day of the month.
what you want is exactly here , (the traffic monitor tool) : http://wiki.mikrotik.com/wiki/Manual:Tools/Traffic_Monitor
for resetting-counters , you need to put this in a scheduler that is repeated monthly …
/interface ethernet reset-counters “name of your interface, example:ether1”
sometimes this not , so you need to put a scheduler to reboot the RB each month
/system reboot
A script to maintain a list of static DNS entries based on host names found in DHCP leases. Allow the Mikrotik admin to specify the suffix, so a hostname of PC100 gets set as PC100.mycompany.local in the static DNS.
I dont get the full idea, but i think this is what you are looking for : (just copy and past in the new terminal)
/system script add name=Host_Name_DNS owner=admin policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive source=“#By Sin
an AlChalabi\r
\n#12-3-2016\r
\n#Static DNS enrty for DHCP leases \r
\n#Edit the suffix below\r
\n:local suffix ".mycompany.local"\r
\n:foreach i in [/ip dhcp-server lease find] do={\r
\n:local hname [/ip dhcp-server lease get value-name=host-name $i]\r
\n:local hadd [ip dhcp-server lease get value-name=address $i]\r
\n:local dnsname ("$hname"."$suffix")\r
\n/ip dns static add name=$dnsname address=$hadd ttl=1d\r
\n}”
Hey Sinan,
Here’s one for you I’ve been struggling with. I’m wanting to loop through all wifi channels in the 2.4GHz with a set delay between the channel changes.
For example: Frequency 2412, wait 30 seconds, change to 2417, wait 30 seconds, change to 2422, wait 30 seconds, etc… and have it continually loop until powered off.
Help with this would be greatly appreciated. Thank you.
thanx for answering instead of me.
if wanted to change the interval i suggest to put it in scheduler with the desired interval instead of using the delay function that will be easier to edit
Looks like it will work, thank you.
I just wanted something automated to hop through the channels for signal strengths at each channel. Primarily to see if there were any significant advantages for one channel versus another other than just looking at an app of my phone. Thanks again.
hi i need script for ( hotspot >user profile > script > on login & on logout)
that add nat masquerade (ip firewall nat add action=masquerade chain=srcnat src-address=userIP)
and remote it after user logout
i use 2 ip pool for hotspot first dhcp assign ip to user when he connect to wlan , second hotspot assign ip to logged in users form another ip pool
i need nat for second ip pool
some script will take ddosed ip’s from /ip firewall address-list and will add this to black hole like this /ip route add bgp-communities=1111:333 comment=ddosed distance=1 dst-address=“$id/32” type=blackhole i would like to run this every 5min and it will check again if ip removed from ddosed it will automatically remove it from black hole also.
So you have the address-list already? Then why don’t you just make a firewall rule to drop all packets from that address-list? Why does it have to be a route?